1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-01 17:36:21 +03:00

Coding - Migration of ExpToCas to own repository #442

New repository for ExpToCas: https://github.com/Open-Cascade-SAS/ExpToCas
Documentation and all build process are fully migrated.
This commit is contained in:
Pasukhin Dmitry 2025-03-18 20:41:12 +00:00 committed by GitHub
parent c29c19bb0a
commit 99c7ce57c1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
82 changed files with 6 additions and 12384 deletions

View File

@ -39,7 +39,9 @@ runs:
shell: pwsh
run: |
$changedFiles = git diff --name-only origin/${{ inputs.base-ref }} HEAD |
Where-Object { $_ -match '${{ inputs.file-pattern }}' }
Where-Object { $_ -match '${{ inputs.file-pattern }}' } |
Where-Object { Test-Path $_ }
$changedFiles | Set-Content "changed_files.txt"
if ($changedFiles.Count -gt 0) {
echo "has_files=true" >> $env:GITHUB_OUTPUT
@ -49,7 +51,7 @@ runs:
if: steps.changed-files.outputs.has_files == 'true'
shell: pwsh
run: |
$files = Get-Content "changed_files.txt"
$files = Get-Content "changed_files.txt" | Where-Object { Test-Path $_ }
$files | ForEach-Object -ThrottleLimit 8 -Parallel {
clang-format -i -style=file $_
}

View File

@ -398,10 +398,6 @@ if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore" AND BUILD_MODULE_Draw)
message (STATUS "Info. Draw module is turned off due to it is not supported on UWP")
set (BUILD_MODULE_Draw OFF CACHE BOOL "${BUILD_MODULE_Draw_DESCR}" FORCE)
endif()
if (EMSCRIPTEN AND BUILD_MODULE_DETools)
message (STATUS "Info. DETools module is turned off due to it is not supported on Emscripten")
set (BUILD_MODULE_DETools OFF CACHE BOOL "${BUILD_MODULE_DETools_DESCR}" FORCE)
endif()
# accumulate used toolkits (first level) in BUILD_TOOLKITS variable
list (APPEND BUILD_TOOLKITS ${BUILD_ADDITIONAL_TOOLKITS})

View File

@ -1,8 +1,7 @@
FoundationClasses TKernel TKMath
ModelingData TKG2d TKG3d TKGeomBase TKBRep
ModelingAlgorithms TKGeomAlgo TKTopAlgo TKPrim TKBO TKBool TKHLR TKFillet TKOffset TKFeat TKMesh TKXMesh TKShHealing
ModelingAlgorithms TKGeomAlgo TKTopAlgo TKPrim TKBO TKBool TKHLR TKFillet TKOffset TKFeat TKMesh TKXMesh TKShHealing TKExpress
Visualization TKService TKV3d TKOpenGl TKOpenGles TKMeshVS TKIVtk TKD3DHost
ApplicationFramework TKCDF TKLCAF TKCAF TKBinL TKXmlL TKBin TKXml TKStdL TKStd TKTObj TKBinTObj TKXmlTObj TKVCAF
DataExchange TKDE TKXSBase TKDESTEP TKDEIGES TKDESTL TKDEVRML TKDECascade TKDEOBJ TKDEGLTF TKDEPLY TKXCAF TKXmlXCAF TKBinXCAF TKRWMesh
DETools TKExpress ExpToCasExe
Draw TKDraw TKTopTest TKOpenGlTest TKOpenGlesTest TKD3DHostTest TKViewerTest TKXSDRAW TKDCAF TKXDEDRAW TKTObjDRAW TKQADraw TKIVtkDraw DRAWEXE TKXSDRAWDE TKXSDRAWGLTF TKXSDRAWIGES TKXSDRAWOBJ TKXSDRAWPLY TKXSDRAWSTEP TKXSDRAWSTL TKXSDRAWVRML

View File

@ -472,6 +472,4 @@ n RWGltf
n RWMesh
n RWObj
n RWPly
n Express
t TKExpress
x ExpToCasExe

View File

@ -113,7 +113,6 @@ endmacro()
BUILD_MODULE_MESSAGE (BUILD_MODULE_ApplicationFramework "ApplicationFramework")
BUILD_MODULE_MESSAGE (BUILD_MODULE_DataExchange "DataExchange")
BUILD_MODULE_MESSAGE (BUILD_MODULE_DETools "DETools")
BUILD_MODULE_MESSAGE (BUILD_MODULE_Draw "Draw")
BUILD_MODULE_MESSAGE (BUILD_MODULE_FoundationClasses "FoundationClasses")
BUILD_MODULE_MESSAGE (BUILD_MODULE_ModelingAlgorithms "ModelingAlgorithms")

View File

@ -33,7 +33,6 @@ set "BUILD_ModelingAlgorithms=ON"
set "BUILD_Visualization=ON"
set "BUILD_ApplicationFramework=ON"
set "BUILD_DataExchange=ON"
set "BUILD_DETools=OFF"
rem Optional 3rd-party libraries to enable
set "USE_FREETYPE=ON"
@ -168,7 +167,6 @@ if ["%toCMake%"] == ["1"] (
-D BUILD_MODULE_Visualization:BOOL="%BUILD_Visualization%" ^
-D BUILD_MODULE_ApplicationFramework:BOOL="%BUILD_ApplicationFramework%" ^
-D BUILD_MODULE_DataExchange:BOOL="%BUILD_DataExchange%" ^
-D BUILD_MODULE_DETools:BOOL="OFF" ^
-D BUILD_MODULE_Draw:BOOL="OFF" ^
-D BUILD_DOC_Overview:BOOL="OFF" ^
-D USE_FREETYPE:BOOL="%USE_FREETYPE%" ^

View File

@ -27,7 +27,6 @@ rem set "BUILD_ModelingAlgorithms=ON"
rem set "BUILD_Visualization=ON"
rem set "BUILD_ApplicationFramework=ON"
rem set "BUILD_DataExchange=ON"
rem set "BUILD_MODULE_DETools=OFF"
rem Optional 3rd-party libraries to enable
rem set "USE_RAPIDJSON=ON"

View File

@ -29,7 +29,6 @@ rem set BUILD_ADDITIONAL_TOOLKITS=
rem set BUILD_MODULE_ApplicationFramework=ON
rem set BUILD_MODULE_DataExchange=ON
rem set BUILD_MODULE_DETools=OFF
rem set BUILD_MODULE_Draw=ON
rem set BUILD_MODULE_ModelingAlgorithms=ON
rem set BUILD_MODULE_ModelingData=ON

View File

@ -22,7 +22,6 @@ FREETYPE_DIR="$OCCT3RDPARTY/freetype-2.7.1"
#BUILD_MODULE_ApplicationFramework=ON
#BUILD_MODULE_DataExchange=ON
#BUILD_MODULE_DETools=OFF
#BUILD_MODULE_Draw=ON
#BUILD_MODULE_ModelingAlgorithms=ON
#BUILD_MODULE_ModelingData=ON

View File

@ -26,7 +26,6 @@ set BUILD_FORCE_RelWithDebInfo=OFF
set BUILD_MODULE_ApplicationFramework=ON
set BUILD_MODULE_DataExchange=ON
set BUILD_MODULE_DETools=OFF
set BUILD_MODULE_Draw=ON
set BUILD_MODULE_ModelingAlgorithms=ON
set BUILD_MODULE_ModelingData=ON
@ -60,7 +59,6 @@ cmake -G "%arch_compile%" ^
-D BUILD_LIBRARY_TYPE:STRING=%BUILD_LIBRARY_TYPE% ^
-D BUILD_MODULE_ApplicationFramework:BOOL=%BUILD_MODULE_ApplicationFramework% ^
-D BUILD_MODULE_DataExchange:BOOL=%BUILD_MODULE_DataExchange% ^
-D BUILD_MODULE_DETools:BOOL=%BUILD_MODULE_DETools% ^
-D BUILD_MODULE_Draw:BOOL=%BUILD_MODULE_Draw% ^
-D BUILD_MODULE_FoundationClasses:BOOL=ON ^
-D BUILD_MODULE_ModelingAlgorithms:BOOL=%BUILD_MODULE_ModelingAlgorithms% ^

View File

@ -29,7 +29,6 @@ BUILD_ENABLE_FPE_SIGNAL_HANDLER=ON
BUILD_MODULE_ApplicationFramework=ON
BUILD_MODULE_DataExchange=ON
BUILD_MODULE_DETools=OFF
BUILD_MODULE_Draw=ON
BUILD_MODULE_ModelingAlgorithms=ON
BUILD_MODULE_ModelingData=ON
@ -61,7 +60,6 @@ cmake -G "Unix Makefiles" \
-D BUILD_LIBRARY_TYPE:STRING=$BUILD_LIBRARY_TYPE \
-D BUILD_MODULE_ApplicationFramework:BOOL=$BUILD_MODULE_ApplicationFramework \
-D BUILD_MODULE_DataExchange:BOOL=$BUILD_MODULE_DataExchange \
-D BUILD_MODULE_DETools:BOOL=$BUILD_MODULE_DETools \
-D BUILD_MODULE_Draw:BOOL=$BUILD_MODULE_Draw \
-D BUILD_MODULE_FoundationClasses:BOOL=ON \
-D BUILD_MODULE_ModelingAlgorithms:BOOL=$BUILD_MODULE_ModelingAlgorithms \

View File

@ -34,7 +34,6 @@ export BUILD_ModelingAlgorithms=ON
export BUILD_Visualization=ON
export BUILD_ApplicationFramework=ON
export BUILD_DataExchange=ON
export BUILD_DETools=OFF
export USE_FREETYPE=ON
export USE_FREEIMAGE=OFF
@ -148,7 +147,6 @@ function buildArch {
-D BUILD_MODULE_Visualization:BOOL="${BUILD_Visualization}" \
-D BUILD_MODULE_ApplicationFramework:BOOL="${BUILD_ApplicationFramework}" \
-D BUILD_MODULE_DataExchange:BOOL="${BUILD_DataExchange}" \
-D BUILD_MODULE_DETools:BOOL="${BUILD_DETools}" \
-D BUILD_MODULE_Draw:BOOL="OFF" \
-D BUILD_DOC_Overview:BOOL="OFF" \
"$aCasSrc" 2>&1 | tee -a "$aLogFile"

View File

@ -20,7 +20,6 @@ export aDraco="$aSrcRoot/../3rdparty/draco-1.4.1-ios"
#export BUILD_Visualization=ON
#export BUILD_ApplicationFramework=ON
#export BUILD_DataExchange=ON
#export BUILD_DETools=OFF
#export USE_RAPIDJSON=ON
#export USE_DRACO=ON

View File

@ -34,7 +34,6 @@ export BUILD_ModelingAlgorithms=ON
export BUILD_Visualization=ON
export BUILD_ApplicationFramework=ON
export BUILD_DataExchange=ON
export BUILD_DETools=OFF
export BUILD_Draw=ON
export USE_FREETYPE=ON
@ -145,7 +144,6 @@ function buildArch {
-D BUILD_MODULE_Visualization:BOOL="${BUILD_Visualization}" \
-D BUILD_MODULE_ApplicationFramework:BOOL="${BUILD_ApplicationFramework}" \
-D BUILD_MODULE_DataExchange:BOOL="${BUILD_DataExchange}" \
-D BUILD_MODULE_DETools:BOOL="${BUILD_DETools}" \
-D BUILD_MODULE_Draw:BOOL="${BUILD_Draw}" \
-D BUILD_DOC_Overview:BOOL="OFF" \
"$aCasSrc" 2>&1 | tee -a "$aLogFile"

View File

@ -19,7 +19,6 @@ export aDraco="$aSrcRoot/../3rdparty/draco-1.4.1-macos"
#export BUILD_Visualization=ON
#export BUILD_ApplicationFramework=ON
#export BUILD_DataExchange=ON
#export BUILD_DETools=OFF
#export BUILD_Draw=ON
#export USE_RAPIDJSON=ON

View File

@ -32,7 +32,6 @@ set "BUILD_ModelingAlgorithms=ON"
set "BUILD_Visualization=ON"
set "BUILD_ApplicationFramework=ON"
set "BUILD_DataExchange=ON"
set "BUILD_DETools=OFF"
set "BUILD_Draw=ON"
rem Optional 3rd-party libraries to enable
@ -155,7 +154,6 @@ if ["%toCMake%"] == ["1"] (
-D BUILD_MODULE_Visualization:BOOL="%BUILD_Visualization%" ^
-D BUILD_MODULE_ApplicationFramework:BOOL="%BUILD_ApplicationFramework%" ^
-D BUILD_MODULE_DataExchange:BOOL="%BUILD_DataExchange%" ^
-D BUILD_MODULE_DETools:BOOL="%BUILD_DETools%" ^
-D BUILD_MODULE_Draw:BOOL="%BUILD_Draw%" ^
-D 3RDPARTY_TCL_DIR:PATH="%aTclTk%" ^
-D 3RDPARTY_TCL_INCLUDE_DIR:FILEPATH="%aTclTk%/include" ^

View File

@ -22,7 +22,6 @@ rem set "BUILD_ModelingAlgorithms=ON"
rem set "BUILD_Visualization=ON"
rem set "BUILD_ApplicationFramework=ON"
rem set "BUILD_DataExchange=ON"
rem set "BUILD_DETools=OFF"
rem set "BUILD_Draw=ON"
rem set "USE_RAPIDJSON=ON"

View File

@ -32,7 +32,6 @@ set "BUILD_ModelingAlgorithms=ON"
set "BUILD_Visualization=ON"
set "BUILD_ApplicationFramework=ON"
set "BUILD_DataExchange=ON"
set "BUILD_DETools=OFF"
set "BUILD_Draw=OFF"
rem Optional 3rd-party libraries to enable
@ -176,7 +175,6 @@ if ["%toCMake%"] == ["1"] (
-D BUILD_MODULE_Visualization:BOOL="%BUILD_Visualization%" ^
-D BUILD_MODULE_ApplicationFramework:BOOL="%BUILD_ApplicationFramework%" ^
-D BUILD_MODULE_DataExchange:BOOL="%BUILD_DataExchange%" ^
-D BUILD_MODULE_DETools:BOOL="%BUILD_DETools%" ^
-D BUILD_MODULE_Draw:BOOL="%BUILD_Draw%" ^
-D BUILD_DOC_Overview:BOOL="OFF" ^
-D USE_FREETYPE:BOOL="%USE_FREETYPE%" ^

View File

@ -20,7 +20,6 @@ export BUILD_ModelingAlgorithms=ON
export BUILD_Visualization=ON
export BUILD_ApplicationFramework=ON
export BUILD_DataExchange=ON
export BUILD_DETools=OFF
if [ -f "${aScriptDir}/wasm_custom.sh" ] ; then
. "${aScriptDir}/wasm_custom.sh"
@ -75,7 +74,6 @@ echo cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE:FILEPATH="${aToolchain}" \
-DBUILD_MODULE_Visualization:BOOL="${BUILD_Visualization}" \
-DBUILD_MODULE_ApplicationFramework:BOOL="${BUILD_ApplicationFramework}" \
-DBUILD_MODULE_DataExchange:BOOL="${BUILD_DataExchange}" \
-DBUILD_MODULE_DETools:BOOL="${BUILD_DETools}" \
-DBUILD_MODULE_Draw:BOOL="OFF" \
-DBUILD_DOC_Overview:BOOL="OFF" "${aSrcRoot}"
@ -94,7 +92,6 @@ cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE:FILEPATH="${aToolchain}" \
-DBUILD_MODULE_Visualization:BOOL="${BUILD_Visualization}" \
-DBUILD_MODULE_ApplicationFramework:BOOL="${BUILD_ApplicationFramework}" \
-DBUILD_MODULE_DataExchange:BOOL="${BUILD_DataExchange}" \
-DBUILD_MODULE_DETools:BOOL="${BUILD_DETools}" \
-DBUILD_MODULE_Draw:BOOL="OFF" \
-DBUILD_DOC_Overview:BOOL="OFF" "${aSrcRoot}"

View File

@ -23,7 +23,6 @@ rem set "BUILD_ModelingAlgorithms=ON"
rem set "BUILD_Visualization=ON"
rem set "BUILD_ApplicationFramework=ON"
rem set "BUILD_DataExchange=ON"
rem set "BUILD_DETools=OFF"
rem set "USE_RAPIDJSON=ON"
rem set "USE_DRACO=ON"

View File

@ -14,4 +14,3 @@ export EMSDK_ROOT="$aSrcRoot/../emsdk"
#export BUILD_Visualization=ON
#export BUILD_ApplicationFramework=ON
#export BUILD_DataExchange=ON
#export BUILD_DETools=OFF

View File

@ -1,5 +0,0 @@
project(ExpToCasExe)
set (EXECUTABLE_PROJECT ON)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
unset (EXECUTABLE_PROJECT)

View File

@ -1,3 +0,0 @@
TKernel
TKExpress
CSF_wsock32

View File

@ -1,396 +0,0 @@
// Created: Mon Nov 1 12:50:27 1999
// Author: Andrey BETENEV
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <cstring>
#include <Express_Item.hxx>
#include <Express_Schema.hxx>
#include <Message.hxx>
#include <OSD_File.hxx>
#include <OSD_FileSystem.hxx>
#include <OSD_OpenFile.hxx>
#include <TCollection_HAsciiString.hxx>
#include "exptocas.tab.hxx"
//=======================================================================
// function : GetSchema
// purpose : interface to parser
//=======================================================================
Handle(Express_Schema) GetSchema(const char* theFileName)
{
std::ifstream aFileStream;
OSD_OpenStream(aFileStream, theFileName, std::ios_base::in | std::ios_base::binary);
exptocas::scanner aScanner(&aFileStream);
aScanner.yyrestart(&aFileStream);
// uncomment next string for debug of parser
// aScanner.set_debug(1);
exptocas::parser aParser(&aScanner);
aParser.parse();
return Express::Schema();
}
//=======================================================================
// function : LoadList
// purpose : Load list of (class name, package name) from the file
// Package names and optional mark flag are set to items in the schema
//=======================================================================
static Standard_Boolean LoadList(const char* theFileName,
const Handle(Express_Schema)& theSchema,
const Standard_Boolean theMark)
{
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
std::shared_ptr<std::istream> aStreamPtr = aFileSystem->OpenIStream(theFileName, std::ios::in);
Standard_IStream& anIS = *aStreamPtr;
if (aStreamPtr == nullptr)
{
Message::SendFail() << "Error: cannot open " << theFileName;
return Standard_False;
}
Message::SendInfo() << "Loading " << theFileName << "...";
char aBuf[512];
Standard_Integer aLineNum = 0;
// a line entry in file has the next format:
// item_name package_name [shortname [check_flag(0 or 1) [fillshared_flag(0 or 1) [category]]]]
while (anIS.getline(aBuf, 512))
{
char* aCurPos = aBuf;
char* anItemName;
char* aPackageName;
char* aShortName;
char* aCheckFlag;
char* aFillSharedFlag;
char* aCategoryName;
Standard_Size aSepIdx = 0;
aLineNum += 1;
// -------------------------------------------------------------
// first word is an item name
// -------------------------------------------------------------
// skip any whitespace character in the line
while (*aCurPos && (aSepIdx = strcspn(aCurPos, " \t\r\n")) == 0)
{
aCurPos++;
}
// to next line if first word isn't found or comment started
if (*aCurPos == '\0' || *aCurPos == '#')
{
continue;
}
// get the name of the item
anItemName = aCurPos;
// shift the position
if (aCurPos[aSepIdx] == '\0')
{
aCurPos += aSepIdx;
}
else
{
aCurPos[aSepIdx] = '\0';
aCurPos += aSepIdx + 1;
}
Handle(Express_Item) anItem = theSchema->Item(anItemName, Standard_True);
// skip any class name not in schema
if (anItem.IsNull())
{
continue;
}
// -------------------------------------------------------------
// second word is a package name
// -------------------------------------------------------------
// skip any whitespace character in the rest of the line
while (*aCurPos && (aSepIdx = strcspn(aCurPos, " \t\r\n")) == 0)
{
aCurPos++;
}
// to next line if second word isn't found or comment started
if (*aCurPos == '\0' || *aCurPos == '#')
{
continue;
}
// get the name of the package
aPackageName = aCurPos;
// shift the position
if (aCurPos[aSepIdx] == '\0')
{
aCurPos += aSepIdx;
}
else
{
aCurPos[aSepIdx] = '\0';
aCurPos += aSepIdx + 1;
}
// make warning if there is another package for the item
if (anItem->IsPackageNameSet() && anItem->GetPackageName().IsDifferent(aPackageName))
{
Message::SendWarning() << "Warning: Package is redefined for item " << anItemName;
}
anItem->SetPackageName(aPackageName);
anItem->SetGenMode(theMark ? Express_Item::GM_GenByUser : Express_Item::GM_NoGen);
// -------------------------------------------------------------
// third word is an item short name (optional)
// -------------------------------------------------------------
// skip any whitespace character in the line
while (*aCurPos && (aSepIdx = strcspn(aCurPos, " \t\r\n")) == 0)
{
aCurPos++;
}
// to next line if third word isn't found or comment started
if (*aCurPos == '\0' || *aCurPos == '#')
{
continue;
}
// get the short name
aShortName = aCurPos;
// shift the position
if (aCurPos[aSepIdx] == '\0')
{
aCurPos += aSepIdx;
}
else
{
aCurPos[aSepIdx] = '\0';
aCurPos += aSepIdx + 1;
}
if (!std::isalpha(*aShortName))
{
Message::SendWarning() << "Warning: Not recognized a shortname at the line " << aLineNum;
continue;
}
// if short name "-" then just do not set it
if (*aShortName != '-')
{
Handle(TCollection_HAsciiString) anItemShortName = new TCollection_HAsciiString(aShortName);
if (anItemShortName->Length() > 0)
{
anItem->SetShortName(anItemShortName);
}
}
// -------------------------------------------------------------
// fourth word is an item check flag (optional)
// -------------------------------------------------------------
// skip any whitespace character in the line
while (*aCurPos && (aSepIdx = strcspn(aCurPos, " \t\r\n")) == 0)
{
aCurPos++;
}
// to next line if fourth word isn't found or comment started
if (*aCurPos == '\0' || *aCurPos == '#')
{
continue;
}
// get the check flag
aCheckFlag = aCurPos;
// shift the position
if (aCurPos[aSepIdx] == '\0')
{
aCurPos += aSepIdx;
}
else
{
aCurPos[aSepIdx] = '\0';
aCurPos += aSepIdx + 1;
}
if (!(*aCheckFlag == '0' || *aCheckFlag == '1'))
{
Message::SendWarning() << "Warning: Not recognized a check flag at the line " << aLineNum;
continue;
}
Standard_Boolean hasCheck = (*aCheckFlag == '0' ? Standard_False : Standard_True);
anItem->SetCheckFlag(hasCheck);
// -------------------------------------------------------------
// fifth word is an item fill share flag (optional)
// -------------------------------------------------------------
// skip any whitespace character in the line
while (*aCurPos && (aSepIdx = strcspn(aCurPos, " \t\r\n")) == 0)
{
aCurPos++;
}
// to next line if fifth word isn't found or comment started
if (*aCurPos == '\0' || *aCurPos == '#')
{
continue;
}
// get the fill share flag
aFillSharedFlag = aCurPos;
// shift the position
if (aCurPos[aSepIdx] == '\0')
{
aCurPos += aSepIdx;
}
else
{
aCurPos[aSepIdx] = '\0';
aCurPos += aSepIdx + 1;
}
if (!(*aFillSharedFlag == '0' || *aFillSharedFlag == '1'))
{
Message::SendWarning() << "Warning: Not recognized a fill shared flag at the line "
<< aLineNum;
continue;
}
Standard_Boolean hasFillShared = (*aFillSharedFlag == '0' ? Standard_False : Standard_True);
anItem->SetFillSharedFlag(hasFillShared);
// -------------------------------------------------------------
// sixth word is an item category name (optional)
// -------------------------------------------------------------
// skip any whitespace character in the line
while (*aCurPos && (aSepIdx = strcspn(aCurPos, " \t\r\n")) == 0)
{
aCurPos++;
}
// to next line if sixth word isn't found or comment started
if (*aCurPos == '\0' || *aCurPos == '#')
{
continue;
}
// get the category name
aCategoryName = aCurPos;
aCurPos[aSepIdx] = '\0';
if (!std::isalpha(*aCategoryName))
{
Message::SendWarning() << "Warning: Not recognized a category name at the line " << aLineNum;
continue;
}
// if category name "-" then just do not set it
if (*aCategoryName != '-')
{
Handle(TCollection_HAsciiString) anItemCategoryName =
new TCollection_HAsciiString(aCategoryName);
if (anItemCategoryName->Length() > 0)
{
anItem->SetShortName(anItemCategoryName);
}
}
}
Message::SendInfo() << " Done";
return Standard_True;
}
//=================================================================================================
int main(int argc, char* argv[])
{
if (argc < 2)
{
Message::SendInfo()
<< "EXPRESS -> CASCADE/XSTEP classes generator 3.0\n"
"Use: ExpToCas <schema.exp> [<create.lst> [<packaging.lst> [start_index]]]\n"
"Where: \n"
"- schema.exp is a file with EXPRESS schema \n"
"- create.lst is a file with list of types to generate (all if none)\n"
" (or \"-\" for creating all entities in the schema)\n"
"- packaging.lst is a file with classes distribution per package\n"
" in the form of the list (one item per line) \"<TypeName> <Package>\"\n"
" If package not defined for some type, \"StepStep\" assumed\n"
"- start_index - a first number for auxiliary generated files with data\n"
" to copy into StepAP214_Protocol.cxx, RWStepAP214_GeneralModule.cxx and\n"
" RWStepAP214_ReadWriteModule.cxx";
return 0;
}
//=================================
// Step 1: parsing EXPRESS file
// open schema file
OSD_Path aPath(argv[1]);
OSD_File aFile(aPath);
if (!aFile.IsReadable())
{
Message::SendFail() << "Error: Cannot open " << argv[1];
return -1;
}
// parse
Message::SendInfo() << "Starting parsing " << argv[1];
Handle(Express_Schema) aSchema = GetSchema(argv[1]);
if (aSchema.IsNull())
{
Message::SendFail() << "Error: Parsing finished with no result";
return -1;
}
else
{
Message::SendInfo() << "Schema " << aSchema->Name()->ToCString() << " successfully parsed";
}
Message::SendInfo() << "Total " << aSchema->NbItems() << " items";
//=================================
// Step 2: Prepare data for creating classes
// load packaging information
if (argc > 3)
{
if (!LoadList(argv[3], aSchema, Standard_False))
{
return -1;
}
}
// load list of classes to generate
if (argc > 2)
{
if (argv[2][0] == '-')
{
// set mark for all items
for (Standard_Integer num = 1; num <= aSchema->NbItems(); num++)
{
aSchema->Item(num)->SetGenMode(Express_Item::GM_GenByUser);
}
}
else if (!LoadList(argv[2], aSchema, Standard_True))
{
return -1;
}
}
// get starting index
Standard_Integer anIndex = -1;
if (argc > 4)
{
char* aStopSymbol;
anIndex = (Standard_Integer)strtol(argv[4], &aStopSymbol, 10);
if (*aStopSymbol != '\0')
{
Message::SendFail() << "Error: invalid starting index: " << argv[4];
return -1;
}
}
//=================================
// Step 3: Iterate over new items and set the package name if need
const TCollection_AsciiString aUserName("user");
for (Standard_Integer aNum = 1; aNum <= aSchema->NbItems(); aNum++)
{
if (aSchema->Item(aNum)->GetGenMode() == Express_Item::GM_GenByUser)
{
aSchema->Item(aNum)->Use2(aUserName, Express_Item::GetUnknownPackageName());
}
}
//=================================
// Step 4: Iterate by items and generate classes
Standard_Boolean isDone = Standard_False;
Express_Item::SetIndex(anIndex);
do
{
isDone = Standard_False;
for (Standard_Integer aNum = 1; aNum <= aSchema->NbItems(); aNum++)
{
isDone = isDone || aSchema->Item(aNum)->Generate();
}
} while (isDone);
return 0;
}

View File

@ -1,7 +0,0 @@
exptocas.lex
exptocas.yacc
lex.exptocas.cxx
exptocas.tab.hxx
exptocas.tab.cxx
ExpToCasExe.cxx

View File

@ -1,171 +0,0 @@
# STEP express schema to OCCT classes
## 1. Introduction
**ExpToCasExe** is an auxiliary tool to generate code for implementation
of new STEP entities into OCCT.
This tool consists of two packages: **ExpToCasExe** and **TKExpress**.
*ExpToCasExe* package is the basic package for generation.
It parses the express schema, makes a list of entities described in the schema,
and starts generating classes according to the specified lists.
This package has the file *occt_existed_step_entities.lst* witch contains list
of STEP entities implemented in *OCCT* at this moment.
*TKExpress* package generates files with description of the STEP entities
to use in *OCCT* taking into account their dependencies.
Below is a set of generated files using the example
of the *Condition* entity from the *StepAP214* package.
* **StepAP214_Condition.hxx** - contains declaration of the class that describes STEP entity
* **StepAP214_Condition.cxx** - contains definition of the class that describes STEP entity
* **RWStepAP214_RWCondition.hxx** - contains declaration of the class that reads (writes) STEP entity from STEP file
* **RWStepAP214_RWCondition.cxx** - contains definition of the class that reads (writes) STEP entity from STEP file
* **category.txt** - common file for all generated entities with part of code to insert to *RWStepAP214_GeneralModule.cxx* file
* **fillshared.txt** - common file for all generated entities with part of code to insert to *RWStepAP214_GeneralModule.cxx* file
* **inc.txt** - common file for all generated entities with part of code to insert to *StepAP214_Protocol.cxx*
* **newvoid.txt** - common file for all generated entities with part of code to insert to *RWStepAP214_GeneralModule.cxx* file
* **protocol.txt** - common file for all generated entities with part of code to insert to *StepAP214_Protocol.cxx* file
* **readstep.txt** - common file for all generated entities with part of code to insert to *RWStepAP214_ReadWriteModule.cxx* file
* **reco.txt** - common file for all generated entities with part of code to insert to *RWStepAP214_ReadWriteModule.cxx* file
* **rwinc.txt** - common file for all generated entities with part of code to insert to *RWStepAP214_ReadWriteModule.cxx* file
* **steptype.txt** - common file for all generated entities with part of code to insert to *RWStepAP214_ReadWriteModule.cxx* file
* **typebind.txt** - common file for all generated entities with part of code to insert to *RWStepAP214_ReadWriteModule.cxx* file
* **writestep.txt** - common file for all generated entities with part of code to insert to *RWStepAP214_ReadWriteModule.cxx* file
## 2. Build
The build process is automated, but has some specifics. *ExpToCasExe* package contains file *exptocas.lex*
which contains rules for lexical analyzer builder (*FLEX*), and file *exptocas.yacc*
which contains rules for syntax analyzer builder (*GNU Bison*).
During build process *FLEX* and *Bison* generate the next files:
* FlexLexer.h
* lex.exptocas.cxx
* exptocas.tab.cxx
* exptocas.tab.hxx
These files are placed to the source directory ("*src/ExpToCasExe*") due to *CMAKE* script specific.
Then standard Visual Studio build process continues.
There is no necessary to include these files to the *git* repository, due to automatic generation.
To change the behaviour of Express schema parser, the user need to modify original files:
*exptocas.lex* and *exptocas.yacc*.
## 3. Usage
**ExpToCasExe** program has the following call pattern:
~~~~
> ExpToCasExe <schema.exp> [<new.lst> [<existed.lst> [start_index]]]
~~~~
where:
* **schema.exp** - file with STEP Express schema
* **new.lst** - file with list of new STEP entities which we have to generate
* **existed.lst** - file with list of already implemented STEP entities
* **start_index** - a first index for entity registration
(value of it you can receive after analyse of *StepAP214_Protocol.cxx* file)
If *new.lst* file is set to "-" then all entities from Express schema are considered as new.
*new.lst* and *existed.lst* are the text files. Line in file describes the class name
of STEP entity and to witch *OCCT* package it's belong. Line has the following format:
~~~~
item_name package_name [shortname [check_flag(0 or 1) [fillshared_flag(0 or 1) [category]]]]
~~~~
where:
* **item_name** is the class name of the STEP entity (*ProductDefinitionOrReference* for example)
* **package_name** is the name of the *OCCT* package (*StepBasic* for example)
* **shortname** is the short name of the STEP entity
* **check_flag** is the flag to generate the *Check* function in the class
* **fillshared_flag** is the flag to generate the *FillShared* function in the class
* **category** is the name of category to witch entity belongs to
These file can include comments after the symbol "#".
The result of generation consists of several folders:
* two folders (*\_package_name\_* and *RW\_package_name\_*) for each package for which new entities were generated.
* a folder *Registration* with *\*.txt* files with code to copy into common files (see the example in the first section).
For generation, it is easy to copy to separate directory following files:
* **ExpToCasExe.exe**, **TKernel.dll** and **TKExpress.dll** from OCCT
* STEP Express schema
* **occt_existed_step_entities.lst** from package *ExpToCasExe*
create a file with needed entities **new.lst** and from this directory execute command:
~~~~
> ExpToCasExe.exe schema.exp new.lst occt_existed_step_entities.lst 1000
~~~~
## 4. Disclaimer
**NOTE**:
Some STEP schemes may be not fully corresponded to the rules which set in our generator.
If during generation we receive a message about syntax error you can try to edit schema
file in order to avoid it. Such approach is reasonable if number of errors is small.
If there are many errors we have to change existed rules (for debug parser process you can
uncomment string "//aScanner.set_debug(1);" in the file *exptocas.yacc*).
TIP: remove upper case from name after SCHEMA key word.
**NOTE**:
Please, take into account that most of existed entities were generated many years ago.
Some of them can be not corresponded to last versions of schemes.
For example, we don't have classes for entity:
~~~~
ENTITY founded_item
SUPERTYPE OF ((ONEOF(b_spline_curve_knot_locator, b_spline_curve_segment, b_spline_surface_knot_locator,
b_spline_surface_patch, b_spline_surface_strip,
boundary_curve_of_b_spline_or_rectangular_composite_surface, box_domain,
character_glyph_style_outline, character_glyph_style_stroke, composite_curve_segment,
composite_curve_transition_locator, curve_style, curve_style_font, curve_style_font_and_scaling,
curve_style_font_pattern, externally_defined_style, fill_area_style,
interpolated_configuration_segment, kinematic_path_segment, plane_angle_and_length_pair,
plane_angle_and_ratio_pair, point_style, presentation_style_assignment,
rectangular_composite_surface_transition_locator, surface_patch, surface_side_style,
surface_style_boundary, surface_style_control_grid, surface_style_fill_area,
surface_style_parameter_line, surface_style_segmentation_curve, surface_style_silhouette,
surface_style_usage, symbol_style, text_style, view_volume)) ANDOR
(ONEOF(character_glyph_style_outline, character_glyph_style_stroke, curve_style, curve_style_font,
curve_style_font_and_scaling, curve_style_font_pattern, externally_defined_style,
fill_area_style, point_style, presentation_style_assignment, surface_side_style,
surface_style_boundary, surface_style_control_grid, surface_style_fill_area,
surface_style_parameter_line, surface_style_segmentation_curve, surface_style_silhouette,
surface_style_usage, symbol_style, text_style)));
DERIVE
users : SET [0 : ?] OF founded_item_select := using_items(SELF, []);
WHERE
WR1: SIZEOF(users) > 0;
WR2: NOT (SELF IN users);
END_ENTITY;
~~~~
But some of existed entities (for example - *composite_curve_segment*) must be inherited from
this missing entity (at present such existed entities are inherited from *Standard_Transient*):
~~~~
ENTITY composite_curve_segment
SUBTYPE OF (founded_item);
transition : transition_code;
same_sense : BOOLEAN;
parent_curve : curve;
INVERSE
using_curves : BAG[1:?] OF composite_curve FOR segments;
WHERE
wr1 : ('AUTOMOTIVE_DESIGN.BOUNDED_CURVE' IN TYPEOF(parent_curve));
END_ENTITY; -- 10303-42: geometry_schema
~~~~
**NOTE**: To facilitate the work of those who will use this program after you,
it is strongly recommended update the file **occt_existed_step_entities.lst**
after each generation and not to forget to change update date in the first line of this file.

View File

@ -1,203 +0,0 @@
%{
// Created: Thu Oct 28 12:21:16 1999
// Author: Andrey BETENEV
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
/*****************************************************************************
This LEX scanner is performs lexical analysis of EXPRESS schema file
for EXPRESS -> CASCADE/XSTEP classes generator
On the stage of lexical scanner comments (single- and multi-line),
definitions of CONSTANT, FUNCTION, RULE items and clauses WHERE, INVERSE
and DERIVE of TYPE amd ENTITY items are dismissed (ignored)
Then, keywords such as ENTITY, SUPERTYPE, SET etc., names of items
and special symbols are identified and returned to parser (yacc) as tokens
Also, error processing and current line number tracking functions are defined
*****************************************************************************/
/************************************/
/* Section 1 */
/* definitions */
#include <stdlib.h>
#include <string.h>
#include <TColStd_HSequenceOfHAsciiString.hxx>
#include <Express_HSequenceOfField.hxx>
#include <Express_HSequenceOfItem.hxx>
#include <Express_Field.hxx>
#include <Express_Item.hxx>
#include <Express_Type.hxx>
#include <Express_Schema.hxx>
#include <Express_Reference.hxx>
#include "exptocas.tab.hxx" /* define tokens */
/* Auxiliary functions */
static int fun_level=0;
static int ec_linenum=1;
static int ec_state = 0;
int yywrap(void) { return 1; }
int ec_curline ( void )
{
return ec_linenum;
}
int ec_error ( const std::string& s, const std::string& text )
{
printf ( "\nError at line %d: %s \"%s\"\n", ec_curline(), s.c_str(), text.c_str() );
return 0;
}
%}
/*
c++ generate C++ parser class
*/
%option c++
%option noyywrap
%option yyclass="exptocas::scanner"
%option nounistd
%s TYP ENT
%x COMM SKP RULE FUN
%a 4000
%o 6000
%top{
// Pre-include stdlib.h to avoid redefinition of integer type macros (INT8_MIN and similar in generated code)
#if !defined(_MSC_VER) || (_MSC_VER >= 1600) // Visual Studio 2010+
#include "stdint.h"
#endif
}
%{
// Tell flex which function to define
#ifdef YY_DECL
# undef YY_DECL
#endif
#define YY_DECL int exptocas::scanner::lex (exptocas::parser::semantic_type* yylval)
typedef exptocas::parser::token token;
/************************************/
/* Section 2 */
/* parsing rules */
%}
%%
"--".* { /* Eat line comments */ }
"(*" { ec_state = YYSTATE; BEGIN(COMM); }
<COMM>. { /* Eat multiline comments */ }
<COMM>"*)" { BEGIN(ec_state); }
"SCHEMA" { return yylval->num = token::KSCHEM; }
"END_SCHEMA" { return yylval->num = token::KENDS; }
"TYPE" { BEGIN(TYP); return yylval->num = token::KTYP; }
<TYP,SKP>"END_TYPE" { BEGIN(0); return yylval->num = token::KENDT; }
"ENTITY" { BEGIN(ENT); return yylval->num = token::KENT; }
<ENT,SKP>"END_ENTITY" { BEGIN(0); return yylval->num = token::KENDE; }
<ENT>"INVERSE" |
<ENT>"DERIVE" |
<ENT,TYP>"WHERE" { BEGIN(SKP); }
<SKP>. { /* eat contents of WHERE and DERIVE subclauses of ENTITY and TYPE */ }
"SELECT" { return yylval->num = token::KSEL; }
"ENUMERATION" { return yylval->num = token::KENUM; }
"LIST" { return yylval->num = token::KLIST; }
"ARRAY" { return yylval->num = token::KARR; }
"SET" { return yylval->num = token::KSET; }
"BAG" { return yylval->num = token::KBAG; }
"OF" { return yylval->num = token::KOF; }
"NUMBER" { return yylval->num = token::KNUM; }
"INTEGER" { return yylval->num = token::KINT; }
"REAL" { return yylval->num = token::KDBL; }
"STRING" { return yylval->num = token::KSTR; }
"LOGICAL" { return yylval->num = token::KLOG; }
"BOOLEAN" { return yylval->num = token::KBOOL; }
"OPTIONAL" { return yylval->num = token::KOPT; }
"UNIQUE" { return yylval->num = token::KUNIQ; }
"SELF" { return yylval->num = token::KSELF; }
"ABSTRACT" { return yylval->num = token::KABSTR; }
"SUBTYPE" { return yylval->num = token::KSUBT; }
"SUPERTYPE" { return yylval->num = token::KSPRT; }
"ANDOR" { return yylval->num = token::KANDOR; }
"ONEOF" { return yylval->num = token::K1OF; }
"AND" { return yylval->num = token::KAND; }
"UR"[0-9]+ { yylval->str = strdup ( yytext ); return token::NAME; }
[a-z_][a-z_0-9]* { yylval->str = strdup ( yytext ); return token::NAME; }
[0-9]+ { yylval->num = atoi ( yytext ); return token::NUMBER; }
[,=();?:.\\]|"["|"]" { return yylval->num = yytext[0]; }
<INITIAL,FUN>"FUNCTION" { BEGIN(FUN); fun_level++; }
<FUN>"(*" { ec_state = YYSTATE; BEGIN(COMM); /* eat comments in functions */ }
<FUN>"--".* { /* Eat line comments in functions */ }
<FUN>[A-Za-z_0-9]* { /* eat FUNCTIONs - skip IDs explicitly */ }
<FUN>\'[^\']*\' { /* eat FUNCTIONs - skip strings explicitly */ }
<FUN>. { /* eat FUNCTIONs - skip all other symbols in functions */ }
<FUN>"END_FUNCTION;" { fun_level--; if ( ! fun_level ) BEGIN(0); }
"RULE" { BEGIN(RULE); /* eat RULEs */ }
<RULE>. { /* eat RULEs */ }
<RULE>"END_RULE;" { BEGIN(0); }
"CONSTANT"[ \t\na-z_0-9:=;'()|-]+"END_CONSTANT;" { /* eat CONSTANTs */
char *s = yytext; /* but don't forget to count lines.. */
while ( *s ) if ( *(s++) == '\n' ) ec_linenum++;
}
[ \t]+ { /* eat spaces */ }
[A-Za-z0-9_]+ { ec_error ( "unknown keyword ", yytext ); /* put unrecognized keywords to cerr */ }
. { ec_error ( "unknown symbol ", yytext ); /* put unrecognized data to cerr */ }
<INITIAL,COMM,SKP,RULE,ENT,TYP,FUN>\n { ec_linenum++; /* count lines */ }
%%
/************************************/
/* Section 3 */
/* auxiliary procedures */
exptocas::scanner::scanner(std::istream* in, std::ostream* out)
: exptocasFlexLexer(in, out)
{
}
/*
int main ( void )
{
yylex();
}
*/

File diff suppressed because it is too large Load Diff

View File

@ -1,856 +0,0 @@
// A Bison parser, made by GNU Bison 3.7.4.
// Skeleton interface for Bison LALR(1) parsers in C++
// Copyright (C) 2002-2015, 2018-2020 Free Software Foundation, Inc.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// As a special exception, you may create a larger work that contains
// part or all of the Bison parser skeleton and distribute that work
// under terms of your choice, so long as that work isn't itself a
// parser generator using the skeleton or a modified version thereof
// as a parser skeleton. Alternatively, if you modify or redistribute
// the parser skeleton itself, you may (at your option) remove this
// special exception, which will cause the skeleton and the resulting
// Bison output files to be licensed under the GNU General Public
// License without this special exception.
// This special exception was added by the Free Software Foundation in
// version 2.2 of Bison.
/**
** \file ExpToCasExe/exptocas.tab.hxx
** Define the exptocas::parser class.
*/
// C++ LALR(1) parser skeleton written by Akim Demaille.
// DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
// especially those whose name start with YY_ or yy_. They are
// private implementation details that can be changed or removed.
#ifndef YY_EXPTOCAS_EXPTOCASEXE_EXPTOCAS_TAB_HXX_INCLUDED
#define YY_EXPTOCAS_EXPTOCASEXE_EXPTOCAS_TAB_HXX_INCLUDED
// "%code requires" blocks.
#include <OSD_OpenFile.hxx>
#include <TCollection_HAsciiString.hxx>
#include <TColStd_HSequenceOfHAsciiString.hxx>
#include <Express_HSequenceOfField.hxx>
#include <Express_HSequenceOfItem.hxx>
#include <Express_Field.hxx>
#include <Express_Item.hxx>
#include <Express_Enum.hxx>
#include <Express_Alias.hxx>
#include <Express_Select.hxx>
#include <Express_Entity.hxx>
#include <Express_Type.hxx>
#include <Express_NamedType.hxx>
#include <Express_PredefinedType.hxx>
#include <Express_Number.hxx>
#include <Express_Integer.hxx>
#include <Express_Boolean.hxx>
#include <Express_Logical.hxx>
#include <Express_Real.hxx>
#include <Express_String.hxx>
#include <Express_ComplexType.hxx>
#include <Express_Array.hxx>
#include <Express_List.hxx>
#include <Express_Set.hxx>
#include <Express_Bag.hxx>
#include <Express_Schema.hxx>
#include <Express_Reference.hxx>
#include <Express.hxx>
namespace exptocas
{
class scanner;
};
#ifdef _MSC_VER
// disable MSVC warning C4522: 'exptocas::parser::stack_symbol_type': multiple assignment
// operators
#pragma warning(disable : 4522)
#endif
#include <cstdlib> // std::abort
#include <iostream>
#include <stdexcept>
#include <string>
#include <vector>
#if defined __cplusplus
#define YY_CPLUSPLUS __cplusplus
#else
#define YY_CPLUSPLUS 199711L
#endif
// Support move semantics when possible.
#if 201103L <= YY_CPLUSPLUS
#define YY_MOVE std::move
#define YY_MOVE_OR_COPY move
#define YY_MOVE_REF(Type) Type&&
#define YY_RVREF(Type) Type&&
#define YY_COPY(Type) Type
#else
#define YY_MOVE
#define YY_MOVE_OR_COPY copy
#define YY_MOVE_REF(Type) Type&
#define YY_RVREF(Type) const Type&
#define YY_COPY(Type) const Type&
#endif
// Support noexcept when possible.
#if 201103L <= YY_CPLUSPLUS
#define YY_NOEXCEPT noexcept
#define YY_NOTHROW
#else
#define YY_NOEXCEPT
#define YY_NOTHROW throw()
#endif
// Support constexpr when possible.
#if 201703 <= YY_CPLUSPLUS
#define YY_CONSTEXPR constexpr
#else
#define YY_CONSTEXPR
#endif
#ifndef YY_ATTRIBUTE_PURE
#if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
#define YY_ATTRIBUTE_PURE __attribute__((__pure__))
#else
#define YY_ATTRIBUTE_PURE
#endif
#endif
#ifndef YY_ATTRIBUTE_UNUSED
#if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
#define YY_ATTRIBUTE_UNUSED __attribute__((__unused__))
#else
#define YY_ATTRIBUTE_UNUSED
#endif
#endif
/* Suppress unused-variable warnings by "using" E. */
#if !defined lint || defined __GNUC__
#define YYUSE(E) ((void)(E))
#else
#define YYUSE(E) /* empty */
#endif
#if defined __GNUC__ && !defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
/* Suppress an incorrect diagnostic about yylval being uninitialized. */
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
_Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wuninitialized\"") \
_Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
#define YY_IGNORE_MAYBE_UNINITIALIZED_END _Pragma("GCC diagnostic pop")
#else
#define YY_INITIAL_VALUE(Value) Value
#endif
#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
#endif
#ifndef YY_INITIAL_VALUE
#define YY_INITIAL_VALUE(Value) /* Nothing. */
#endif
#if defined __cplusplus && defined __GNUC__ && !defined __ICC && 6 <= __GNUC__
#define YY_IGNORE_USELESS_CAST_BEGIN \
_Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wuseless-cast\"")
#define YY_IGNORE_USELESS_CAST_END _Pragma("GCC diagnostic pop")
#endif
#ifndef YY_IGNORE_USELESS_CAST_BEGIN
#define YY_IGNORE_USELESS_CAST_BEGIN
#define YY_IGNORE_USELESS_CAST_END
#endif
#ifndef YY_CAST
#ifdef __cplusplus
#define YY_CAST(Type, Val) static_cast<Type>(Val)
#define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type>(Val)
#else
#define YY_CAST(Type, Val) ((Type)(Val))
#define YY_REINTERPRET_CAST(Type, Val) ((Type)(Val))
#endif
#endif
#ifndef YY_NULLPTR
#if defined __cplusplus
#if 201103L <= __cplusplus
#define YY_NULLPTR nullptr
#else
#define YY_NULLPTR 0
#endif
#else
#define YY_NULLPTR ((void*)0)
#endif
#endif
/* Debug traces. */
#ifndef YYDEBUG
#define YYDEBUG 0
#endif
namespace exptocas
{
/// A Bison parser.
class parser
{
public:
#ifndef YYSTYPE
/// Symbol semantic values.
union semantic_type {
int num;
char* str;
TColStd_HSequenceOfHAsciiString* tlist;
Express_HSequenceOfField* flist;
Express_HSequenceOfItem* ilist;
Express_Field* field;
Express_Item* item;
Express_Type* type;
Express_Schema* schema;
Express_Reference* ref;
};
#else
typedef YYSTYPE semantic_type;
#endif
/// Syntax errors thrown from user actions.
struct syntax_error : std::runtime_error
{
syntax_error(const std::string& m)
: std::runtime_error(m)
{
}
syntax_error(const syntax_error& s)
: std::runtime_error(s.what())
{
}
~syntax_error() YY_NOEXCEPT YY_NOTHROW;
};
/// Token kinds.
struct token
{
enum token_kind_type
{
YYEMPTY = -2,
YYEOF = 0, // "end of file"
YYerror = 256, // error
YYUNDEF = 257, // "invalid token"
KSCHEM = 258, // KSCHEM
KENDS = 259, // KENDS
KTYP = 260, // KTYP
KENDT = 261, // KENDT
KENT = 262, // KENT
KENDE = 263, // KENDE
KREF = 264, // KREF
KFROM = 265, // KFROM
KSEL = 266, // KSEL
KENUM = 267, // KENUM
KLIST = 268, // KLIST
KARR = 269, // KARR
KBAG = 270, // KBAG
KSET = 271, // KSET
KOF = 272, // KOF
KNUM = 273, // KNUM
KINT = 274, // KINT
KDBL = 275, // KDBL
KSTR = 276, // KSTR
KLOG = 277, // KLOG
KBOOL = 278, // KBOOL
KOPT = 279, // KOPT
KUNIQ = 280, // KUNIQ
KSELF = 281, // KSELF
KABSTR = 282, // KABSTR
KSUBT = 283, // KSUBT
KSPRT = 284, // KSPRT
KANDOR = 285, // KANDOR
K1OF = 286, // K1OF
KAND = 287, // KAND
NUMBER = 288, // NUMBER
NAME = 289 // NAME
};
/// Backward compatibility alias (Bison 3.6).
typedef token_kind_type yytokentype;
};
/// Token kind, as returned by yylex.
typedef token::yytokentype token_kind_type;
/// Backward compatibility alias (Bison 3.6).
typedef token_kind_type token_type;
/// Symbol kinds.
struct symbol_kind
{
enum symbol_kind_type
{
YYNTOKENS = 46, ///< Number of tokens.
S_YYEMPTY = -2,
S_YYEOF = 0, // "end of file"
S_YYerror = 1, // error
S_YYUNDEF = 2, // "invalid token"
S_KSCHEM = 3, // KSCHEM
S_KENDS = 4, // KENDS
S_KTYP = 5, // KTYP
S_KENDT = 6, // KENDT
S_KENT = 7, // KENT
S_KENDE = 8, // KENDE
S_KREF = 9, // KREF
S_KFROM = 10, // KFROM
S_KSEL = 11, // KSEL
S_KENUM = 12, // KENUM
S_KLIST = 13, // KLIST
S_KARR = 14, // KARR
S_KBAG = 15, // KBAG
S_KSET = 16, // KSET
S_KOF = 17, // KOF
S_KNUM = 18, // KNUM
S_KINT = 19, // KINT
S_KDBL = 20, // KDBL
S_KSTR = 21, // KSTR
S_KLOG = 22, // KLOG
S_KBOOL = 23, // KBOOL
S_KOPT = 24, // KOPT
S_KUNIQ = 25, // KUNIQ
S_KSELF = 26, // KSELF
S_KABSTR = 27, // KABSTR
S_KSUBT = 28, // KSUBT
S_KSPRT = 29, // KSPRT
S_KANDOR = 30, // KANDOR
S_K1OF = 31, // K1OF
S_KAND = 32, // KAND
S_NUMBER = 33, // NUMBER
S_NAME = 34, // NAME
S_35_ = 35, // ','
S_36_ = 36, // ';'
S_37_ = 37, // '='
S_38_ = 38, // '('
S_39_ = 39, // ')'
S_40_ = 40, // '['
S_41_ = 41, // ':'
S_42_ = 42, // ']'
S_43_ = 43, // '?'
S_44_ = 44, // '\\'
S_45_ = 45, // '.'
S_YYACCEPT = 46, // $accept
S_SCHEMA = 47, // SCHEMA
S_ILIST = 48, // ILIST
S_ITEM = 49, // ITEM
S_ENUM = 50, // ENUM
S_SELECT = 51, // SELECT
S_ALIAS = 52, // ALIAS
S_ENTITY = 53, // ENTITY
S_REFERENCE = 54, // REFERENCE
S_TLIST = 55, // TLIST
S_TLIST1 = 56, // TLIST1
S_TYPE = 57, // TYPE
S_TSTD = 58, // TSTD
S_TNAME = 59, // TNAME
S_TSET = 60, // TSET
S_INDEX = 61, // INDEX
S_OPTUNI = 62, // OPTUNI
S_SUBT = 63, // SUBT
S_SUPERT = 64, // SUPERT
S_SUPLST = 65, // SUPLST
S_FLIST = 66, // FLIST
S_FLIST1 = 67, // FLIST1
S_FIELD = 68, // FIELD
S_REDEF = 69, // REDEF
S_SPECIF = 70, // SPECIF
S_OPTNL = 71, // OPTNL
S_UNIQIT = 72, // UNIQIT
S_UNIQLS = 73, // UNIQLS
S_UNIQUE = 74, // UNIQUE
S_SPCLST = 75 // SPCLST
};
};
/// (Internal) symbol kind.
typedef symbol_kind::symbol_kind_type symbol_kind_type;
/// The number of tokens.
static const symbol_kind_type YYNTOKENS = symbol_kind::YYNTOKENS;
/// A complete symbol.
///
/// Expects its Base type to provide access to the symbol kind
/// via kind ().
///
/// Provide access to semantic value.
template <typename Base>
struct basic_symbol : Base
{
/// Alias to Base.
typedef Base super_type;
/// Default constructor.
basic_symbol()
: value()
{
}
#if 201103L <= YY_CPLUSPLUS
/// Move constructor.
basic_symbol(basic_symbol&& that)
: Base(std::move(that)),
value(std::move(that.value))
{
}
#endif
/// Copy constructor.
basic_symbol(const basic_symbol& that);
/// Constructor for valueless symbols.
basic_symbol(typename Base::kind_type t);
/// Constructor for symbols with semantic value.
basic_symbol(typename Base::kind_type t, YY_RVREF(semantic_type) v);
/// Destroy the symbol.
~basic_symbol() { clear(); }
/// Destroy contents, and record that is empty.
void clear() { Base::clear(); }
#if YYDEBUG || 0
/// The user-facing name of this symbol.
const char* name() const YY_NOEXCEPT { return parser::symbol_name(this->kind()); }
#endif // #if YYDEBUG || 0
/// Backward compatibility (Bison 3.6).
symbol_kind_type type_get() const YY_NOEXCEPT;
/// Whether empty.
bool empty() const YY_NOEXCEPT;
/// Destructive move, \a s is emptied into this.
void move(basic_symbol& s);
/// The semantic value.
semantic_type value;
private:
#if YY_CPLUSPLUS < 201103L
/// Assignment operator.
basic_symbol& operator=(const basic_symbol& that);
#endif
};
/// Type access provider for token (enum) based symbols.
struct by_kind
{
/// Default constructor.
by_kind();
#if 201103L <= YY_CPLUSPLUS
/// Move constructor.
by_kind(by_kind&& that);
#endif
/// Copy constructor.
by_kind(const by_kind& that);
/// The symbol kind as needed by the constructor.
typedef token_kind_type kind_type;
/// Constructor from (external) token numbers.
by_kind(kind_type t);
/// Record that this symbol is empty.
void clear();
/// Steal the symbol kind from \a that.
void move(by_kind& that);
/// The (internal) type number (corresponding to \a type).
/// \a empty when empty.
symbol_kind_type kind() const YY_NOEXCEPT;
/// Backward compatibility (Bison 3.6).
symbol_kind_type type_get() const YY_NOEXCEPT;
/// The symbol kind.
/// \a S_YYEMPTY when empty.
symbol_kind_type kind_;
};
/// Backward compatibility for a private implementation detail (Bison 3.6).
typedef by_kind by_type;
/// "External" symbols: returned by the scanner.
struct symbol_type : basic_symbol<by_kind>
{
};
/// Build a parser object.
parser(exptocas::scanner* scanner_yyarg);
virtual ~parser();
#if 201103L <= YY_CPLUSPLUS
/// Non copyable.
parser(const parser&) = delete;
/// Non copyable.
parser& operator=(const parser&) = delete;
#endif
/// Parse. An alias for parse ().
/// \returns 0 iff parsing succeeded.
int operator()();
/// Parse.
/// \returns 0 iff parsing succeeded.
virtual int parse();
#if YYDEBUG
/// The current debugging stream.
std::ostream& debug_stream() const YY_ATTRIBUTE_PURE;
/// Set the current debugging stream.
void set_debug_stream(std::ostream&);
/// Type for debugging levels.
typedef int debug_level_type;
/// The current debugging level.
debug_level_type debug_level() const YY_ATTRIBUTE_PURE;
/// Set the current debugging level.
void set_debug_level(debug_level_type l);
#endif
/// Report a syntax error.
/// \param msg a description of the syntax error.
virtual void error(const std::string& msg);
/// Report a syntax error.
void error(const syntax_error& err);
#if YYDEBUG || 0
/// The user-facing name of the symbol whose (internal) number is
/// YYSYMBOL. No bounds checking.
static const char* symbol_name(symbol_kind_type yysymbol);
#endif // #if YYDEBUG || 0
private:
#if YY_CPLUSPLUS < 201103L
/// Non copyable.
parser(const parser&);
/// Non copyable.
parser& operator=(const parser&);
#endif
/// Stored state numbers (used for stacks).
typedef unsigned char state_type;
/// Compute post-reduction state.
/// \param yystate the current state
/// \param yysym the nonterminal to push on the stack
static state_type yy_lr_goto_state_(state_type yystate, int yysym);
/// Whether the given \c yypact_ value indicates a defaulted state.
/// \param yyvalue the value to check
static bool yy_pact_value_is_default_(int yyvalue);
/// Whether the given \c yytable_ value indicates a syntax error.
/// \param yyvalue the value to check
static bool yy_table_value_is_error_(int yyvalue);
static const short yypact_ninf_;
static const signed char yytable_ninf_;
/// Convert a scanner token kind \a t to a symbol kind.
/// In theory \a t should be a token_kind_type, but character literals
/// are valid, yet not members of the token_type enum.
static symbol_kind_type yytranslate_(int t);
#if YYDEBUG || 0
/// For a symbol, its name in clear.
static const char* const yytname_[];
#endif // #if YYDEBUG || 0
// Tables.
// YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
// STATE-NUM.
static const short yypact_[];
// YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
// Performed when YYTABLE does not specify something else to do. Zero
// means the default is an error.
static const signed char yydefact_[];
// YYPGOTO[NTERM-NUM].
static const short yypgoto_[];
// YYDEFGOTO[NTERM-NUM].
static const short yydefgoto_[];
// YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
// positive, shift that token. If negative, reduce the rule whose
// number is the opposite. If YYTABLE_NINF, syntax error.
static const unsigned char yytable_[];
static const short yycheck_[];
// YYSTOS[STATE-NUM] -- The (internal number of the) accessing
// symbol of state STATE-NUM.
static const signed char yystos_[];
// YYR1[YYN] -- Symbol number of symbol that rule YYN derives.
static const signed char yyr1_[];
// YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.
static const signed char yyr2_[];
#if YYDEBUG
// YYRLINE[YYN] -- Source line where rule number YYN was defined.
static const short yyrline_[];
/// Report on the debug stream that the rule \a r is going to be reduced.
virtual void yy_reduce_print_(int r) const;
/// Print the state stack on the debug stream.
virtual void yy_stack_print_() const;
/// Debugging level.
int yydebug_;
/// Debug stream.
std::ostream* yycdebug_;
/// \brief Display a symbol kind, value and location.
/// \param yyo The output stream.
/// \param yysym The symbol.
template <typename Base>
void yy_print_(std::ostream& yyo, const basic_symbol<Base>& yysym) const;
#endif
/// \brief Reclaim the memory associated to a symbol.
/// \param yymsg Why this token is reclaimed.
/// If null, print nothing.
/// \param yysym The symbol.
template <typename Base>
void yy_destroy_(const char* yymsg, basic_symbol<Base>& yysym) const;
private:
/// Type access provider for state based symbols.
struct by_state
{
/// Default constructor.
by_state() YY_NOEXCEPT;
/// The symbol kind as needed by the constructor.
typedef state_type kind_type;
/// Constructor.
by_state(kind_type s) YY_NOEXCEPT;
/// Copy constructor.
by_state(const by_state& that) YY_NOEXCEPT;
/// Record that this symbol is empty.
void clear() YY_NOEXCEPT;
/// Steal the symbol kind from \a that.
void move(by_state& that);
/// The symbol kind (corresponding to \a state).
/// \a symbol_kind::S_YYEMPTY when empty.
symbol_kind_type kind() const YY_NOEXCEPT;
/// The state number used to denote an empty symbol.
/// We use the initial state, as it does not have a value.
enum
{
empty_state = 0
};
/// The state.
/// \a empty when empty.
state_type state;
};
/// "Internal" symbol: element of the stack.
struct stack_symbol_type : basic_symbol<by_state>
{
/// Superclass.
typedef basic_symbol<by_state> super_type;
/// Construct an empty symbol.
stack_symbol_type();
/// Move or copy construction.
stack_symbol_type(YY_RVREF(stack_symbol_type) that);
/// Steal the contents from \a sym to build this.
stack_symbol_type(state_type s, YY_MOVE_REF(symbol_type) sym);
#if YY_CPLUSPLUS < 201103L
/// Assignment, needed by push_back by some old implementations.
/// Moves the contents of that.
stack_symbol_type& operator=(stack_symbol_type& that);
/// Assignment, needed by push_back by other implementations.
/// Needed by some other old implementations.
stack_symbol_type& operator=(const stack_symbol_type& that);
#endif
};
/// A stack with random access from its top.
template <typename T, typename S = std::vector<T>>
class stack
{
public:
// Hide our reversed order.
typedef typename S::iterator iterator;
typedef typename S::const_iterator const_iterator;
typedef typename S::size_type size_type;
typedef typename std::ptrdiff_t index_type;
stack(size_type n = 200)
: seq_(n)
{
}
#if 201103L <= YY_CPLUSPLUS
/// Non copyable.
stack(const stack&) = delete;
/// Non copyable.
stack& operator=(const stack&) = delete;
#endif
/// Random access.
///
/// Index 0 returns the topmost element.
const T& operator[](index_type i) const { return seq_[size_type(size() - 1 - i)]; }
/// Random access.
///
/// Index 0 returns the topmost element.
T& operator[](index_type i) { return seq_[size_type(size() - 1 - i)]; }
/// Steal the contents of \a t.
///
/// Close to move-semantics.
void push(YY_MOVE_REF(T) t)
{
seq_.push_back(T());
operator[](0).move(t);
}
/// Pop elements from the stack.
void pop(std::ptrdiff_t n = 1) YY_NOEXCEPT
{
for (; 0 < n; --n)
seq_.pop_back();
}
/// Pop all elements from the stack.
void clear() YY_NOEXCEPT { seq_.clear(); }
/// Number of elements on the stack.
index_type size() const YY_NOEXCEPT { return index_type(seq_.size()); }
/// Iterator on top of the stack (going downwards).
const_iterator begin() const YY_NOEXCEPT { return seq_.begin(); }
/// Bottom of the stack.
const_iterator end() const YY_NOEXCEPT { return seq_.end(); }
/// Present a slice of the top of a stack.
class slice
{
public:
slice(const stack& stack, index_type range)
: stack_(stack),
range_(range)
{
}
const T& operator[](index_type i) const { return stack_[range_ - i]; }
private:
const stack& stack_;
index_type range_;
};
private:
#if YY_CPLUSPLUS < 201103L
/// Non copyable.
stack(const stack&);
/// Non copyable.
stack& operator=(const stack&);
#endif
/// The wrapped container.
S seq_;
};
/// Stack type.
typedef stack<stack_symbol_type> stack_type;
/// The stack.
stack_type yystack_;
/// Push a new state on the stack.
/// \param m a debug message to display
/// if null, no trace is output.
/// \param sym the symbol
/// \warning the contents of \a s.value is stolen.
void yypush_(const char* m, YY_MOVE_REF(stack_symbol_type) sym);
/// Push a new look ahead token on the state on the stack.
/// \param m a debug message to display
/// if null, no trace is output.
/// \param s the state
/// \param sym the symbol (for its value and location).
/// \warning the contents of \a sym.value is stolen.
void yypush_(const char* m, state_type s, YY_MOVE_REF(symbol_type) sym);
/// Pop \a n symbols from the stack.
void yypop_(int n = 1);
/// Constants.
enum
{
yylast_ = 164, ///< Last index in yytable_.
yynnts_ = 30, ///< Number of nonterminal symbols.
yyfinal_ = 4 ///< Termination state number.
};
// User arguments.
exptocas::scanner* scanner;
};
} // namespace exptocas
// "%code provides" blocks.
#if !defined(yyFlexLexer) && !defined(FlexLexerOnce)
#define yyFlexLexer exptocasFlexLexer
#include "FlexLexer.h"
#endif
namespace exptocas
{
// To feed data back to bison, the yylex method needs yylval and
// yylloc parameters. Since the exptocasFlexLexer class is defined in the
// system header <FlexLexer.h> the signature of its yylex() method
// can not be changed anymore. This makes it necessary to derive a
// scanner class that provides a method with the desired signature:
class scanner : public exptocasFlexLexer
{
public:
explicit scanner(std::istream* in = 0, std::ostream* out = 0);
int lex(exptocas::parser::semantic_type* yylval);
};
}; // namespace exptocas
#endif // !YY_EXPTOCAS_EXPTOCASEXE_EXPTOCAS_TAB_HXX_INCLUDED

View File

@ -1,506 +0,0 @@
/*
Copyright (c) 1999-2022 OPEN CASCADE SAS
This file is part of Open CASCADE Technology software library.
This library is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License version 2.1 as published
by the Free Software Foundation, with special exception defined in the file
OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
distribution for complete text of the license and disclaimer of any warranty.
Alternatively, this file may be used under the terms of Open CASCADE
commercial license or contractual agreement.
*/
%code top {
// Created: Thu Oct 28 12:21:16 1999
// Author: Andrey BETENEV
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
/*****************************************************************************
This YACC parser implements parsing algorithm for EXPRESS -> CASCADE/XSTEP
classes generator
Input in the form of tokens is obtained from lexical analyser. Then, data
structure representing schema is created on the basis of grammar analysis.
NOTE: The grammar currently implemented is not full.
FUNCTION, RULE and CONSTANT items, WHERE, INVERSE and DERIVE clauses
of TYPE and ENTITY items are not considered (ignored on the level of lexical
scanner).
SUPERTYPE and UNIQUE clauses of ENTITY item are recognized but ignored.
Also, complex constructs such as using call to function in dimensions of
complex time or redefinition of inherited field are ignored.
*****************************************************************************/
}
%language "C++"
%require "3.2"
%parse-param {exptocas::scanner* scanner}
%code requires {
#include <OSD_OpenFile.hxx>
#include <TCollection_HAsciiString.hxx>
#include <TColStd_HSequenceOfHAsciiString.hxx>
#include <Express_HSequenceOfField.hxx>
#include <Express_HSequenceOfItem.hxx>
#include <Express_Field.hxx>
#include <Express_Item.hxx>
#include <Express_Enum.hxx>
#include <Express_Alias.hxx>
#include <Express_Select.hxx>
#include <Express_Entity.hxx>
#include <Express_Type.hxx>
#include <Express_NamedType.hxx>
#include <Express_PredefinedType.hxx>
#include <Express_Number.hxx>
#include <Express_Integer.hxx>
#include <Express_Boolean.hxx>
#include <Express_Logical.hxx>
#include <Express_Real.hxx>
#include <Express_String.hxx>
#include <Express_ComplexType.hxx>
#include <Express_Array.hxx>
#include <Express_List.hxx>
#include <Express_Set.hxx>
#include <Express_Bag.hxx>
#include <Express_Schema.hxx>
#include <Express_Reference.hxx>
#include <Express.hxx>
namespace exptocas {
class scanner;
};
#ifdef _MSC_VER
// disable MSVC warning C4522: 'exptocas::parser::stack_symbol_type': multiple assignment operators
#pragma warning(disable: 4522)
#endif
}
%code {
#undef yylex
#define yylex scanner->lex
// disable MSVC warnings in bison code
#ifdef _MSC_VER
#pragma warning(disable:4244 4800)
#endif
/************************************************/
/* ERROR MESSAGE FUNCTION */
/* external functions (from exptocas.l) */
int ec_error ( const std::string& s, const std::string& text );
int ec_curline ( void );
//int yyerror ( char *s )
//{
// printf ( "\nParse error at line %d: %s\n", ec_curline(), s );
// return 0;
//}
/************************************************/
/* FUNCTIONS FOR CREATING SCHEMA REPRESENTATION */
static Express_Schema *mkschema ( char *name, Express_HSequenceOfItem *ilist );
static Express_HSequenceOfItem *mkilist ( Express_Item *item, Express_HSequenceOfItem *seq );
static Express_Item *mkenum ( char *name, TColStd_HSequenceOfHAsciiString *tlist );
static Express_Item *mkselect ( char *name, TColStd_HSequenceOfHAsciiString *tlist );
static Express_Item *mkalias ( char *name, Express_Type *type );
static Express_Item *mkentity ( char *name, TColStd_HSequenceOfHAsciiString *inherit,
Express_HSequenceOfField *field, int isabstract );
static Express_Reference *mkrefs ( char *name, TColStd_HSequenceOfHAsciiString *items);
static TColStd_HSequenceOfHAsciiString *mktlist ( char *name, TColStd_HSequenceOfHAsciiString *tlist );
static TColStd_HSequenceOfHAsciiString *mktlists ( TColStd_HSequenceOfHAsciiString *tlist1, TColStd_HSequenceOfHAsciiString *tlist2 );
static Express_Type *mktstd ( int keyword );
static Express_Type *mktname ( char *name );
static Express_Type *mktset ( int keyword, int ilow, int ihigh, Express_Type *of );
static Express_Field *mkfield ( char *name, Express_Type *type, int optional );
static Express_HSequenceOfField *mkflist ( Express_Field *field, Express_HSequenceOfField *seq );
}
%code provides {
#if !defined(yyFlexLexer) && !defined(FlexLexerOnce)
#define yyFlexLexer exptocasFlexLexer
#include "FlexLexer.h"
#endif
namespace exptocas {
// To feed data back to bison, the yylex method needs yylval and
// yylloc parameters. Since the exptocasFlexLexer class is defined in the
// system header <FlexLexer.h> the signature of its yylex() method
// can not be changed anymore. This makes it necessary to derive a
// scanner class that provides a method with the desired signature:
class scanner : public exptocasFlexLexer
{
public:
explicit scanner(std::istream* in = 0, std::ostream* out = 0);
int lex(exptocas::parser::semantic_type* yylval);
};
};
}
/* Definition of possible types of expressions */
%union {
int num;
char *str;
TColStd_HSequenceOfHAsciiString *tlist;
Express_HSequenceOfField *flist;
Express_HSequenceOfItem *ilist;
Express_Field *field;
Express_Item *item;
Express_Type *type;
Express_Schema *schema;
Express_Reference *ref;
}
/* Definition of keywords */
%token <num> KSCHEM /* SCHEMA keyword */
%token <num> KENDS /* END_SCHEMA keyword */
%token <num> KTYP /* TYPE keyword */
%token <num> KENDT /* END_TYPE keyword */
%token <num> KENT /* ENTITY keyword */
%token <num> KENDE /* END_ENTITY keyword */
%token <num> KREF /* REFERENCE keyword */
%token <num> KFROM /* FROM keyword */
%token <num> KSEL /* SELECT keyword */
%token <num> KENUM /* ENUMERATION keyword */
%token <num> KLIST /* LIST keyword */
%token <num> KARR /* ARRAY keyword */
%token <num> KBAG /* BAG keyword */
%token <num> KSET /* SET keyword */
%token <num> KOF /* OF keyword */
%token <num> KNUM /* NUMBER keyword */
%token <num> KINT /* INTEGER keyword */
%token <num> KDBL /* REAL keyword */
%token <num> KSTR /* STRING keyword */
%token <num> KLOG /* LOGICAL keyword */
%token <num> KBOOL /* BOOLEAN keyword */
%token <num> KOPT /* OPTIONAL keyword */
%token <num> KUNIQ /* UNIQUE keyword */
%token <num> KSELF /* SELF keyword */
%token <num> KABSTR /* ABSTRACT keyword */
%token <num> KSUBT /* SUBTYPE keyword */
%token <num> KSPRT /* SUPERTYPE keyword */
%left <num> KANDOR /* ANDOR keyword (%left is for eliminating shift/reduce conflict on SUPLST) */
%left <num> K1OF /* ONEOF keyword */
%token <num> KAND /* AND keyword */
%token <num> NUMBER /* integer value */
%token <str> NAME /* name of type or entity */
%left ',' /* to eliminate shift/reduce conflict in SUPERTYPE */
/* Definition of expressions and their types */
%type <num> INDEX OPTNL OPTUNI SUPERT SUPLST REDEF SPCLST
%type <tlist> TLIST TLIST1 UNIQIT UNIQLS UNIQUE SUBT SPECIF
%type <type> TYPE TSTD TNAME TSET
%type <item> ENUM SELECT ALIAS ENTITY ITEM
%type <ilist> ILIST
%type <field> FIELD
%type <flist> FLIST FLIST1
%type <schema> SCHEMA
%type <ref> REFERENCE
%%
/************************************************/
/* Definition of parsing rules (expressions) */
/************************************************/
SCHEMA: KSCHEM NAME ';' ILIST KENDS ';' { $$ = mkschema ( $2, $4 ); /* Root: EXPRESS schema */ }
;
ILIST : ITEM { $$ = mkilist ( $1, 0 ); /* list of items for schema */ }
| ITEM ILIST { $$ = mkilist ( $1, $2 ); }
;
ITEM : ENUM
| SELECT
| ALIAS
| REFERENCE
| ENTITY { $$ = $1; /* item of schema (type definition) */ }
;
ENUM : KTYP NAME '=' KENUM KOF TLIST1 ';' KENDT ';' { $$ = mkenum ( $2, $6 ); /* TYPE ENUMERATION definition */ }
;
SELECT: KTYP NAME '=' KSEL TLIST1 ';' KENDT ';' { $$ = mkselect ( $2, $5 ); /* TYPE SELECT definition */ }
;
ALIAS : KTYP NAME '=' TYPE ';' KENDT ';' { $$ = mkalias ( $2, $4 ); /* TYPE '=' definition (alias) */ }
;
ENTITY: KENT NAME SUPERT SUBT ';' FLIST1 UNIQUE KENDE ';' { $$ = mkentity ( $2, $4, $6, 0 ); /* ENTITY definition */ }
| KENT NAME KABSTR SUPERT SUBT ';' FLIST1 UNIQUE KENDE ';' { $$ = mkentity ( $2, $5, $7, 1 ); /* ENTITY definition */ }
;
REFERENCE: KREF KFROM NAME TLIST1 ';' { $$ = mkrefs ( $3, $4 ); /* REFERENCE FROM definition */ }
;
TLIST : NAME { $$ = mktlist ( $1, 0 ); /* list of (type) names */ }
| NAME ',' TLIST { $$ = mktlist ( $1, $3 ); }
;
TLIST1: '(' TLIST ')' { $$ = $2; /* TLIST in brackets */ }
;
TYPE : TSTD
| TNAME
| TSET { $$ = $1; /* type, simple or complex */ }
;
TSTD : KINT { $$ = mktstd ( $1 ); /* predefined type: INTEGER */ }
| KNUM { $$ = mktstd ( $1 ); /* predefined type: NUMBER */ }
| KDBL { $$ = mktstd ( $1 ); /* predefined type: REAL */ }
| KSTR { $$ = mktstd ( $1 ); /* predefined type: STRING */ }
| KLOG { $$ = mktstd ( $1 ); /* predefined type: LOGICAL */ }
| KBOOL { $$ = mktstd ( $1 ); /* predefined type: BOOLEAN */ }
;
TNAME : NAME { $$ = mktname ( $1 ); /* named type */ }
;
TSET : KLIST '[' INDEX ':' INDEX ']' KOF OPTUNI TYPE { $$ = mktset ( $1, $3, $5, $9 ); /* complex type: LIST */ }
| KARR '[' INDEX ':' INDEX ']' KOF OPTUNI TYPE { $$ = mktset ( $1, $3, $5, $9 ); /* complex type: ARRAY */ }
| KSET '[' INDEX ':' INDEX ']' KOF OPTUNI TYPE { $$ = mktset ( $1, $3, $5, $9 ); /* complex type: SET */ }
| KBAG '[' INDEX ':' INDEX ']' KOF OPTUNI TYPE { $$ = mktset ( $1, $3, $5, $9 ); /* complex type: BAG */ }
;
INDEX : NUMBER { $$ = $1; /* index for array, set, bag, list range */ }
| '?' { $$ = -1; /* undefined */ }
| NAME '(' NAME ')' {$$ = -1; printf ( "Warning at line %d: index function %s(%s) ignored\n", ec_curline(), $1, $3 ); /* some function.. */ }
;
OPTUNI: /* empty */ { $$ = 0; /* UNIQUE keyword for complex type definition */ }
| KUNIQ { $$ = 1; }
;
SUBT : /* empty */ { $$ = NULL; /* no subtype clause */ }
| KSUBT KOF TLIST1 { $$ = $3; /* subtype clause */ }
;
SUPERT: /* empty */ { $$ = 0; /* no supertype clause */ }
| KSPRT { $$ = 0; /* supertype clause (ignored) */ }
| KSPRT KOF SUPLST { $$ = 0; /* supertype clause (ignored) */ }
;
SUPLST: NAME { $$ = 0; /* simple list of supertypes */ }
| '(' SUPLST ')' { $$ = 0; /* allow bracketing */ }
| NAME ',' SUPLST { $$ = 0; /* ... */ }
| K1OF SUPLST { $$ = 0; /* ONEOF construct */ }
| SUPLST KANDOR SUPLST { $$ = 0; /* ANDOR construct */ }
;
FLIST : FIELD { $$ = mkflist ( $1, 0 ); /* list of fields of ENTITY item */ }
| FIELD FLIST { $$ = mkflist ( $1, $2 ); }
| REDEF { $$ = 0; /* redefinition of inherited field, just skip */ }
| REDEF FLIST { $$ = $2; /* ignore redefinition of inherited field, take trailing list */ }
;
FLIST1: /* empty */ { $$ = NULL; /* empty list of fields */ }
| FLIST { $$ = $1; /* or not empty.. just to fix reduce/reduce conflict */ }
;
FIELD : NAME ':' OPTNL TYPE ';' { $$ = mkfield ( $1, $4, $3 ); }
;
REDEF : KSELF '\\' SPECIF ':' TYPE ';' { $$ = 0; printf ( "Warning at line %d: field redefinition ignored\n", ec_curline() ); /* redefinition of inherited field */ }
;
SPECIF: NAME { $$ = mktlist ( $1, 0 ); /* inherited field specification */ }
| NAME '.' SPECIF { $$ = mktlist ( $1, $3 ); }
;
OPTNL : /* empty */ { $$ = 0; }
| KOPT { $$ = 1; }
;
UNIQIT: NAME ':' TLIST ';' { $$ = $3; /* UNIQUE statement */ }
| NAME ':' SPCLST ';' { $$ = NULL; /* UNIQUE statement */ }
;
UNIQLS: UNIQIT { $$ = NULL; /* list of 1 UNIQUE statements */ }
| UNIQIT UNIQLS { $$ = mktlists ( $1, $2 );/* list of UNIQUE statements */ }
;
UNIQUE: /* empty */ { $$ = NULL; /* no UNIQUE clause in ENTITY */ }
| KUNIQ UNIQLS { $$ = $2; /* UNIQUE clause in ENTITY */ }
;
SPCLST: KSELF '\\' SPECIF { $$ = 0; /* list of specifications */ }
| KSELF '\\' SPECIF ',' SPCLST { $$ = 0; }
| NAME ',' SPCLST { $$ = 0; }
;
%%
/************************************************/
/* FUNCTIONS FOR CREATING SCHEMA REPRESENTATION */
static Express_Schema *mkschema ( char *name, Express_HSequenceOfItem *ilist )
{
Express_Schema *sch = new Express_Schema ( name, ilist );
Express::Schema() = sch;
return sch;
}
static Express_HSequenceOfItem *mkilist ( Express_Item *item, Express_HSequenceOfItem *seq )
{
if ( ! seq ) {
seq = new Express_HSequenceOfItem;
seq->Append ( item );
}
else seq->Prepend ( item );
return seq;
}
static Express_Item *mkenum ( char *name, TColStd_HSequenceOfHAsciiString *tlist )
{
return new Express_Enum ( name, tlist );
}
static Express_Item *mkselect ( char *name, TColStd_HSequenceOfHAsciiString *tlist )
{
return new Express_Select ( name, tlist );
}
static Express_Item *mkalias ( char *name, Express_Type *type )
{
return new Express_Alias ( name, type );
}
static Express_Item *mkentity ( char *name, TColStd_HSequenceOfHAsciiString *inherit,
Express_HSequenceOfField *field, int isabstract )
{
Express_Entity *ent = new Express_Entity ( name, inherit, field );
if ( isabstract ) ent->SetAbstractFlag ( Standard_True );
return ent;
}
static Express_Reference *mkrefs ( char *name, TColStd_HSequenceOfHAsciiString *items)
{
return new Express_Reference ( name, items );
}
static TColStd_HSequenceOfHAsciiString *mktlist ( char *name, TColStd_HSequenceOfHAsciiString *tlist )
{
Handle(TCollection_HAsciiString) str = new TCollection_HAsciiString ( name );
if ( tlist ) tlist->Prepend ( str );
else {
tlist = new TColStd_HSequenceOfHAsciiString;
tlist->Append ( str );
}
return tlist;
}
static TColStd_HSequenceOfHAsciiString *mktlists ( TColStd_HSequenceOfHAsciiString *tlist1,
TColStd_HSequenceOfHAsciiString *tlist2 )
{
if ( ! tlist1 ) return tlist2;
if ( ! tlist2 ) return tlist1;
for ( int i=1; i <= tlist2->Length(); i++ )
tlist1->Append ( tlist2->Value(i) );
return tlist1;
}
static Express_Type *mktstd ( int keyword )
{
switch ( keyword ) {
case exptocas::parser::token::KINT : return new Express_Integer;
case exptocas::parser::token::KNUM : return new Express_Number;
case exptocas::parser::token::KDBL : return new Express_Real;
case exptocas::parser::token::KSTR : return new Express_String;
case exptocas::parser::token::KBOOL: return new Express_Boolean;
case exptocas::parser::token::KLOG : return new Express_Logical;
default : ec_error ( "Predefined type not treated!", "" );
return NULL;
}
}
static Express_Type *mktname ( char *name )
{
return new Express_NamedType ( name );
}
static Express_Type *mktset ( int keyword, int ilow, int ihigh, Express_Type *of )
{
switch ( keyword ) {
case exptocas::parser::token::KLIST: return new Express_List ( ilow, ihigh, of );
case exptocas::parser::token::KARR : return new Express_Array ( ilow, ihigh, of );
case exptocas::parser::token::KBAG : return new Express_Bag ( ilow, ihigh, of );
case exptocas::parser::token::KSET : return new Express_Set ( ilow, ihigh, of );
default : ec_error ( "Complex type not treated!", "" );
return NULL;
}
}
static Express_Field *mkfield ( char *name, Express_Type *type, int optional )
{
return new Express_Field ( name, type, optional );
}
static Express_HSequenceOfField *mkflist ( Express_Field *field, Express_HSequenceOfField *seq )
{
if ( seq ) seq->Prepend ( field );
else {
seq = new Express_HSequenceOfField;
seq->Append ( field );
}
return seq;
}
/*******************************************************************/
/* MAIN & co */
/*
void tlistfree ( struct tlist *list )
{
if ( ! list ) return;
tlistfree ( list->next );
list->next = 0;
free ( list->str );
list->str = 0;
}
* /
int printtlist ( struct ec_tlist *tl )
{
int num=0;
while ( tl ) {
num++;
printf ( "%s\n", tl->name );
tl = tl->next;
}
return num;
}
int main ( void )
{
int num = 0;
yyparse();
printf ( "\nFinished\n" );
if ( schema ) {
struct ec_item *it;
it = schema->items;
printf ( "\nSchema %s", schema->name );
printf ( "\nItems:" );
while ( it ) {
num++;
printf ( "\n%s", it->name );
it = it->next;
}
// num = printtlist ( res );
printf ( "\nTotal %d", num );
}
// tlistfree ( yylval.tlist );
return num;
}
*/
void exptocas::parser::error(const std::string& s)
{
printf("\nParse error at line %d: %s\n", scanner->lineno(), s.c_str());
}

File diff suppressed because it is too large Load Diff

View File

@ -1,942 +0,0 @@
# Last update 27.10.2021
#===============================================
# package StepAP203
#===============================================
ApprovedItem StepAP203
CcDesignApproval StepAP203
CcDesignCertification StepAP203
CcDesignContract StepAP203
CcDesignDateAndTimeAssignment StepAP203
CcDesignPersonAndOrganizationAssignment StepAP203
CcDesignSecurityClassification StepAP203
CcDesignSpecificationReference StepAP203
CertifiedItem StepAP203
Change StepAP203
ChangeRequest StepAP203
ChangeRequestItem StepAP203
ClassifiedItem StepAP203
ContractedItem StepAP203
DateTimeItem StepAP203
PersonOrganizationItem StepAP203
SpecifiedItem StepAP203
StartRequest StepAP203
StartRequestItem StepAP203
StartWork StepAP203
WorkItem StepAP203
#===============================================
# package StepAP214
#===============================================
AppliedApprovalAssignment StepAP214
AppliedDateAndTimeAssignment StepAP214
AppliedDateAssignment StepAP214
AppliedDocumentReference StepAP214
AppliedExternalIdentificationAssignment StepAP214
AppliedGroupAssignment StepAP214
AppliedOrganizationAssignment StepAP214
AppliedPersonAndOrganizationAssignment StepAP214
AppliedPresentedItem StepAP214
AppliedSecurityClassificationAssignment StepAP214
ApprovalItem StepAP214
AutoDesignActualDateAndTimeAssignment StepAP214
AutoDesignActualDateAssignment StepAP214
AutoDesignApprovalAssignment StepAP214
AutoDesignDateAndPersonAssignment StepAP214
AutoDesignDateAndPersonItem StepAP214
AutoDesignDateAndTimeItem StepAP214
AutoDesignDatedItem StepAP214
AutoDesignDocumentReference StepAP214
AutoDesignGeneralOrgItem StepAP214
AutoDesignGroupAssignment StepAP214
AutoDesignGroupedItem StepAP214
AutoDesignNominalDateAndTimeAssignment StepAP214
AutoDesignNominalDateAssignment StepAP214
AutoDesignOrganizationAssignment StepAP214
AutoDesignOrganizationItem StepAP214
AutoDesignPersonAndOrganizationAssignment StepAP214
AutoDesignPresentedItem StepAP214
AutoDesignPresentedItemSelect StepAP214
AutoDesignReferencingItem StepAP214
AutoDesignSecurityClassificationAssignment StepAP214
Class StepAP214
DateAndTimeItem StepAP214
DateItem StepAP214
DocumentReferenceItem StepAP214
ExternalIdentificationItem StepAP214
ExternallyDefinedClass StepAP214
ExternallyDefinedGeneralProperty StepAP214
GroupItem StepAP214
OrganizationItem StepAP214
PersonAndOrganizationItem StepAP214
PresentedItemSelect StepAP214
Protocol StepAP214
RepItemGroup StepAP214
SecurityClassificationItem StepAP214
#===============================================
# package StepAP242
#===============================================
DraughtingModelItemAssociation StepAP242
GeometricItemSpecificUsage StepAP242
IdAttribute StepAP242
IdAttributeSelect StepAP242
ItemIdentifiedRepresentationUsage StepAP242
ItemIdentifiedRepresentationUsageDefinition StepAP242
#===============================================
# package StepBasic
#===============================================
Action StepBasic
ActionAssignment StepBasic
ActionMethod StepBasic
ActionRequestAssignment StepBasic
ActionRequestSolution StepBasic
Address StepBasic
AheadOrBehind StepBasic
ApplicationContext StepBasic
ApplicationContextElement StepBasic
ApplicationProtocolDefinition StepBasic
Approval StepBasic
ApprovalAssignment StepBasic
ApprovalDateTime StepBasic
ApprovalPersonOrganization StepBasic
ApprovalRelationship StepBasic
ApprovalRole StepBasic
ApprovalStatus StepBasic
AreaUnit StepBasic
CalendarDate StepBasic
Certification StepBasic
CertificationAssignment StepBasic
CertificationType StepBasic
CharacterizedObject StepBasic
Contract StepBasic
ContractAssignment StepBasic
ContractType StepBasic
ConversionBasedUnit StepBasic
ConversionBasedUnitAndAreaUnit StepBasic
ConversionBasedUnitAndLengthUnit StepBasic
ConversionBasedUnitAndMassUnit StepBasic
ConversionBasedUnitAndPlaneAngleUnit StepBasic
ConversionBasedUnitAndRatioUnit StepBasic
ConversionBasedUnitAndSolidAngleUnit StepBasic
ConversionBasedUnitAndTimeUnit StepBasic
ConversionBasedUnitAndVolumeUnit StepBasic
CoordinatedUniversalTimeOffset StepBasic
Date StepBasic
DateAndTime StepBasic
DateAndTimeAssignment StepBasic
DateAssignment StepBasic
DateRole StepBasic
DateTimeRole StepBasic
DateTimeSelect StepBasic
DerivedUnit StepBasic
DerivedUnitElement StepBasic
DesignContext StepBasic
DigitalDocument StepBasic
DimensionalExponents StepBasic
Document StepBasic
DocumentFile StepBasic
DocumentProductAssociation StepBasic
DocumentProductEquivalence StepBasic
DocumentReference StepBasic
DocumentRelationship StepBasic
DocumentRepresentationType StepBasic
DocumentType StepBasic
DocumentUsageConstraint StepBasic
Effectivity StepBasic
EffectivityAssignment StepBasic
EulerAngles StepBasic
ExternalIdentificationAssignment StepBasic
ExternallyDefinedItem StepBasic
ExternalSource StepBasic
GeneralProperty StepBasic
Group StepBasic
GroupAssignment StepBasic
GroupRelationship StepBasic
IdentificationAssignment StepBasic
IdentificationRole StepBasic
LengthMeasureWithUnit StepBasic
LengthUnit StepBasic
LocalTime StepBasic
MassMeasureWithUnit StepBasic
MassUnit StepBasic
MeasureValueMember StepBasic
MeasureWithUnit StepBasic
MechanicalContext StepBasic
NameAssignment StepBasic
NamedUnit StepBasic
ObjectRole StepBasic
OrdinalDate StepBasic
Organization StepBasic
OrganizationalAddress StepBasic
OrganizationAssignment StepBasic
OrganizationRole StepBasic
Person StepBasic
PersonalAddress StepBasic
PersonAndOrganization StepBasic
PersonAndOrganizationAssignment StepBasic
PersonAndOrganizationRole StepBasic
PersonOrganizationSelect StepBasic
PhysicallyModeledProductDefinition StepBasic
PlaneAngleMeasureWithUnit StepBasic
PlaneAngleUnit StepBasic
Product StepBasic
ProductCategory StepBasic
ProductCategoryRelationship StepBasic
ProductConceptContext StepBasic
ProductContext StepBasic
ProductDefinition StepBasic
ProductDefinitionContext StepBasic
ProductDefinitionEffectivity StepBasic
ProductDefinitionFormation StepBasic
ProductDefinitionFormationRelationship StepBasic
ProductDefinitionFormationWithSpecifiedSource StepBasic
ProductDefinitionOrReference StepBasic
ProductDefinitionReference StepBasic
ProductDefinitionReferenceWithLocalRepresentation StepBasic
ProductDefinitionRelationship StepBasic
ProductDefinitionWithAssociatedDocuments StepBasic
ProductOrFormationOrDefinition StepBasic
ProductRelatedProductCategory StepBasic
ProductType StepBasic
RatioMeasureWithUnit StepBasic
RatioUnit StepBasic
RoleAssociation StepBasic
RoleSelect StepBasic
SecurityClassification StepBasic
SecurityClassificationAssignment StepBasic
SecurityClassificationLevel StepBasic
SiPrefix StepBasic
SiUnit StepBasic
SiUnitAndAreaUnit StepBasic
SiUnitAndLengthUnit StepBasic
SiUnitAndMassUnit StepBasic
SiUnitAndPlaneAngleUnit StepBasic
SiUnitAndRatioUnit StepBasic
SiUnitAndSolidAngleUnit StepBasic
SiUnitAndThermodynamicTemperatureUnit StepBasic
SiUnitAndTimeUnit StepBasic
SiUnitAndVolumeUnit StepBasic
SiUnitName StepBasic
SizeMember StepBasic
SizeSelect StepBasic
SolidAngleMeasureWithUnit StepBasic
SolidAngleUnit StepBasic
Source StepBasic
SourceItem StepBasic
ThermodynamicTemperatureUnit StepBasic
TimeMeasureWithUnit StepBasic
TimeUnit StepBasic
UncertaintyMeasureWithUnit StepBasic
Unit StepBasic
VersionedActionRequest StepBasic
VolumeUnit StepBasic
WeekOfYearAndDayDate StepBasic
#===============================================
# package StepDimTol
#===============================================
AngularityTolerance StepDimTol
AreaUnitType StepDimTol
CircularRunoutTolerance StepDimTol
CoaxialityTolerance StepDimTol
CommonDatum StepDimTol
ConcentricityTolerance StepDimTol
CylindricityTolerance StepDimTol
Datum StepDimTol
DatumFeature StepDimTol
DatumOrCommonDatum StepDimTol
DatumReference StepDimTol
DatumReferenceCompartment StepDimTol
DatumReferenceElement StepDimTol
DatumReferenceModifier StepDimTol
DatumReferenceModifierType StepDimTol
DatumReferenceModifierWithValue StepDimTol
DatumSystem StepDimTol
DatumSystemOrReference StepDimTol
DatumTarget StepDimTol
FlatnessTolerance StepDimTol
GeneralDatumReference StepDimTol
GeometricTolerance StepDimTol
GeometricToleranceModifier StepDimTol
GeometricToleranceRelationship StepDimTol
GeometricToleranceTarget StepDimTol
GeometricToleranceType StepDimTol
GeometricToleranceWithDatumReference StepDimTol
GeometricToleranceWithDefinedAreaUnit StepDimTol
GeometricToleranceWithDefinedUnit StepDimTol
GeometricToleranceWithMaximumTolerance StepDimTol
GeometricToleranceWithModifiers StepDimTol
GeoTolAndGeoTolWthDatRef StepDimTol
GeoTolAndGeoTolWthDatRefAndGeoTolWthMaxTol StepDimTol
GeoTolAndGeoTolWthDatRefAndGeoTolWthMod StepDimTol
GeoTolAndGeoTolWthDatRefAndModGeoTolAndPosTol StepDimTol
GeoTolAndGeoTolWthDatRefAndUneqDisGeoTol StepDimTol
GeoTolAndGeoTolWthMaxTol StepDimTol
GeoTolAndGeoTolWthMod StepDimTol
LimitCondition StepDimTol
LineProfileTolerance StepDimTol
ModifiedGeometricTolerance StepDimTol
NonUniformZoneDefinition StepDimTol
ParallelismTolerance StepDimTol
PerpendicularityTolerance StepDimTol
PlacedDatumTargetFeature StepDimTol
PositionTolerance StepDimTol
ProjectedZoneDefinition StepDimTol
RoundnessTolerance StepDimTol
RunoutZoneDefinition StepDimTol
RunoutZoneOrientation StepDimTol
ShapeToleranceSelect StepDimTol
SimpleDatumReferenceModifier StepDimTol
SimpleDatumReferenceModifierMember StepDimTol
StraightnessTolerance StepDimTol
SurfaceProfileTolerance StepDimTol
SymmetryTolerance StepDimTol
ToleranceZone StepDimTol
ToleranceZoneDefinition StepDimTol
ToleranceZoneForm StepDimTol
ToleranceZoneTarget StepDimTol
TotalRunoutTolerance StepDimTol
UnequallyDisposedGeometricTolerance StepDimTol
#===============================================
# package StepElement
#===============================================
AnalysisItemWithinRepresentation StepElement
Curve3dElementDescriptor StepElement
CurveEdge StepElement
CurveElementEndReleasePacket StepElement
CurveElementFreedom StepElement
CurveElementFreedomMember StepElement
CurveElementPurpose StepElement
CurveElementPurposeMember StepElement
CurveElementSectionDefinition StepElement
CurveElementSectionDerivedDefinitions StepElement
Element2dShape StepElement
ElementAspect StepElement
ElementAspectMember StepElement
ElementDescriptor StepElement
ElementMaterial StepElement
ElementOrder StepElement
ElementVolume StepElement
EnumeratedCurveElementFreedom StepElement
EnumeratedCurveElementPurpose StepElement
EnumeratedSurfaceElementPurpose StepElement
EnumeratedVolumeElementPurpose StepElement
MeasureOrUnspecifiedValue StepElement
MeasureOrUnspecifiedValueMember StepElement
Surface3dElementDescriptor StepElement
SurfaceElementProperty StepElement
SurfaceElementPurpose StepElement
SurfaceElementPurposeMember StepElement
SurfaceSection StepElement
SurfaceSectionField StepElement
SurfaceSectionFieldConstant StepElement
SurfaceSectionFieldVarying StepElement
UniformSurfaceSection StepElement
UnspecifiedValue StepElement
Volume3dElementDescriptor StepElement
Volume3dElementShape StepElement
VolumeElementPurpose StepElement
VolumeElementPurposeMember StepElement
#===============================================
# package StepFEA
#===============================================
AlignedCurve3dElementCoordinateSystem StepFEA
AlignedSurface3dElementCoordinateSystem StepFEA
ArbitraryVolume3dElementCoordinateSystem StepFEA
ConstantSurface3dElementCoordinateSystem StepFEA
CoordinateSystemType StepFEA
Curve3dElementProperty StepFEA
Curve3dElementRepresentation StepFEA
CurveEdge StepFEA
CurveElementEndCoordinateSystem StepFEA
CurveElementEndOffset StepFEA
CurveElementEndRelease StepFEA
CurveElementInterval StepFEA
CurveElementIntervalConstant StepFEA
CurveElementIntervalLinearlyVarying StepFEA
CurveElementLocation StepFEA
DegreeOfFreedom StepFEA
DegreeOfFreedomMember StepFEA
DummyNode StepFEA
ElementGeometricRelationship StepFEA
ElementGroup StepFEA
ElementOrElementGroup StepFEA
ElementRepresentation StepFEA
ElementVolume StepFEA
EnumeratedDegreeOfFreedom StepFEA
FeaAreaDensity StepFEA
FeaAxis2Placement3d StepFEA
FeaCurveSectionGeometricRelationship StepFEA
FeaGroup StepFEA
FeaLinearElasticity StepFEA
FeaMassDensity StepFEA
FeaMaterialPropertyRepresentation StepFEA
FeaMaterialPropertyRepresentationItem StepFEA
FeaModel StepFEA
FeaModel3d StepFEA
FeaModelDefinition StepFEA
FeaMoistureAbsorption StepFEA
FeaParametricPoint StepFEA
FeaRepresentationItem StepFEA
FeaSecantCoefficientOfLinearThermalExpansion StepFEA
FeaShellBendingStiffness StepFEA
FeaShellMembraneBendingCouplingStiffness StepFEA
FeaShellMembraneStiffness StepFEA
FeaShellShearStiffness StepFEA
FeaSurfaceSectionGeometricRelationship StepFEA
FeaTangentialCoefficientOfLinearThermalExpansion StepFEA
FreedomAndCoefficient StepFEA
FreedomsList StepFEA
GeometricNode StepFEA
Node StepFEA
NodeDefinition StepFEA
NodeGroup StepFEA
NodeRepresentation StepFEA
NodeSet StepFEA
NodeWithSolutionCoordinateSystem StepFEA
NodeWithVector StepFEA
ParametricCurve3dElementCoordinateDirection StepFEA
ParametricCurve3dElementCoordinateSystem StepFEA
ParametricSurface3dElementCoordinateSystem StepFEA
Surface3dElementRepresentation StepFEA
SymmetricTensor22d StepFEA
SymmetricTensor23d StepFEA
SymmetricTensor23dMember StepFEA
SymmetricTensor42d StepFEA
SymmetricTensor43d StepFEA
SymmetricTensor43dMember StepFEA
UnspecifiedValue StepFEA
Volume3dElementRepresentation StepFEA
#===============================================
# package StepGeom
#===============================================
Axis1Placement StepGeom
Axis2Placement StepGeom
Axis2Placement2d StepGeom
Axis2Placement3d StepGeom
BezierCurve StepGeom
BezierCurveAndRationalBSplineCurve StepGeom
BezierSurface StepGeom
BezierSurfaceAndRationalBSplineSurface StepGeom
BoundaryCurve StepGeom
BoundedCurve StepGeom
BoundedSurface StepGeom
BSplineCurve StepGeom
BSplineCurveForm StepGeom
BSplineCurveWithKnots StepGeom
BSplineCurveWithKnotsAndRationalBSplineCurve StepGeom
BSplineSurface StepGeom
BSplineSurfaceForm StepGeom
BSplineSurfaceWithKnots StepGeom
BSplineSurfaceWithKnotsAndRationalBSplineSurface StepGeom
CartesianPoint StepGeom
CartesianTransformationOperator StepGeom
CartesianTransformationOperator2d StepGeom
CartesianTransformationOperator3d StepGeom
Circle StepGeom
CompositeCurve StepGeom
CompositeCurveOnSurface StepGeom
CompositeCurveSegment StepGeom
Conic StepGeom
ConicalSurface StepGeom
Curve StepGeom
CurveBoundedSurface StepGeom
CurveOnSurface StepGeom
CurveReplica StepGeom
CylindricalSurface StepGeom
DegeneratePcurve StepGeom
DegenerateToroidalSurface StepGeom
Direction StepGeom
ElementarySurface StepGeom
Ellipse StepGeom
EvaluatedDegeneratePcurve StepGeom
GeometricRepresentationContext StepGeom
GeometricRepresentationContextAndGlobalUnitAssignedContext StepGeom
GeometricRepresentationContextAndParametricRepresentationContext StepGeom
GeometricRepresentationItem StepGeom
GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx StepGeom
Hyperbola StepGeom
IntersectionCurve StepGeom
KnotType StepGeom
Line StepGeom
OffsetCurve3d StepGeom
OffsetSurface StepGeom
OrientedSurface StepGeom
OuterBoundaryCurve StepGeom
Parabola StepGeom
Pcurve StepGeom
PcurveOrSurface StepGeom
Placement StepGeom
Plane StepGeom
Point StepGeom
PointOnCurve StepGeom
PointOnSurface StepGeom
PointReplica StepGeom
Polyline StepGeom
PreferredSurfaceCurveRepresentation StepGeom
QuasiUniformCurve StepGeom
QuasiUniformCurveAndRationalBSplineCurve StepGeom
QuasiUniformSurface StepGeom
QuasiUniformSurfaceAndRationalBSplineSurface StepGeom
RationalBSplineCurve StepGeom
RationalBSplineSurface StepGeom
RectangularCompositeSurface StepGeom
RectangularTrimmedSurface StepGeom
ReparametrisedCompositeCurveSegment StepGeom
SeamCurve StepGeom
SphericalSurface StepGeom
SuParameters StepGeom
Surface StepGeom
SurfaceBoundary StepGeom
SurfaceCurve StepGeom
SurfaceCurveAndBoundedCurve StepGeom
SurfaceOfLinearExtrusion StepGeom
SurfaceOfRevolution StepGeom
SurfacePatch StepGeom
SurfaceReplica StepGeom
SweptSurface StepGeom
ToroidalSurface StepGeom
TransitionCode StepGeom
TrimmedCurve StepGeom
TrimmingMember StepGeom
TrimmingPreference StepGeom
TrimmingSelect StepGeom
UniformCurve StepGeom
UniformCurveAndRationalBSplineCurve StepGeom
UniformSurface StepGeom
UniformSurfaceAndRationalBSplineSurface StepGeom
Vector StepGeom
VectorOrDirection StepGeom
#===============================================
# package StepKinematics
#===============================================
ActuatedDirection StepKinematics
ActuatedKinematicPair StepKinematics
ActuatedKinPairAndOrderKinPair StepKinematics
ContextDependentKinematicLinkRepresentation StepKinematics
CylindricalPair StepKinematics
CylindricalPairValue StepKinematics
CylindricalPairWithRange StepKinematics
FullyConstrainedPair StepKinematics
GearPair StepKinematics
GearPairValue StepKinematics
GearPairWithRange StepKinematics
HighOrderKinematicPair StepKinematics
HomokineticPair StepKinematics
KinematicJoint StepKinematics
KinematicLink StepKinematics
KinematicLinkRepresentation StepKinematics
KinematicLinkRepresentationAssociation StepKinematics
KinematicPair StepKinematics
KinematicPropertyDefinitionRepresentation StepKinematics
KinematicPropertyMechanismRepresentation StepKinematics
KinematicTopologyDirectedStructure StepKinematics
KinematicTopologyNetworkStructure StepKinematics
KinematicTopologyRepresentationSelect StepKinematics
KinematicTopologyStructure StepKinematics
LinearFlexibleAndPinionPair StepKinematics
LinearFlexibleAndPlanarCurvePair StepKinematics
LinearFlexibleLinkRepresentation StepKinematics
LowOrderKinematicPair StepKinematics
LowOrderKinematicPairValue StepKinematics
LowOrderKinematicPairWithMotionCoupling StepKinematics
LowOrderKinematicPairWithRange StepKinematics
MechanismRepresentation StepKinematics
MechanismStateRepresentation StepKinematics
OrientedJoint StepKinematics
PairRepresentationRelationship StepKinematics
PairValue StepKinematics
PlanarCurvePair StepKinematics
PlanarCurvePairRange StepKinematics
PlanarPair StepKinematics
PlanarPairValue StepKinematics
PlanarPairWithRange StepKinematics
PointOnPlanarCurvePair StepKinematics
PointOnPlanarCurvePairValue StepKinematics
PointOnPlanarCurvePairWithRange StepKinematics
PointOnSurfacePair StepKinematics
PointOnSurfacePairValue StepKinematics
PointOnSurfacePairWithRange StepKinematics
PrismaticPair StepKinematics
PrismaticPairValue StepKinematics
PrismaticPairWithRange StepKinematics
ProductDefinitionKinematics StepKinematics
ProductDefinitionRelationshipKinematics StepKinematics
RackAndPinionPair StepKinematics
RackAndPinionPairValue StepKinematics
RackAndPinionPairWithRange StepKinematics
RevolutePair StepKinematics
RevolutePairValue StepKinematics
RevolutePairWithRange StepKinematics
RigidLinkRepresentation StepKinematics
RigidPlacement StepKinematics
RollingCurvePair StepKinematics
RollingCurvePairValue StepKinematics
RollingSurfacePair StepKinematics
RollingSurfacePairValue StepKinematics
RotationAboutDirection StepKinematics
ScrewPair StepKinematics
ScrewPairValue StepKinematics
ScrewPairWithRange StepKinematics
SlidingCurvePair StepKinematics
SlidingCurvePairValue StepKinematics
SlidingSurfacePair StepKinematics
SlidingSurfacePairValue StepKinematics
SpatialRotation StepKinematics
SphericalPair StepKinematics
SphericalPairSelect StepKinematics
SphericalPairValue StepKinematics
SphericalPairWithPin StepKinematics
SphericalPairWithPinAndRange StepKinematics
SphericalPairWithRange StepKinematics
SurfacePair StepKinematics
SurfacePairWithRange StepKinematics
UnconstrainedPair StepKinematics
UnconstrainedPairValue StepKinematics
UniversalPair StepKinematics
UniversalPairValue StepKinematics
UniversalPairWithRange StepKinematics
#===============================================
# package StepRepr
#===============================================
AllAroundShapeAspect StepRepr
Apex StepRepr
AssemblyComponentUsage StepRepr
AssemblyComponentUsageSubstitute StepRepr
BetweenShapeAspect StepRepr
CentreOfSymmetry StepRepr
CharacterizedDefinition StepRepr
CharacterizedRepresentation StepRepr
CompGroupShAspAndCompShAspAndDatumFeatAndShAsp StepRepr
CompositeGroupShapeAspect StepRepr
CompositeShapeAspect StepRepr
CompoundRepresentationItem StepRepr
CompShAspAndDatumFeatAndShAsp StepRepr
ConfigurationDesign StepRepr
ConfigurationDesignItem StepRepr
ConfigurationEffectivity StepRepr
ConfigurationItem StepRepr
ConstructiveGeometryRepresentation StepRepr
ConstructiveGeometryRepresentationRelationship StepRepr
ContinuosShapeAspect StepRepr
DataEnvironment StepRepr
DefinitionalRepresentation StepRepr
DerivedShapeAspect StepRepr
DescriptiveRepresentationItem StepRepr
Extension StepRepr
ExternallyDefinedRepresentation StepRepr
FeatureForDatumTargetRelationship StepRepr
FunctionallyDefinedTransformation StepRepr
GeometricAlignment StepRepr
GlobalUncertaintyAssignedContext StepRepr
GlobalUnitAssignedContext StepRepr
IntegerRepresentationItem StepRepr
ItemDefinedTransformation StepRepr
MakeFromUsageOption StepRepr
MappedItem StepRepr
MaterialDesignation StepRepr
MaterialProperty StepRepr
MaterialPropertyRepresentation StepRepr
MeasureRepresentationItem StepRepr
NextAssemblyUsageOccurrence StepRepr
ParallelOffset StepRepr
ParametricRepresentationContext StepRepr
PerpendicularTo StepRepr
ProductConcept StepRepr
ProductDefinitionShape StepRepr
ProductDefinitionUsage StepRepr
PromissoryUsageOccurrence StepRepr
PropertyDefinition StepRepr
PropertyDefinitionRelationship StepRepr
PropertyDefinitionRepresentation StepRepr
QuantifiedAssemblyComponentUsage StepRepr
Representation StepRepr
RepresentationContext StepRepr
RepresentationContextReference StepRepr
RepresentationItem StepRepr
RepresentationMap StepRepr
RepresentationOrRepresentationReference StepRepr
RepresentationReference StepRepr
RepresentationRelationship StepRepr
RepresentationRelationshipWithTransformation StepRepr
RepresentedDefinition StepRepr
ReprItemAndLengthMeasureWithUnit StepRepr
ReprItemAndLengthMeasureWithUnitAndQRI StepRepr
ReprItemAndMeasureWithUnit StepRepr
ReprItemAndMeasureWithUnitAndQRI StepRepr
ReprItemAndPlaneAngleMeasureWithUnit StepRepr
ReprItemAndPlaneAngleMeasureWithUnitAndQRI StepRepr
ShapeAspect StepRepr
ShapeAspectDerivingRelationship StepRepr
ShapeAspectRelationship StepRepr
ShapeAspectTransition StepRepr
ShapeDefinition StepRepr
ShapeRepresentationRelationship StepRepr
ShapeRepresentationRelationshipWithTransformation StepRepr
SpecifiedHigherUsageOccurrence StepRepr
StructuralResponseProperty StepRepr
StructuralResponsePropertyDefinitionRepresentation StepRepr
SuppliedPartRelationship StepRepr
Tangent StepRepr
Transformation StepRepr
ValueRange StepRepr
ValueRepresentationItem StepRepr
#===============================================
# package StepShape
#===============================================
AdvancedBrepShapeRepresentation StepShape
AdvancedFace StepShape
AngleRelator StepShape
AngularLocation StepShape
AngularSize StepShape
Block StepShape
BooleanOperand StepShape
BooleanOperator StepShape
BooleanResult StepShape
BoxDomain StepShape
BoxedHalfSpace StepShape
BrepWithVoids StepShape
ClosedShell StepShape
CompoundShapeRepresentation StepShape
ConnectedEdgeSet StepShape
ConnectedFaceSet StepShape
ConnectedFaceShapeRepresentation StepShape
ConnectedFaceSubSet StepShape
ContextDependentShapeRepresentation StepShape
CsgPrimitive StepShape
CsgSelect StepShape
CsgShapeRepresentation StepShape
CsgSolid StepShape
DefinitionalRepresentationAndShapeRepresentation StepShape
DimensionalCharacteristic StepShape
DimensionalCharacteristicRepresentation StepShape
DimensionalLocation StepShape
DimensionalLocationWithPath StepShape
DimensionalSize StepShape
DimensionalSizeWithPath StepShape
DirectedDimensionalLocation StepShape
Edge StepShape
EdgeBasedWireframeModel StepShape
EdgeBasedWireframeShapeRepresentation StepShape
EdgeCurve StepShape
EdgeLoop StepShape
ExtrudedAreaSolid StepShape
ExtrudedFaceSolid StepShape
Face StepShape
FaceBasedSurfaceModel StepShape
FaceBound StepShape
FaceOuterBound StepShape
FaceSurface StepShape
FacetedBrep StepShape
FacetedBrepAndBrepWithVoids StepShape
FacetedBrepShapeRepresentation StepShape
GeometricallyBoundedSurfaceShapeRepresentation StepShape
GeometricallyBoundedWireframeShapeRepresentation StepShape
GeometricCurveSet StepShape
GeometricSet StepShape
GeometricSetSelect StepShape
HalfSpaceSolid StepShape
LimitsAndFits StepShape
Loop StepShape
LoopAndPath StepShape
ManifoldSolidBrep StepShape
ManifoldSurfaceShapeRepresentation StepShape
MeasureQualification StepShape
MeasureRepresentationItemAndQualifiedRepresentationItem StepShape
NonManifoldSurfaceShapeRepresentation StepShape
OpenShell StepShape
OrientedClosedShell StepShape
OrientedEdge StepShape
OrientedFace StepShape
OrientedOpenShell StepShape
OrientedPath StepShape
Path StepShape
PlusMinusTolerance StepShape
PointRepresentation StepShape
PolyLoop StepShape
PrecisionQualifier StepShape
QualifiedRepresentationItem StepShape
ReversibleTopologyItem StepShape
RevolvedAreaSolid StepShape
RevolvedFaceSolid StepShape
RightAngularWedge StepShape
RightCircularCone StepShape
RightCircularCylinder StepShape
SeamEdge StepShape
ShapeDefinitionRepresentation StepShape
ShapeDimensionRepresentation StepShape
ShapeDimensionRepresentationItem StepShape
ShapeRepresentation StepShape
ShapeRepresentationWithParameters StepShape
Shell StepShape
ShellBasedSurfaceModel StepShape
SolidModel StepShape
SolidReplica StepShape
Sphere StepShape
Subedge StepShape
Subface StepShape
SurfaceModel StepShape
SweptAreaSolid StepShape
SweptFaceSolid StepShape
ToleranceMethodDefinition StepShape
ToleranceValue StepShape
TopologicalRepresentationItem StepShape
Torus StepShape
TransitionalShapeRepresentation StepShape
TypeQualifier StepShape
ValueFormatTypeQualifier StepShape
ValueQualifier StepShape
Vertex StepShape
VertexLoop StepShape
VertexPoint StepShape
#===============================================
# package StepVisual
#===============================================
AnnotationCurveOccurrence StepVisual
AnnotationCurveOccurrenceAndGeomReprItem StepVisual
AnnotationFillArea StepVisual
AnnotationFillAreaOccurrence StepVisual
AnnotationOccurrence StepVisual
AnnotationPlane StepVisual
AnnotationPlaneElement StepVisual
AnnotationText StepVisual
AnnotationTextOccurrence StepVisual
AreaInSet StepVisual
AreaOrView StepVisual
BackgroundColour StepVisual
BoxCharacteristicSelect StepVisual
CameraImage StepVisual
CameraImage2dWithScale StepVisual
CameraImage3dWithScale StepVisual
CameraModel StepVisual
CameraModelD2 StepVisual
CameraModelD3 StepVisual
CameraModelD3MultiClipping StepVisual
CameraModelD3MultiClippingInterectionSelect StepVisual
CameraModelD3MultiClippingIntersection StepVisual
CameraModelD3MultiClippingUnion StepVisual
CameraModelD3MultiClippingUnionSelect StepVisual
CameraUsage StepVisual
CentralOrParallel StepVisual
CharacterizedObjAndRepresentationAndDraughtingModel StepVisual
Colour StepVisual
ColourRgb StepVisual
ColourSpecification StepVisual
ComplexTriangulatedFace StepVisual
ComplexTriangulatedSurfaceSet StepVisual
CompositeText StepVisual
CompositeTextWithExtent StepVisual
ContextDependentInvisibility StepVisual
ContextDependentOverRidingStyledItem StepVisual
CoordinatesList StepVisual
CubicBezierTessellatedEdge StepVisual
CubicBezierTriangulatedFace StepVisual
CurveStyle StepVisual
CurveStyleFont StepVisual
CurveStyleFontPattern StepVisual
CurveStyleFontSelect StepVisual
DirectionCountSelect StepVisual
DraughtingAnnotationOccurrence StepVisual
DraughtingCallout StepVisual
DraughtingCalloutElement StepVisual
DraughtingModel StepVisual
DraughtingPreDefinedColour StepVisual
DraughtingPreDefinedCurveFont StepVisual
EdgeOrCurve StepVisual
ExternallyDefinedCurveFont StepVisual
ExternallyDefinedTextFont StepVisual
FaceOrSurface StepVisual
FillAreaStyle StepVisual
FillAreaStyleColour StepVisual
FillStyleSelect StepVisual
FontSelect StepVisual
Invisibility StepVisual
InvisibilityContext StepVisual
InvisibleItem StepVisual
LayeredItem StepVisual
MarkerMember StepVisual
MarkerSelect StepVisual
MarkerType StepVisual
MechanicalDesignGeometricPresentationArea StepVisual
MechanicalDesignGeometricPresentationRepresentation StepVisual
NullStyle StepVisual
NullStyleMember StepVisual
OverRidingStyledItem StepVisual
PathOrCompositeCurve StepVisual
PlanarBox StepVisual
PlanarExtent StepVisual
PointStyle StepVisual
PreDefinedColour StepVisual
PreDefinedCurveFont StepVisual
PreDefinedItem StepVisual
PreDefinedTextFont StepVisual
PresentationArea StepVisual
PresentationLayerAssignment StepVisual
PresentationLayerUsage StepVisual
PresentationRepresentation StepVisual
PresentationRepresentationSelect StepVisual
PresentationSet StepVisual
PresentationSize StepVisual
PresentationSizeAssignmentSelect StepVisual
PresentationStyleAssignment StepVisual
PresentationStyleByContext StepVisual
PresentationStyleSelect StepVisual
PresentationView StepVisual
PresentedItem StepVisual
PresentedItemRepresentation StepVisual
RenderingPropertiesSelect StepVisual
RepositionedTessellatedGeometricSet StepVisual
RepositionedTessellatedItem StepVisual
ShadingSurfaceMethod StepVisual
StyleContextSelect StepVisual
StyledItem StepVisual
StyledItemTarget StepVisual
SurfaceSide StepVisual
SurfaceSideStyle StepVisual
SurfaceStyleBoundary StepVisual
SurfaceStyleControlGrid StepVisual
SurfaceStyleElementSelect StepVisual
SurfaceStyleFillArea StepVisual
SurfaceStyleParameterLine StepVisual
SurfaceStyleReflectanceAmbient StepVisual
SurfaceStyleRendering StepVisual
SurfaceStyleRenderingWithProperties StepVisual
SurfaceStyleSegmentationCurve StepVisual
SurfaceStyleSilhouette StepVisual
SurfaceStyleTransparent StepVisual
SurfaceStyleUsage StepVisual
Template StepVisual
TemplateInstance StepVisual
TessellatedAnnotationOccurrence StepVisual
TessellatedConnectingEdge StepVisual
TessellatedCurveSet StepVisual
TessellatedEdge StepVisual
TessellatedEdgeOrVertex StepVisual
TessellatedFace StepVisual
TessellatedGeometricSet StepVisual
TessellatedItem StepVisual
TessellatedPointSet StepVisual
TessellatedShapeRepresentation StepVisual
TessellatedShapeRepresentationWithAccuracyParameters StepVisual
TessellatedShell StepVisual
TessellatedSolid StepVisual
TessellatedStructuredItem StepVisual
TessellatedSurfaceSet StepVisual
TessellatedVertex StepVisual
TessellatedWire StepVisual
TextLiteral StepVisual
TextOrCharacter StepVisual
TextPath StepVisual
TextStyle StepVisual
TextStyleForDefinedFont StepVisual
TextStyleWithBoxCharacteristics StepVisual
TriangulatedFace StepVisual
ViewVolume StepVisual

View File

@ -1,125 +0,0 @@
// Created: Wed Nov 3 14:39:28 1999
// Author: Andrey BETENEV
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Express.hxx>
#include <Express_Schema.hxx>
#include <OSD_Process.hxx>
#include <OSD_Environment.hxx>
#include <Quantity_Date.hxx>
#include <TCollection_AsciiString.hxx>
//=================================================================================================
Handle(Express_Schema)& Express::Schema()
{
static Handle(Express_Schema) aSchema;
return aSchema;
}
//=======================================================================
// function : WriteFileStamp
// purpose : Write header of HXX or CXX file
//=======================================================================
void Express::WriteFileStamp(Standard_OStream& theOS)
{
static const char* EC_VERSION = "2.0";
OSD_Process aProcess;
Quantity_Date aCurTime = aProcess.SystemDate();
OSD_Environment anEnv("EXPTOCAS_TIME");
TCollection_AsciiString aTimeString = anEnv.Value();
if (aTimeString.IsEmpty())
{
aTimeString += aCurTime.Year();
aTimeString += "-";
aTimeString += aCurTime.Month();
aTimeString += "-";
aTimeString += aCurTime.Day();
}
theOS << "// Created on : " << aTimeString
<< "\n"
"// Created by: "
<< aProcess.UserName()
<< "\n"
"// Generator: ExpToCasExe (EXPRESS -> CASCADE/XSTEP Translator) V"
<< EC_VERSION
<< "\n"
"// Copyright (c) Open CASCADE "
<< aCurTime.Year()
<< "\n"
"//\n"
"// This file is part of Open CASCADE Technology software library.\n"
"//\n"
"// This library is free software; you can redistribute it and/or modify it under\n"
"// the terms of the GNU Lesser General Public License version 2.1 as published\n"
"// by the Free Software Foundation, with special exception defined in the file\n"
"// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT\n"
"// distribution for complete text of the license and disclaimer of any warranty.\n"
"//\n"
"// Alternatively, this file may be used under the terms of Open CASCADE\n"
"// commercial license or contractual agreement.\n"
"\n";
}
//=================================================================================================
void Express::WriteMethodStamp(Standard_OStream& theOS, const TCollection_AsciiString& theName)
{
theOS << "\n"
"//=======================================================================\n"
"// function : "
<< theName
<< "\n"
"// purpose :\n"
"//=======================================================================\n"
"\n";
}
//=================================================================================================
TCollection_AsciiString Express::ToStepName(const TCollection_AsciiString& theName)
{
TCollection_AsciiString aStepName(theName);
for (Standard_Integer i = 2; i <= aStepName.Length(); i++)
{
if (isupper(aStepName.Value(i)))
{
aStepName.Insert(i++, '_');
}
}
aStepName.LowerCase();
return aStepName;
}
//=================================================================================================
TCollection_AsciiString Express::EnumPrefix(const TCollection_AsciiString& theName)
{
TCollection_AsciiString aStepName;
for (Standard_Integer i = 1; i <= theName.Length(); i++)
{
if (isupper(theName.Value(i)))
{
aStepName += theName.Value(i);
}
}
aStepName.LowerCase();
return aStepName;
}

View File

@ -1,52 +0,0 @@
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Express_HeaderFile
#define _Express_HeaderFile
#include <Standard_Boolean.hxx>
#include <Standard_Type.hxx>
#include <Standard_OStream.hxx>
class Express_Schema;
class TCollection_AsciiString;
//! Provides data structures for representation of EXPRESS schema
//! (items, types, entities etc.)
//! and tools for generating XSTEP classes (HXX and CXX) from
//! items of the schema
class Express
{
public:
DEFINE_STANDARD_ALLOC
//! Returns (modifiable) handle to static schema object
Standard_EXPORT static Handle(Express_Schema)& Schema();
//! Writes standard copyright stamp (creation date/time, user, etc.)
Standard_EXPORT static void WriteFileStamp(Standard_OStream& theOS);
//! Writes standard comment for method in CXX file
Standard_EXPORT static void WriteMethodStamp(Standard_OStream& theOS,
const TCollection_AsciiString& theName);
//! Converts item name from CASCADE to STEP style
//! e.g. BoundedCurve -> bounded_curve
Standard_EXPORT static TCollection_AsciiString ToStepName(const TCollection_AsciiString& theName);
//! Converts item name from CASCADE to STEP style
//! e.g. BoundedCurve -> bounded_curve
Standard_EXPORT static TCollection_AsciiString EnumPrefix(const TCollection_AsciiString& theName);
};
#endif // _Express_HeaderFile

View File

@ -1,56 +0,0 @@
// Created: Tue Nov 2 14:40:06 1999
// Author: Andrey BETENEV
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Express_Alias.hxx>
#include <Message.hxx>
#include <TCollection_AsciiString.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Express_Alias, Express_Item)
//=================================================================================================
Express_Alias::Express_Alias(const Standard_CString theName, const Handle(Express_Type)& theType)
: Express_Item(theName),
myType(theType)
{
}
//=================================================================================================
const Handle(Express_Type)& Express_Alias::Type() const
{
return myType;
}
//=================================================================================================
const TCollection_AsciiString Express_Alias::CPPName() const
{
return myType->CPPName();
}
//=================================================================================================
Standard_Boolean Express_Alias::GenerateClass() const
{
Message::SendInfo() << "ALIAS " << Name() << " = " << Type()->CPPName()
<< " used; no generation is needed";
return Standard_False;
}
//=================================================================================================
void Express_Alias::PropagateUse() const {}

View File

@ -1,52 +0,0 @@
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Express_Alias_HeaderFile
#define _Express_Alias_HeaderFile
#include <Express_Item.hxx>
#include <Express_Type.hxx>
#include <Standard_Type.hxx>
class TCollection_AsciiString;
//! Implements TYPE = type (alias) item of the EXPRESS
//! schema, with interface for deferred Item class.
class Express_Alias : public Express_Item
{
public:
//! Create ALIAS item and initialize it
Standard_EXPORT Express_Alias(const Standard_CString theName,
const Handle(Express_Type)& theType);
//! Returns aliased type
Standard_EXPORT const Handle(Express_Type)& Type() const;
//! Returns name of aliased type
Standard_EXPORT virtual const TCollection_AsciiString CPPName() const Standard_OVERRIDE;
//! Create HXX/CXX files from item
Standard_EXPORT virtual Standard_Boolean GenerateClass() const Standard_OVERRIDE;
//! Propagates the calls of Use function
Standard_EXPORT virtual void PropagateUse() const Standard_OVERRIDE;
DEFINE_STANDARD_RTTIEXT(Express_Alias, Express_Item)
protected:
private:
Handle(Express_Type) myType;
};
#endif // _Express_Alias_HeaderFile

View File

@ -1,21 +0,0 @@
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Express_Array_HeaderFile
#define _Express_Array_HeaderFile
#include <Express_ComplexType.hxx>
typedef Express_ComplexType Express_Array;
#endif // _Express_Array_HeaderFile

View File

@ -1,21 +0,0 @@
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Express_Bag_HeaderFile
#define _Express_Bag_HeaderFile
#include <Express_ComplexType.hxx>
typedef Express_ComplexType Express_Bag;
#endif // _Express_Bag_HeaderFile

View File

@ -1,31 +0,0 @@
// Created: Tue Nov 2 15:27:26 1999
// Author: Andrey BETENEV
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Express_Boolean.hxx>
#include <TCollection_AsciiString.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Express_Boolean, Express_PredefinedType)
//=================================================================================================
Express_Boolean::Express_Boolean() {}
//=================================================================================================
const TCollection_AsciiString Express_Boolean::CPPName() const
{
return "Standard_Boolean";
}

View File

@ -1,39 +0,0 @@
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Express_Boolean_HeaderFile
#define _Express_Boolean_HeaderFile
#include <Express_PredefinedType.hxx>
#include <Standard_Type.hxx>
class TCollection_AsciiString;
//! Implements EXPRESS type 'BOOLEAN'
class Express_Boolean : public Express_PredefinedType
{
public:
//! Empty constructor
Standard_EXPORT Express_Boolean();
//! Returns "Standard_Boolean"
Standard_EXPORT virtual const TCollection_AsciiString CPPName() const Standard_OVERRIDE;
DEFINE_STANDARD_RTTIEXT(Express_Boolean, Express_PredefinedType)
protected:
private:
};
#endif // _Express_Boolean_HeaderFile

View File

@ -1,100 +0,0 @@
// Created: Tue Nov 2 15:13:31 1999
// Author: Andrey BETENEV
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Express_ComplexType.hxx>
#include <TCollection_AsciiString.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Express_ComplexType, Express_Type)
//=================================================================================================
Express_ComplexType::Express_ComplexType(const Standard_Integer theImin,
const Standard_Integer theImax,
const Handle(Express_Type)& theType)
{
myMin = theImin;
myMax = theImax;
myType = theType;
}
//=================================================================================================
const Handle(Express_Type)& Express_ComplexType::Type() const
{
return myType;
}
//=================================================================================================
const TCollection_AsciiString Express_ComplexType::CPPName() const
{
// check if array 2
Handle(Express_Type) aType = myType;
if (aType->IsKind(STANDARD_TYPE(Express_ComplexType)))
{
Handle(Express_ComplexType) aType2 = Handle(Express_ComplexType)::DownCast(aType);
aType = aType2->Type();
}
// parse name of array argument
TCollection_AsciiString aName = aType->CPPName();
Standard_Integer aSplitIdx = aName.Location(1, '_', 1, aName.Length());
TCollection_AsciiString aClassName;
if (aSplitIdx)
{
aClassName = aName.Split(aSplitIdx);
}
else
{
aClassName = aName;
}
Standard_Integer anIdx = aName.Location("TCollection", 1, aName.Length());
if (anIdx)
{
aName = "Interface_";
}
// generate name
if (aType->IsStandard() || !aSplitIdx)
{
aName = "TColStd_";
}
if (aType == myType)
{
aName += "HArray1Of";
}
else
{
aName += "HArray2Of";
}
aName += aClassName;
return aName;
}
//=================================================================================================
Standard_Boolean Express_ComplexType::Use() const
{
return myType->Use();
}
//=================================================================================================
void Express_ComplexType::Use2(const TCollection_AsciiString& theRefName,
const TCollection_AsciiString& theRefPack) const
{
myType->Use2(theRefName, theRefPack);
}

View File

@ -1,59 +0,0 @@
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Express_ComplexType_HeaderFile
#define _Express_ComplexType_HeaderFile
#include <Express_Type.hxx>
#include <Standard_Type.hxx>
class TCollection_AsciiString;
//! Base class for complex types (ARRAY, LIST, BAG, SET)
//! in EXPRESS schema
//! Stores type of elements and
class Express_ComplexType : public Express_Type
{
public:
//! Creates an object and initializes fields
Standard_EXPORT Express_ComplexType(const Standard_Integer theImin,
const Standard_Integer theImax,
const Handle(Express_Type)& theType);
//! Returns type of complex type items
Standard_EXPORT const Handle(Express_Type)& Type() const;
//! Returns CPP-style name of the type
Standard_EXPORT virtual const TCollection_AsciiString CPPName() const Standard_OVERRIDE;
//! Declares type as used by some item being generated.
//! Calls Use() for type of elements
Standard_EXPORT virtual Standard_Boolean Use() const Standard_OVERRIDE;
//! Declares type as used by some item being generated.
//! Calls Use() for type of elements
Standard_EXPORT virtual void Use2(const TCollection_AsciiString& theRefName,
const TCollection_AsciiString& theRefPack) const
Standard_OVERRIDE;
DEFINE_STANDARD_RTTIEXT(Express_ComplexType, Express_Type)
protected:
private:
Standard_Integer myMin;
Standard_Integer myMax;
Handle(Express_Type) myType;
};
#endif // _Express_ComplexType_HeaderFile

View File

@ -1,24 +0,0 @@
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef Express_DataMapOfAsciiStringItem_HeaderFile
#define Express_DataMapOfAsciiStringItem_HeaderFile
#include <Express_Item.hxx>
#include <NCollection_DataMap.hxx>
#include <TCollection_AsciiString.hxx>
typedef NCollection_DataMap<TCollection_AsciiString, Handle(Express_Item)>
Express_DataMapOfAsciiStringItem;
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,111 +0,0 @@
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Express_Entity_HeaderFile
#define _Express_Entity_HeaderFile
#include <Express_Item.hxx>
#include <Standard_OStream.hxx>
#include <Standard_Type.hxx>
#include <TColStd_HSequenceOfHAsciiString.hxx>
#include <NCollection_DataMap.hxx>
class Express_HSequenceOfEntity;
class Express_HSequenceOfField;
class Dico_DictionaryOfInteger;
//! Implements ENTITY item of the EXPRESS
//! schema, with interface for deferred Item class.
class Express_Entity : public Express_Item
{
public:
//! Create ENTITY item and initialize it
//! flags hasCheck and hasFillShared mark if generated class has
//! methods Check and FillShared correspondingly.
Standard_EXPORT Express_Entity(const Standard_CString theName,
const Handle(TColStd_HSequenceOfHAsciiString)& theInherit,
const Handle(Express_HSequenceOfField)& theFields);
//! Returns sequence of inherited classes (names)
Standard_EXPORT const Handle(TColStd_HSequenceOfHAsciiString)& SuperTypes() const;
//! Returns sequence of inherited items
Standard_EXPORT const Handle(Express_HSequenceOfEntity)& Inherit() const;
//! Returns sequence of fields
Standard_EXPORT const Handle(Express_HSequenceOfField)& Fields() const;
//! Returns number of fields (only own fields if inherited is False
//! and including fields of all supertypes if it is True)
Standard_EXPORT Standard_Integer
NbFields(const Standard_Boolean theInherited = Standard_False) const;
//! Sets abstract flag for entity;
Standard_EXPORT void SetAbstractFlag(const Standard_Boolean theIsAbstract);
//! Returns abstract flag.
Standard_EXPORT inline Standard_Boolean AbstractFlag() const;
DEFINE_STANDARD_RTTIEXT(Express_Entity, Express_Item)
protected:
private:
typedef NCollection_DataMap<TCollection_AsciiString, Standard_Integer> DataMapOfStringInteger;
//! Create HXX/CXX files from item
Standard_EXPORT virtual Standard_Boolean GenerateClass() const Standard_OVERRIDE;
//! Propagates the calls of Use function
Standard_EXPORT virtual void PropagateUse() const Standard_OVERRIDE;
//! Writes includes section of HXX
Standard_EXPORT Standard_Boolean writeIncludes(Standard_OStream& theOS) const;
//! Writes code for reading all fields
Standard_EXPORT Standard_Integer writeRWReadCode(Standard_OStream& theOS,
const Standard_Integer theStart,
const Standard_Integer theOwn) const;
//! Writes code for writing all fields
Standard_EXPORT Standard_Integer writeRWWriteCode(Standard_OStream& theOS,
const Standard_Integer theStart,
const Standard_Integer theOwn) const;
//! Writes code for adding shared entities to the graph
Standard_EXPORT Standard_Integer writeRWShareCode(Standard_OStream& theOS,
const Standard_Integer theStart,
const Standard_Integer theOwn) const;
//! Writes arguments and code for method Init()
//! Mode identifies what code is being written:
//! 0 - HXX declaration
//! 1 - CXX declaration
//! 2 - call (argument list)
//! 3 - implementation
//! 4 - call (argument list for RW)
Standard_EXPORT Standard_Integer makeInit(Standard_OStream& theOS,
const Standard_Integer theShift,
const Standard_Integer theOwn,
const Standard_Integer theMode) const;
private:
Handle(TColStd_HSequenceOfHAsciiString) mySupers;
Handle(Express_HSequenceOfEntity) myInherit;
Handle(Express_HSequenceOfField) myFields;
Standard_Boolean myIsAbstract;
};
#endif // _Express_Entity_HeaderFile

View File

@ -1,102 +0,0 @@
// Created: Tue Nov 2 14:40:06 1999
// Author: Andrey BETENEV
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Express_Enum.hxx>
#include <Express.hxx>
#include <Message.hxx>
#include <OSD_Directory.hxx>
#include <OSD_FileSystem.hxx>
#include <OSD_Path.hxx>
#include <OSD_Protection.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Express_Enum, Express_Item)
//=================================================================================================
Express_Enum::Express_Enum(const Standard_CString theName,
const Handle(TColStd_HSequenceOfHAsciiString)& theNames)
: Express_Item(theName),
myNames(theNames)
{
}
//=================================================================================================
const Handle(TColStd_HSequenceOfHAsciiString)& Express_Enum::Names() const
{
return myNames;
}
//=================================================================================================
Standard_Boolean Express_Enum::GenerateClass() const
{
const TCollection_AsciiString aCPPName = CPPName();
Message::SendInfo() << "Generating ENUMERATION " << aCPPName;
// create a package directory (if not yet exist)
OSD_Protection aProt(OSD_RWXD, OSD_RWXD, OSD_RX, OSD_RX);
TCollection_AsciiString aPack = GetPackageName();
OSD_Path aPath(aPack);
OSD_Directory aDir(aPath);
aDir.Build(aProt);
aPack += "/";
aPack += aCPPName;
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
// Open HXX file
std::shared_ptr<std::ostream> aStreamPtr =
aFileSystem->OpenOStream(aPack.Cat(".hxx"), std::ios::out | std::ios::ate);
Standard_OStream& anOS = *aStreamPtr;
// write header
Express::WriteFileStamp(anOS);
// write defines
anOS << "#ifndef _" << aCPPName
<< "_HeaderFile\n"
"#define _"
<< aCPPName
<< "_HeaderFile\n"
"\n"
"enum "
<< aCPPName
<< "\n"
"{\n";
TCollection_AsciiString aPrefix = Express::EnumPrefix(Name());
for (Standard_Integer i = 1; i <= myNames->Length(); i++)
{
if (i > 1)
{
anOS << ",\n";
}
anOS << " " << GetPackageName() << "_" << aPrefix << myNames->Value(i)->String();
}
anOS << "\n"
"};\n"
"\n"
"#endif // _"
<< aCPPName << "_HeaderFile\n";
aStreamPtr.reset();
return Standard_False;
}
//=================================================================================================
void Express_Enum::PropagateUse() const {}

View File

@ -1,47 +0,0 @@
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Express_Enum_HeaderFile
#define _Express_Enum_HeaderFile
#include <Express_Item.hxx>
#include <Standard_Type.hxx>
#include <TColStd_HSequenceOfHAsciiString.hxx>
//! Implements TYPE ENUMERATION item of the EXPRESS
//! schema, with interface for deferred Item class.
class Express_Enum : public Express_Item
{
public:
//! Create ENUM item and initialize it
Standard_EXPORT Express_Enum(const Standard_CString theName,
const Handle(TColStd_HSequenceOfHAsciiString)& theNames);
//! Returns names of enumeration variants
Standard_EXPORT const Handle(TColStd_HSequenceOfHAsciiString)& Names() const;
//! Create HXX/CXX files from item
Standard_EXPORT virtual Standard_Boolean GenerateClass() const Standard_OVERRIDE;
//! Propagates the calls of Use function
Standard_EXPORT virtual void PropagateUse() const Standard_OVERRIDE;
DEFINE_STANDARD_RTTIEXT(Express_Enum, Express_Item)
protected:
private:
Handle(TColStd_HSequenceOfHAsciiString) myNames;
};
#endif // _Express_Enum_HeaderFile

View File

@ -1,71 +0,0 @@
// Created: Tue Nov 2 16:40:51 1999
// Author: Andrey BETENEV
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Express_Field.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_HAsciiString.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Express_Field, Standard_Transient)
//=================================================================================================
Express_Field::Express_Field(const Standard_CString theName,
const Handle(Express_Type)& theType,
const Standard_Boolean theOpt)
{
myName = new TCollection_HAsciiString(theName);
myType = theType;
myOpt = theOpt;
}
//=================================================================================================
Express_Field::Express_Field(const Handle(TCollection_HAsciiString)& theName,
const Handle(Express_Type)& theType,
const Standard_Boolean theOpt)
{
myName = theName;
myType = theType;
myOpt = theOpt;
}
//=================================================================================================
const TCollection_AsciiString& Express_Field::Name() const
{
return myName->String();
}
//=================================================================================================
Handle(TCollection_HAsciiString) Express_Field::HName() const
{
return myName;
}
//=================================================================================================
const Handle(Express_Type)& Express_Field::Type() const
{
return myType;
}
//=================================================================================================
Standard_Boolean Express_Field::IsOptional() const
{
return myOpt;
}

View File

@ -1,59 +0,0 @@
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Express_Field_HeaderFile
#define _Express_Field_HeaderFile
#include <Standard_Type.hxx>
class Express_Type;
class TCollection_HAsciiString;
class TCollection_AsciiString;
//! Represents field of the ENTITY item in the EXPRESS schema
class Express_Field : public Standard_Transient
{
public:
//! Create object and initialize it
Standard_EXPORT Express_Field(const Standard_CString theName,
const Handle(Express_Type)& theType,
const Standard_Boolean theOpt);
//! Create object and initialize it
Standard_EXPORT Express_Field(const Handle(TCollection_HAsciiString)& theName,
const Handle(Express_Type)& theType,
const Standard_Boolean theOpt);
//! Returns field name
Standard_EXPORT const TCollection_AsciiString& Name() const;
//! Returns a pointer to the field name to modify it
Standard_EXPORT Handle(TCollection_HAsciiString) HName() const;
//! Returns field type
Standard_EXPORT const Handle(Express_Type)& Type() const;
//! Returns True if field is optional
Standard_EXPORT Standard_Boolean IsOptional() const;
DEFINE_STANDARD_RTTIEXT(Express_Field, Standard_Transient)
protected:
private:
Handle(TCollection_HAsciiString) myName;
Handle(Express_Type) myType;
Standard_Boolean myOpt;
};
#endif // _Express_Field_HeaderFile

View File

@ -1,22 +0,0 @@
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef Express_HSequenceOfEntity_HeaderFile
#define Express_HSequenceOfEntity_HeaderFile
#include <Express_SequenceOfEntity.hxx>
#include <NCollection_DefineHSequence.hxx>
DEFINE_HSEQUENCE(Express_HSequenceOfEntity, Express_SequenceOfEntity)
#endif

View File

@ -1,22 +0,0 @@
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef Express_HSequenceOfField_HeaderFile
#define Express_HSequenceOfField_HeaderFile
#include <Express_SequenceOfField.hxx>
#include <NCollection_DefineHSequence.hxx>
DEFINE_HSEQUENCE(Express_HSequenceOfField, Express_SequenceOfField)
#endif

View File

@ -1,22 +0,0 @@
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef Express_HSequenceOfItem_HeaderFile
#define Express_HSequenceOfItem_HeaderFile
#include <Express_SequenceOfItem.hxx>
#include <NCollection_DefineHSequence.hxx>
DEFINE_HSEQUENCE(Express_HSequenceOfItem, Express_SequenceOfItem)
#endif

View File

@ -1,31 +0,0 @@
// Created: Tue Nov 2 15:27:26 1999
// Author: Andrey BETENEV
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Express_Integer.hxx>
#include <TCollection_AsciiString.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Express_Integer, Express_PredefinedType)
//=================================================================================================
Express_Integer::Express_Integer() {}
//=================================================================================================
const TCollection_AsciiString Express_Integer::CPPName() const
{
return "Standard_Integer";
}

View File

@ -1,39 +0,0 @@
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Express_Integer_HeaderFile
#define _Express_Integer_HeaderFile
#include <Express_PredefinedType.hxx>
#include <Standard_Type.hxx>
class TCollection_AsciiString;
//! Implements EXPRESS type 'INTEGER'
class Express_Integer : public Express_PredefinedType
{
public:
//! Empty constructor
Standard_EXPORT Express_Integer();
//! Returns "Standard_Integer"
Standard_EXPORT virtual const TCollection_AsciiString CPPName() const Standard_OVERRIDE;
DEFINE_STANDARD_RTTIEXT(Express_Integer, Express_PredefinedType)
protected:
private:
};
#endif // _Express_Integer_HeaderFile

View File

@ -1,264 +0,0 @@
// Created: Tue Nov 2 13:14:31 1999
// Author: Andrey BETENEV
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Express_Item.hxx>
#include <Message.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_HAsciiString.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Express_Item, Standard_Transient)
Standard_Integer Express_Item::myIndex = -1;
//=================================================================================================
Express_Item::Express_Item(const Standard_CString theName)
{
myName = new TCollection_HAsciiString(theName);
myGenMode = GM_Undefined;
myShortName = new TCollection_HAsciiString;
myCategory = new TCollection_HAsciiString;
myhasCheck = Standard_False;
myhasFillShared = Standard_False;
myLoopFlag = Standard_False;
}
//=================================================================================================
Express_Item::Express_Item(const Handle(TCollection_HAsciiString)& theName)
{
myName = theName;
myGenMode = GM_Undefined;
myShortName = new TCollection_HAsciiString;
myCategory = new TCollection_HAsciiString;
myhasCheck = Standard_False;
myhasFillShared = Standard_False;
myLoopFlag = Standard_False;
}
//=================================================================================================
const TCollection_AsciiString& Express_Item::Name() const
{
return myName->String();
}
//=================================================================================================
Handle(TCollection_HAsciiString) Express_Item::HName() const
{
return myName;
}
//=================================================================================================
const TCollection_AsciiString Express_Item::CPPName() const
{
TCollection_AsciiString aName = GetPackageName();
aName += "_";
aName += Name();
return aName;
}
//=================================================================================================
void Express_Item::SetPackageName(const TCollection_AsciiString& thePack)
{
myPack = new TCollection_HAsciiString(thePack);
}
//=================================================================================================
const TCollection_AsciiString& Express_Item::GetPackageName() const
{
if (myPack.IsNull())
{
Message::SendWarning() << "Warning: item " << Name() << " still has no package assigned, used "
<< GetUnknownPackageName();
return GetUnknownPackageName();
}
return myPack->String();
}
//=================================================================================================
Standard_Boolean Express_Item::IsPackageNameSet() const
{
return !myPack.IsNull();
}
//=================================================================================================
TCollection_AsciiString& Express_Item::GetUnknownPackageName()
{
static TCollection_AsciiString aUnknownPackageName = "StepStep";
return aUnknownPackageName;
}
//=================================================================================================
Express_Item::GenMode Express_Item::GetGenMode() const
{
return myGenMode;
}
//=================================================================================================
void Express_Item::SetGenMode(const Express_Item::GenMode theGenMode)
{
myGenMode = theGenMode;
}
//=================================================================================================
void Express_Item::ResetLoopFlag()
{
myLoopFlag = Standard_False;
}
//=================================================================================================
Standard_Boolean Express_Item::Generate()
{
// skip items without "generate" mark
GenMode aMode = GetGenMode();
if (!(aMode == GM_GenByUser || aMode == GM_GenByAlgo))
{
return Standard_False;
}
// manage indent for cout in order to mark structure of calls
static Standard_Integer aShift = -1;
aShift++;
for (Standard_Integer i = 0; i < aShift; i++)
{
std::cout << " ";
}
// sets the mode to generated before "GenerateClass" function to avoid looping
SetGenMode(GM_Generated);
Standard_Boolean aRes = GenerateClass();
aShift--;
return aRes;
}
//=================================================================================================
Standard_Boolean Express_Item::Use()
{
// if Item is not mentioned by the user but is used, then it is necessary to generate
if (GetGenMode() != GM_Undefined)
{
return Standard_False;
}
SetGenMode(GM_GenByAlgo);
return Generate();
}
//=================================================================================================
void Express_Item::Use2(const TCollection_AsciiString& theRefName,
const TCollection_AsciiString& theRefPack)
{
if (myLoopFlag)
{
return;
}
else
{
myLoopFlag = Standard_True;
}
// issue a warning message if item does not have package assigned
if (!IsPackageNameSet())
{
Message::SendWarning() << "Warning: item " << Name() << " has no package assigned but used by "
<< theRefName << ", setting " << theRefPack;
SetPackageName(theRefPack);
}
PropagateUse();
}
//=================================================================================================
void Express_Item::SetCategory(const Handle(TCollection_HAsciiString)& theCateg)
{
myCategory = theCateg;
}
//=================================================================================================
const TCollection_AsciiString& Express_Item::Category() const
{
return myCategory->String();
}
//=================================================================================================
void Express_Item::SetShortName(const Handle(TCollection_HAsciiString)& theShName)
{
myShortName = theShName;
}
//=================================================================================================
Handle(TCollection_HAsciiString) Express_Item::ShortName() const
{
return myShortName;
}
//=================================================================================================
void Express_Item::SetCheckFlag(const Standard_Boolean theCheckFlag)
{
myhasCheck = theCheckFlag;
}
//=================================================================================================
Standard_Boolean Express_Item::CheckFlag() const
{
return myhasCheck;
}
//=================================================================================================
void Express_Item::SetFillSharedFlag(const Standard_Boolean theFillSharedFlag)
{
myhasFillShared = theFillSharedFlag;
}
//=================================================================================================
Standard_Boolean Express_Item::FillSharedFlag() const
{
return myhasFillShared;
}
//=================================================================================================
void Express_Item::SetIndex(const Standard_Integer theIndex)
{
myIndex = theIndex;
}
//=================================================================================================
Standard_Integer Express_Item::Index()
{
return myIndex;
}

View File

@ -1,149 +0,0 @@
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Express_Item_HeaderFile
#define _Express_Item_HeaderFile
#include <Standard.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_CString.hxx>
#include <Standard_DefineHandle.hxx>
#include <Standard_Transient.hxx>
class TCollection_AsciiString;
class TCollection_HAsciiString;
//! Base class for items of the schema. Stores a name of the class,
//! package name and flag used to mark items for generation.
//! Provides interface for writing generated class definitions to HXX
//! and CXX files.
class Express_Item : public Standard_Transient
{
public:
enum GenMode
{
GM_NoGen, // Item in existed list - no need to generate
GM_GenByUser, // Item in new list - need to generate
GM_GenByAlgo, // Item isn't in any list but is used by needed item
GM_Undefined, // Item isn't in any list
GM_Generated // Item has been generated
};
//! Returns item name
Standard_EXPORT const TCollection_AsciiString& Name() const;
//! Returns a pointer to the item name to modify it
Standard_EXPORT Handle(TCollection_HAsciiString) HName() const;
//! Returns (generated) name for the item in CXX-style (Package_Class)
Standard_EXPORT virtual const TCollection_AsciiString CPPName() const;
//! Returns package name
//! If not defined, returns unknown package name: "StepStep"
Standard_EXPORT const TCollection_AsciiString& GetPackageName() const;
//! Returns whether the package name is set.
Standard_EXPORT Standard_Boolean IsPackageNameSet() const;
//! Returns unknown package name: "StepStep"
Standard_EXPORT static TCollection_AsciiString& GetUnknownPackageName();
//! Sets package name
Standard_EXPORT void SetPackageName(const TCollection_AsciiString& thePack);
//! Returns item generation mode
Standard_EXPORT GenMode GetGenMode() const;
//! Change generation mode for item
Standard_EXPORT void SetGenMode(const GenMode theGenMode);
//! Reset loop flag
Standard_EXPORT void ResetLoopFlag();
//! General interface for creating HXX/CXX files from item
Standard_EXPORT virtual Standard_Boolean GenerateClass() const = 0;
//! Propagates the calls of Use function
Standard_EXPORT virtual void PropagateUse() const = 0;
//! Checks that item is marked for generation and if yes,
//! generate it by calling GenerateClass. But firstly define
//! PackageName to "StepStep" if not yet defined and drop Mark flag.
Standard_EXPORT Standard_Boolean Generate();
//! Declares item as used by other item being generated
//! If Item is not mentioned by the user (as new or existed) but is used,
//! then it sets GenMode to GM_GenByAlgo and Calls Generate().
Standard_EXPORT Standard_Boolean Use();
//! Mark Item as visited in PropagateUse flow and defined the package name if not set.
Standard_EXPORT void Use2(const TCollection_AsciiString& theRefName,
const TCollection_AsciiString& theRefPack);
//! Set category for item
Standard_EXPORT void SetCategory(const Handle(TCollection_HAsciiString)& theCateg);
//! Get item category
Standard_EXPORT const TCollection_AsciiString& Category() const;
//! Set short name for item
Standard_EXPORT void SetShortName(const Handle(TCollection_HAsciiString)& theShName);
//! Get item short name
Standard_EXPORT Handle(TCollection_HAsciiString) ShortName() const;
//! Set flag for presence of method Check in the class
Standard_EXPORT void SetCheckFlag(const Standard_Boolean theCheckFlag);
//! Get flag responsible for presence of method Check in the class
Standard_EXPORT Standard_Boolean CheckFlag() const;
//! Set flag for presence of method FillShared in the class
Standard_EXPORT void SetFillSharedFlag(const Standard_Boolean theFillSharedFlag);
//! Get flag responsible for presence of method FillShared in the class
Standard_EXPORT Standard_Boolean FillSharedFlag() const;
//! Set start entity index
Standard_EXPORT static void SetIndex(const Standard_Integer theIndex);
//! Get current entity index
Standard_EXPORT static Standard_Integer Index();
DEFINE_STANDARD_RTTIEXT(Express_Item, Standard_Transient)
protected:
//! Creates object and initializes fields PackageName and
//! CreateFlag by 0
Standard_EXPORT Express_Item(const Standard_CString theName);
//! Creates object and initializes fields PackageName and
//! CreateFlag by 0
Standard_EXPORT Express_Item(const Handle(TCollection_HAsciiString)& theName);
private:
Handle(TCollection_HAsciiString) myName;
Handle(TCollection_HAsciiString) myPack;
// "Generate" mark. If is TRUE a class will be generated for the item
GenMode myGenMode;
// Flag to avoid looping
Standard_Boolean myLoopFlag;
Handle(TCollection_HAsciiString) myShortName;
Handle(TCollection_HAsciiString) myCategory;
Standard_Boolean myhasCheck;
Standard_Boolean myhasFillShared;
static Standard_Integer myIndex;
};
#endif // _Express_Item_HeaderFile

View File

@ -1,21 +0,0 @@
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Express_List_HeaderFile
#define _Express_List_HeaderFile
#include <Express_ComplexType.hxx>
typedef Express_ComplexType Express_List;
#endif // _Express_List_HeaderFile

View File

@ -1,52 +0,0 @@
// Created: Tue Nov 2 15:27:26 1999
// Author: Andrey BETENEV
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Express_Logical.hxx>
#include <TCollection_AsciiString.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Express_Logical, Express_PredefinedType)
//=================================================================================================
Express_Logical::Express_Logical() {}
//=================================================================================================
const TCollection_AsciiString Express_Logical::CPPName() const
{
return "StepData_Logical";
}
//=================================================================================================
Standard_Boolean Express_Logical::IsStandard() const
{
return Standard_False;
}
//=================================================================================================
Standard_Boolean Express_Logical::IsSimple() const
{
return Standard_True;
}
//=================================================================================================
Standard_Boolean Express_Logical::IsHandle() const
{
return Standard_False;
}

View File

@ -1,48 +0,0 @@
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Express_Logical_HeaderFile
#define _Express_Logical_HeaderFile
#include <Express_PredefinedType.hxx>
#include <Standard_Type.hxx>
class TCollection_AsciiString;
//! Implements EXPRESS type 'LOGICAL'
class Express_Logical : public Express_PredefinedType
{
public:
//! Empty constructor
Standard_EXPORT Express_Logical();
//! Returns "StepData_Logical"
Standard_EXPORT virtual const TCollection_AsciiString CPPName() const Standard_OVERRIDE;
//! Return False
Standard_EXPORT virtual Standard_Boolean IsStandard() const Standard_OVERRIDE;
//! Return False
Standard_EXPORT virtual Standard_Boolean IsSimple() const Standard_OVERRIDE;
//! Return False
Standard_EXPORT virtual Standard_Boolean IsHandle() const Standard_OVERRIDE;
DEFINE_STANDARD_RTTIEXT(Express_Logical, Express_PredefinedType)
protected:
private:
};
#endif // _Express_Logical_HeaderFile

View File

@ -1,132 +0,0 @@
// Created: Tue Nov 2 15:13:31 1999
// Author: Andrey BETENEV
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Express_NamedType.hxx>
#include <Express_Alias.hxx>
#include <Express_Entity.hxx>
#include <Express_Enum.hxx>
#include <Express_Item.hxx>
#include <TCollection_AsciiString.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Express_NamedType, Express_Type)
//=================================================================================================
Express_NamedType::Express_NamedType(const Standard_CString theName)
{
myName = new TCollection_HAsciiString(theName);
}
//=================================================================================================
Express_NamedType::Express_NamedType(const Handle(TCollection_HAsciiString)& theName)
{
myName = theName;
}
//=================================================================================================
const TCollection_AsciiString& Express_NamedType::Name() const
{
return myName->String();
}
//=================================================================================================
Handle(TCollection_HAsciiString) Express_NamedType::HName() const
{
return myName;
}
//=================================================================================================
const Handle(Express_Item)& Express_NamedType::Item() const
{
return myItem;
}
//=================================================================================================
void Express_NamedType::SetItem(const Handle(Express_Item)& theItem)
{
myItem = theItem;
}
//=================================================================================================
const TCollection_AsciiString Express_NamedType::CPPName() const
{
return myItem->CPPName();
}
//=================================================================================================
Standard_Boolean Express_NamedType::IsStandard() const
{
if (myItem->IsKind(STANDARD_TYPE(Express_Alias)))
{
Handle(Express_Alias) anAlias = Handle(Express_Alias)::DownCast(myItem);
return anAlias->Type()->IsStandard();
}
return Standard_False;
}
//=================================================================================================
Standard_Boolean Express_NamedType::IsSimple() const
{
if (myItem->IsKind(STANDARD_TYPE(Express_Alias)))
{
Handle(Express_Alias) anAlias = Handle(Express_Alias)::DownCast(myItem);
return anAlias->Type()->IsSimple();
}
if (myItem->IsKind(STANDARD_TYPE(Express_Enum)))
{
return Standard_True;
}
return Standard_False; // SELECT & ENTITY
}
//=================================================================================================
Standard_Boolean Express_NamedType::IsHandle() const
{
if (myItem->IsKind(STANDARD_TYPE(Express_Alias)))
{
Handle(Express_Alias) alias = Handle(Express_Alias)::DownCast(myItem);
return alias->Type()->IsHandle();
}
if (myItem->IsKind(STANDARD_TYPE(Express_Entity)))
{
return Standard_True;
}
return Standard_False; // SELECT & ENUMERATION
}
//=================================================================================================
Standard_Boolean Express_NamedType::Use() const
{
return myItem->Use();
}
//=================================================================================================
void Express_NamedType::Use2(const TCollection_AsciiString& theRefName,
const TCollection_AsciiString& theRefPack) const
{
myItem->Use2(theRefName, theRefPack);
}

View File

@ -1,79 +0,0 @@
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Express_NamedType_HeaderFile
#define _Express_NamedType_HeaderFile
#include <Express_Type.hxx>
#include <Standard_Type.hxx>
class Express_Item;
class TCollection_AsciiString;
class TCollection_HAsciiString;
//! Base class for complex types (ARRAY, LIST, BAG, SET)
//! in EXPRESS schema
//! Stores type of elements and
class Express_NamedType : public Express_Type
{
public:
//! Creates an object and initializes by name
Standard_EXPORT Express_NamedType(const Standard_CString theName);
//! Creates an object and initializes by name
Standard_EXPORT Express_NamedType(const Handle(TCollection_HAsciiString)& theName);
//! Returns name of type (item in schema)
Standard_EXPORT const TCollection_AsciiString& Name() const;
//! Returns a pointer to the type name to modify it
Standard_EXPORT Handle(TCollection_HAsciiString) HName() const;
//! Returns handle to referred item in schema
Standard_EXPORT const Handle(Express_Item)& Item() const;
//! Sets handle to referred item in schema
Standard_EXPORT void SetItem(const Handle(Express_Item)& theItem);
//! Returns CPP-style name of the type
Standard_EXPORT virtual const TCollection_AsciiString CPPName() const Standard_OVERRIDE;
//! Return True if type is defined in package Standard
Standard_EXPORT virtual Standard_Boolean IsStandard() const Standard_OVERRIDE;
//! Return True if type is simple (not a class)
Standard_EXPORT virtual Standard_Boolean IsSimple() const Standard_OVERRIDE;
//! Return True if type is inherited from Transient
Standard_EXPORT virtual Standard_Boolean IsHandle() const Standard_OVERRIDE;
//! Declares type as used by some item being generated.
//! Calls Use() for referred item (found by name).
Standard_EXPORT virtual Standard_Boolean Use() const Standard_OVERRIDE;
//! Declares type as used by some item being generated.
//! Calls Use() for referred item (found by name).
Standard_EXPORT virtual void Use2(const TCollection_AsciiString& theRefName,
const TCollection_AsciiString& theRefPack) const
Standard_OVERRIDE;
DEFINE_STANDARD_RTTIEXT(Express_NamedType, Express_Type)
protected:
private:
Handle(TCollection_HAsciiString) myName;
Handle(Express_Item) myItem;
};
#endif // _Express_NamedType_HeaderFile

View File

@ -1,21 +0,0 @@
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Express_Number_HeaderFile
#define _Express_Number_HeaderFile
#include <Express_Integer.hxx>
typedef Express_Integer Express_Number;
#endif // _Express_Number_HeaderFile

View File

@ -1,29 +0,0 @@
// Created: Tue Nov 2 15:13:31 1999
// Author: Andrey BETENEV
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Express_PredefinedType.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Express_PredefinedType, Express_Type)
//=================================================================================================
Express_PredefinedType::Express_PredefinedType() {}
//=================================================================================================
Standard_Boolean Express_PredefinedType::IsStandard() const
{
return Standard_True;
}

View File

@ -1,38 +0,0 @@
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Express_PredefinedType_HeaderFile
#define _Express_PredefinedType_HeaderFile
#include <Standard_Type.hxx>
#include <Express_Type.hxx>
//! Base class for predefined types (like NUMBER or STRING)
//! in EXPRESS schema
class Express_PredefinedType : public Express_Type
{
public:
//! Returns True
Standard_EXPORT virtual Standard_Boolean IsStandard() const Standard_OVERRIDE;
DEFINE_STANDARD_RTTIEXT(Express_PredefinedType, Express_Type)
protected:
//! Empty constructor
Standard_EXPORT Express_PredefinedType();
private:
};
#endif // _Express_PredefinedType_HeaderFile

View File

@ -1,31 +0,0 @@
// Created: Tue Nov 2 15:27:26 1999
// Author: Andrey BETENEV
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Express_Real.hxx>
#include <TCollection_AsciiString.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Express_Real, Express_PredefinedType)
//=================================================================================================
Express_Real::Express_Real() {}
//=================================================================================================
const TCollection_AsciiString Express_Real::CPPName() const
{
return "Standard_Real";
}

View File

@ -1,39 +0,0 @@
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Express_Real_HeaderFile
#define _Express_Real_HeaderFile
#include <Express_PredefinedType.hxx>
#include <Standard_Type.hxx>
class TCollection_AsciiString;
//! Implements EXPRESS type 'REAL'
class Express_Real : public Express_PredefinedType
{
public:
//! Empty constructor
Standard_EXPORT Express_Real();
//! Returns "Standard_Real"
Standard_EXPORT virtual const TCollection_AsciiString CPPName() const Standard_OVERRIDE;
DEFINE_STANDARD_RTTIEXT(Express_Real, Express_PredefinedType)
protected:
private:
};
#endif // _Express_Real_HeaderFile

View File

@ -1,38 +0,0 @@
// Created: Fri Nov 22 13:32:26 2002
// Author: Andrey BETENEV
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Express_Reference.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Express_Reference, Express_Item)
//=================================================================================================
Express_Reference::Express_Reference(const Standard_CString theName,
const Handle(TColStd_HSequenceOfHAsciiString)& theTypes)
: Express_Item(theName)
{
myTypes = theTypes;
}
//=================================================================================================
Standard_Boolean Express_Reference::GenerateClass() const
{
return Standard_False;
}
//=================================================================================================
void Express_Reference::PropagateUse() const {}

View File

@ -1,55 +0,0 @@
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Express_Reference_HeaderFile
#define _Express_Reference_HeaderFile
#include <Express_Item.hxx>
#include <Standard_Type.hxx>
#include <TColStd_HSequenceOfHAsciiString.hxx>
class Express_HSequenceOfItem;
//! Implements REFERENCE FROM (list of types used from other schema)
//! item of the EXPRESS schema, with interface for Item class.
class Express_Reference : public Express_Item
{
public:
//! Create Reference item and initialize it
Standard_EXPORT Express_Reference(const Standard_CString theName,
const Handle(TColStd_HSequenceOfHAsciiString)& theTypes);
//! Returns list of types referenced
const Handle(TColStd_HSequenceOfHAsciiString)& Types() const { return myTypes; }
//! Returns handle to sequence of items corresponding to
//! listed types
const Handle(Express_HSequenceOfItem)& Items() const { return myItems; }
//! Redefined to empty (in order to be able to instantiate)
//! Return False
Standard_EXPORT virtual Standard_Boolean GenerateClass() const Standard_OVERRIDE;
//! Propagates the calls of Use function
Standard_EXPORT virtual void PropagateUse() const Standard_OVERRIDE;
DEFINE_STANDARD_RTTIEXT(Express_Reference, Express_Item)
protected:
private:
Handle(TColStd_HSequenceOfHAsciiString) myTypes;
Handle(Express_HSequenceOfItem) myItems;
};
#endif // _Express_Reference_HeaderFile

View File

@ -1,302 +0,0 @@
// Created: Tue Nov 2 12:29:06 1999
// Author: Andrey BETENEV
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Express_Schema.hxx>
#include <Express_Alias.hxx>
#include <Express_ComplexType.hxx>
#include <Express_Entity.hxx>
#include <Express_Enum.hxx>
#include <Express_HSequenceOfEntity.hxx>
#include <Express_HSequenceOfField.hxx>
#include <Express_NamedType.hxx>
#include <Express_Select.hxx>
#include <Express_Type.hxx>
#include <Message.hxx>
#include <TColStd_HSequenceOfHAsciiString.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Express_Schema, Standard_Transient)
//=================================================================================================
Express_Schema::Express_Schema(const Standard_CString theName,
const Handle(Express_HSequenceOfItem)& theItems)
{
myName = new TCollection_HAsciiString(theName);
myItems = theItems;
Prepare();
}
//=================================================================================================
Express_Schema::Express_Schema(const Handle(TCollection_HAsciiString)& theName,
const Handle(Express_HSequenceOfItem)& theItems)
{
myName = theName;
myItems = theItems;
Prepare();
}
//=================================================================================================
const Handle(TCollection_HAsciiString)& Express_Schema::Name() const
{
return myName;
}
//=================================================================================================
const Handle(Express_HSequenceOfItem)& Express_Schema::Items() const
{
return myItems;
}
//=================================================================================================
Standard_Integer Express_Schema::NbItems() const
{
return myItems->Length();
}
//=================================================================================================
Handle(Express_Item) Express_Schema::Item(const Standard_Integer theNum) const
{
return myItems->Value(theNum);
}
//=================================================================================================
Handle(Express_Item) Express_Schema::Item(const Standard_CString theName,
const Standard_Boolean theSilent) const
{
if (!myDict.IsBound(theName))
{
if (!theSilent)
{
Message::SendFail() << "Error: attempt to access unknown item by name " << theName;
}
return {};
}
return myDict.Find(theName);
}
//=================================================================================================
Handle(Express_Item) Express_Schema::Item(const TCollection_AsciiString& theName) const
{
return Item(theName.ToCString());
}
//=================================================================================================
Handle(Express_Item) Express_Schema::Item(const Handle(TCollection_HAsciiString)& theName) const
{
return Item(theName->ToCString());
}
//=======================================================================
// function : nameToCasCade
// purpose : auxiliary for Prepare()
// Convert STEP-style name (lowercase, with underscores)
// to CASCADE-style name (each word starts with uppercase, no intervals)
//=======================================================================
static void nameToCasCade(const Handle(TCollection_HAsciiString)& theName)
{
if (theName.IsNull())
{
return;
}
for (Standard_Integer i = 1; i <= theName->Length(); i++)
{
if (theName->Value(i) == '_')
{
theName->Remove(i);
}
else if (i > 1)
{
continue;
}
theName->SetValue(i, UpperCase(theName->Value(i)));
}
}
//=======================================================================
// function : nameToCasCade
// purpose : auxiliary for Prepare()
// Convert names for Type object
//=======================================================================
static void nameToCasCade(const Handle(Express_Type)& theType)
{
if (theType->IsKind(STANDARD_TYPE(Express_NamedType)))
{
const Handle(Express_NamedType) aNamedType = Handle(Express_NamedType)::DownCast(theType);
nameToCasCade(aNamedType->HName());
}
else if (theType->IsKind(STANDARD_TYPE(Express_ComplexType)))
{
const Handle(Express_ComplexType) aComplexType = Handle(Express_ComplexType)::DownCast(theType);
nameToCasCade(aComplexType->Type());
}
}
//=======================================================================
// function : Prepare
// purpose : Prepare data: convert names to CasCade, fill dictionary of typenames
// and set handles to items where they are referenced by names
//=======================================================================
void Express_Schema::Prepare()
{
myDict.Clear();
if (myItems.IsNull())
{
return;
}
Standard_Integer aNbItems = NbItems();
// convert names and fill dictionary
for (Standard_Integer aNum = 1; aNum <= aNbItems; aNum++)
{
// get item
const Handle(Express_Item) anItem = Item(aNum);
// change item name
nameToCasCade(anItem->HName());
// change names of referred types and other names
if (anItem->IsKind(STANDARD_TYPE(Express_Alias)))
{
const Handle(Express_Alias) anAlias = Handle(Express_Alias)::DownCast(anItem);
nameToCasCade(anAlias->Type());
}
else if (anItem->IsKind(STANDARD_TYPE(Express_Select)))
{
const Handle(Express_Select) aSelect = Handle(Express_Select)::DownCast(anItem);
for (Standard_Integer i = 1; i <= aSelect->Names()->Length(); i++)
{
nameToCasCade(aSelect->Names()->Value(i));
}
}
else if (anItem->IsKind(STANDARD_TYPE(Express_Enum)))
{
const Handle(Express_Enum) anEnum = Handle(Express_Enum)::DownCast(anItem);
for (Standard_Integer i = 1; i <= anEnum->Names()->Length(); i++)
{
nameToCasCade(anEnum->Names()->Value(i));
}
}
else if (anItem->IsKind(STANDARD_TYPE(Express_Entity)))
{
const Handle(Express_Entity) anEntity = Handle(Express_Entity)::DownCast(anItem);
for (Standard_Integer i = 1; i <= anEntity->SuperTypes()->Length(); i++)
{
nameToCasCade(anEntity->SuperTypes()->Value(i));
}
const Handle(Express_HSequenceOfField) aFields = anEntity->Fields();
for (Standard_Integer i = 1; i <= aFields->Length(); i++)
{
nameToCasCade(aFields->Value(i)->HName());
nameToCasCade(aFields->Value(i)->Type());
}
}
// add to dictionary
myDict.Bind(anItem->Name(), anItem);
}
// set references to items from other items and types
for (Standard_Integer aNum = 1; aNum <= aNbItems; aNum++)
{
const Handle(Express_Item) anItem = Item(aNum);
if (anItem->IsKind(STANDARD_TYPE(Express_Alias)))
{
const Handle(Express_Alias) anAlias = Handle(Express_Alias)::DownCast(anItem);
PrepareType(anAlias->Type());
// for aliases, define package to avoid warnings
anAlias->SetPackageName("Standard");
continue;
}
else if (anItem->IsKind(STANDARD_TYPE(Express_Select)))
{
const Handle(Express_Select) aSelect = Handle(Express_Select)::DownCast(anItem);
Handle(TColStd_HSequenceOfHAsciiString) aNames = aSelect->Names();
Handle(Express_HSequenceOfItem) anItems = aSelect->Items();
for (Standard_Integer i = 1; i <= aNames->Length(); i++)
{
Handle(Express_Item) aSubItem = Item(aNames->Value(i));
// if select refers to another select, expand it
if (aSubItem->IsKind(STANDARD_TYPE(Express_Select)))
{
Message::SendInfo() << "Info: SELECT " << anItem->Name() << " refers to another SELECT "
<< aSubItem->Name() << "; expanded";
const Handle(Express_Select) aSubSelect = Handle(Express_Select)::DownCast(aSubItem);
Standard_Integer j = 1;
for (; j <= aSubSelect->Names()->Length(); j++)
{
aNames->InsertBefore(i + j - 1, aSubSelect->Names()->Value(j));
}
aNames->Remove(i + j - 1);
i--;
continue;
}
anItems->Append(aSubItem);
}
}
else if (anItem->IsKind(STANDARD_TYPE(Express_Entity)))
{
const Handle(Express_Entity) anEntity = Handle(Express_Entity)::DownCast(anItem);
Handle(TColStd_HSequenceOfHAsciiString) aNames = anEntity->SuperTypes();
Handle(Express_HSequenceOfEntity) anInhItems = anEntity->Inherit();
for (Standard_Integer i = 1; i <= aNames->Length(); i++)
{
Handle(Express_Entity) aSubEntity =
Handle(Express_Entity)::DownCast(Item(aNames->Value(i)));
if (!aSubEntity.IsNull())
{
anInhItems->Append(aSubEntity);
}
else
{
Message::SendFail() << "Error in " << anItem->Name() << ": supertype "
<< aNames->Value(i)->String() << " is not an ENTITY; ignored";
}
}
const Handle(Express_HSequenceOfField) aFields = anEntity->Fields();
for (Standard_Integer i = 1; i <= aFields->Length(); i++)
{
PrepareType(aFields->Value(i)->Type());
}
}
}
}
//=================================================================================================
void Express_Schema::PrepareType(const Handle(Express_Type)& theType) const
{
if (theType->IsKind(STANDARD_TYPE(Express_NamedType)))
{
Handle(Express_NamedType) aNamedType = Handle(Express_NamedType)::DownCast(theType);
aNamedType->SetItem(Item(aNamedType->Name()));
}
else if (theType->IsKind(STANDARD_TYPE(Express_ComplexType)))
{
Handle(Express_ComplexType) aComplexType = Handle(Express_ComplexType)::DownCast(theType);
PrepareType(aComplexType->Type());
}
}

View File

@ -1,88 +0,0 @@
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Express_Schema_HeaderFile
#define _Express_Schema_HeaderFile
#include <Express_DataMapOfAsciiStringItem.hxx>
#include <Express_HSequenceOfItem.hxx>
#include <Standard_Type.hxx>
class TCollection_HAsciiString;
class Express_HSequenceOfItem;
class Express_Item;
class TCollection_AsciiString;
class Express_Type;
//! Represents a schema as a list of items and provides general
//! tools for generating HXX/CXX files (including dictionary of
//! item names)
class Express_Schema : public Standard_Transient
{
public:
//! Creates a schema with given name and given set of items
//! and calls Prepare()
Standard_EXPORT Express_Schema(const Standard_CString theName,
const Handle(Express_HSequenceOfItem)& theItems);
//! Creates a schema with given name and given set of items
//! and calls Prepare()
Standard_EXPORT Express_Schema(const Handle(TCollection_HAsciiString)& theName,
const Handle(Express_HSequenceOfItem)& theItems);
//! Returns schema name
Standard_EXPORT const Handle(TCollection_HAsciiString)& Name() const;
//! Returns sequence of items
Standard_EXPORT const Handle(Express_HSequenceOfItem)& Items() const;
//! Returns number of items
Standard_EXPORT Standard_Integer NbItems() const;
//! Returns item by index
Standard_EXPORT Handle(Express_Item) Item(const Standard_Integer theNum) const;
//! Returns item by name
Standard_EXPORT Handle(Express_Item) Item(
const Standard_CString theName,
const Standard_Boolean theSilent = Standard_False) const;
//! Returns item by name
Standard_EXPORT Handle(Express_Item) Item(const TCollection_AsciiString& theName) const;
//! Returns item by name
Standard_EXPORT Handle(Express_Item) Item(const Handle(TCollection_HAsciiString)& theName) const;
DEFINE_STANDARD_RTTIEXT(Express_Schema, Standard_Transient)
protected:
private:
//! Prepares data for further work. Converts all item names
//! from EXPRESS style (aaa_bb) to CASCADE style (AaaBb).
//! Then, makes a dictionary of item names and sets handles
//! to all items referred initially by name
Standard_EXPORT void Prepare();
//! Prepares type for work by setting its handle to item in the
//! schema according to dictionary (for types which refer items
//! by name)
Standard_EXPORT void PrepareType(const Handle(Express_Type)& theType) const;
private:
Handle(TCollection_HAsciiString) myName;
Handle(Express_HSequenceOfItem) myItems;
Express_DataMapOfAsciiStringItem myDict;
};
#endif // _Express_Schema_HeaderFile

View File

@ -1,714 +0,0 @@
// Created: Tue Nov 2 14:40:06 1999
// Author: Andrey BETENEV
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Express_Select.hxx>
#include <Express.hxx>
#include <Express_Alias.hxx>
#include <Express_ComplexType.hxx>
#include <Express_Entity.hxx>
#include <Express_Enum.hxx>
#include <Express_HSequenceOfItem.hxx>
#include <Express_Type.hxx>
#include <Message.hxx>
#include <OSD_Directory.hxx>
#include <OSD_FileSystem.hxx>
#include <OSD_Path.hxx>
#include <OSD_Protection.hxx>
#include <TColStd_HSequenceOfHAsciiString.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Express_Select, Express_Item)
//=================================================================================================
Express_Select::Express_Select(const Standard_CString theName,
const Handle(TColStd_HSequenceOfHAsciiString)& theNames)
: Express_Item(theName),
myNames(theNames)
{
myItems = new Express_HSequenceOfItem;
}
//=================================================================================================
const Handle(TColStd_HSequenceOfHAsciiString)& Express_Select::Names() const
{
return myNames;
}
//=================================================================================================
const Handle(Express_HSequenceOfItem)& Express_Select::Items() const
{
return myItems;
}
//=================================================================================================
Standard_Boolean Express_Select::GenerateClass() const
{
const TCollection_AsciiString aCPPName = CPPName();
Handle(TColStd_HSequenceOfInteger) aSeqMember = new TColStd_HSequenceOfInteger;
Handle(TColStd_HSequenceOfInteger) aSeqEntities = new TColStd_HSequenceOfInteger;
for (Standard_Integer i = 1; i <= myItems->Length(); i++)
{
Handle(Express_Item) anItem = myItems->Value(i);
if (anItem->IsKind(STANDARD_TYPE(Express_Entity))
|| anItem->IsKind(STANDARD_TYPE(Express_Select))
|| anItem->IsKind(STANDARD_TYPE(Express_Alias))
|| anItem->IsKind(STANDARD_TYPE(Express_ComplexType)))
{
aSeqEntities->Append(i);
}
else
{
aSeqMember->Append(i);
}
}
Message::SendInfo() << "Generating SELECT " << aCPPName;
if (!aSeqMember->IsEmpty())
{
Message::SendInfo() << "Generating SELECTMember " << aCPPName << "Member";
generateSelectMember(aSeqMember);
}
// create a package directory (if not yet exist)
OSD_Protection aProt(OSD_RWXD, OSD_RWXD, OSD_RX, OSD_RX);
TCollection_AsciiString aPack = GetPackageName();
OSD_Path aPath(aPack);
OSD_Directory aDir(aPath);
aDir.Build(aProt);
aPack += "/";
aPack += aCPPName;
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
//===============================
// Step 1: generating HXX
{
// Open HXX file
std::shared_ptr<std::ostream> aStreamPtr =
aFileSystem->OpenOStream(aPack.Cat(".hxx"), std::ios::out | std::ios::binary);
Standard_OStream& anOS = *aStreamPtr;
// write header
Express::WriteFileStamp(anOS);
// write start define
anOS << "#ifndef _" << aCPPName
<< "_HeaderFile\n"
"#define _"
<< aCPPName
<< "_HeaderFile\n"
"\n";
// write common includes
anOS << "#include <Standard.hxx>\n"
"#include <Standard_DefineAlloc.hxx>\n"
"#include <Standard_Handle.hxx>\n"
"#include <StepData_SelectType.hxx>\n"
"#include <Standard_Integer.hxx>\n"
"\n";
anOS << "class Standard_Transient;\n";
if (!aSeqMember->IsEmpty())
anOS << "class StepData_SelectMember;\n";
for (Standard_Integer i = 1; i <= myItems->Length(); i++)
{
Handle(Express_Item) anItem = myItems->Value(i);
anItem->Use();
if (anItem->IsKind(STANDARD_TYPE(Express_Alias)))
{
Handle(Express_Type) aType = Handle(Express_Alias)::DownCast(anItem)->Type();
if (aType->IsStandard())
{
continue;
}
}
anOS << "class " << anItem->CPPName() << ";\n";
}
anOS << "\n";
// class declaration
anOS << "//! Representation of STEP SELECT type " << Name()
<< "\n"
"class "
<< aCPPName
<< " : public StepData_SelectType\n"
"{\n"
"\n"
"public:\n"
"\n"
" DEFINE_STANDARD_ALLOC\n"
"\n";
// default constructor
anOS << " //! Empty constructor\n"
" Standard_EXPORT "
<< aCPPName
<< "();\n"
"\n";
// write common methods section
anOS << " //! Recognizes a kind of " << Name() << " select type\n";
for (Standard_Integer i = 1; i <= aSeqEntities->Length(); i++)
{
Standard_Integer anIdx = aSeqEntities->Value(i);
anOS << " //! -- " << i << " -> " << myNames->Value(anIdx)->String() << "\n";
}
anOS << " Standard_EXPORT Standard_Integer CaseNum (const Handle(Standard_Transient)& theEnt) "
"const Standard_OVERRIDE;\n"
"\n";
if (!aSeqMember->IsEmpty())
{
anOS << " //! Recognizes items of select member " << Name() << "Member\n";
for (Standard_Integer i = 1; i <= aSeqMember->Length(); i++)
{
Standard_Integer anIdx = aSeqMember->Value(i);
anOS << " //! -- " << i << " -> " << myNames->Value(anIdx)->String() << "\n";
}
anOS << " //! -- 0 else\n"
" Standard_EXPORT virtual Standard_Integer CaseMem (const "
"Handle(StepData_SelectMember)& theEnt) const Standard_OVERRIDE;\n"
"\n"
" //! Returns a new select member the type "
<< Name()
<< "Member\n"
" Standard_EXPORT virtual Handle(StepData_SelectMember) NewMember() const "
"Standard_OVERRIDE;\n"
"\n";
}
// write methods get for entities
for (Standard_Integer i = 1; i <= aSeqEntities->Length(); i++)
{
Standard_Integer anIdx = aSeqEntities->Value(i);
Handle(Express_Item) anItem = myItems->Value(anIdx);
const TCollection_AsciiString& aName = anItem->Name();
anOS << " //! Returns Value as " << aName
<< " (or Null if another type)\n"
" Standard_EXPORT Handle("
<< anItem->CPPName() << ") " << aName
<< "() const;\n"
"\n";
}
// writes method set and get for enum , integer, real and string.
for (Standard_Integer i = 1; i <= aSeqMember->Length(); i++)
{
Standard_Integer anIdx = aSeqMember->Value(i);
Handle(Express_Item) anItem = myItems->Value(anIdx);
const TCollection_AsciiString& aName = anItem->Name();
const TCollection_AsciiString& anItemCPPName = anItem->CPPName();
anOS << " //! Set Value for " << aName
<< "\n"
" Standard_EXPORT void Set"
<< aName << " (const " << anItemCPPName
<< " theVal);\n"
"\n"
" //! Returns Value as "
<< aName
<< " (or Null if another type)\n"
" "
<< anItemCPPName << " " << aName
<< "() const;\n"
"\n";
}
// write end
anOS << "};\n"
"#endif // _"
<< aCPPName << "_HeaderFile\n";
aStreamPtr.reset();
}
//===============================
// Step 2: generating CXX
{
// Open CXX file
std::shared_ptr<std::ostream> aStreamPtr =
aFileSystem->OpenOStream(aPack.Cat(".cxx"), std::ios::out | std::ios::binary);
Standard_OStream& anOS = *aStreamPtr;
// write header
Express::WriteFileStamp(anOS);
// write include section
anOS << "#include <" << aCPPName << ".hxx>\n";
if (!aSeqMember->IsEmpty())
{
anOS << "#include <" << aCPPName
<< "Member.hxx>\n"
"#include <TCollection_HAsciiString.hxx>\n";
}
for (Standard_Integer i = 1; i <= aSeqEntities->Length(); i++)
{
Standard_Integer anIdx = aSeqEntities->Value(i);
anOS << "#include <" << myItems->Value(anIdx)->CPPName() << ".hxx>\n";
}
// write constructor
Express::WriteMethodStamp(anOS, aCPPName);
anOS << aCPPName << "::" << aCPPName
<< "()\n"
"{\n"
"}\n";
// write CaseNum method
Express::WriteMethodStamp(anOS, "CaseNum");
anOS << "Standard_Integer " << aCPPName
<< "::CaseNum (const Handle(Standard_Transient)& theEnt) const\n"
"{\n";
if (!aSeqEntities->IsEmpty())
{
anOS << " if (theEnt.IsNull()) return 0;\n";
for (Standard_Integer i = 1; i <= aSeqEntities->Length(); i++)
{
Standard_Integer anIdx = aSeqEntities->Value(i);
anOS << " if (theEnt->IsKind (STANDARD_TYPE(" << myItems->Value(anIdx)->CPPName()
<< "))) return " << i << ";\n";
}
anOS << " return 0;\n"
"}\n";
}
else
{
anOS << " return 0;\n"
"}\n";
}
if (!aSeqMember->IsEmpty())
{
// write CaseMem method
Express::WriteMethodStamp(anOS, "CaseMem");
anOS << "Standard_Integer " << aCPPName
<< "::CaseMem (const Handle(StepData_SelectMember)& theEnt) const\n"
"{\n"
" if (theEnt.IsNull()) return 0;\n";
for (int j = 1; j <= aSeqMember->Length(); j++)
{
Standard_Integer anIdx = aSeqMember->Value(j);
if (j == 1)
{
anOS << " if (theEnt->Matches (\"" << myNames->Value(anIdx)->String() << "\")) return "
<< j << ";\n";
}
else
{
anOS << " else if (theEnt->Matches (\"" << myNames->Value(anIdx)->String()
<< "\")) return " << j << ";\n";
}
}
anOS << " else return 0;\n"
"}\n";
// write NewMember method
Express::WriteMethodStamp(anOS, "NewMember");
anOS << "Handle(StepData_SelectMember) " << aCPPName
<< "::NewMember() const\n"
"{\n"
" return new "
<< aCPPName
<< "Member;\n"
"}\n";
}
// write methods Get for entities.
for (Standard_Integer i = 1; i <= aSeqEntities->Length(); i++)
{
Standard_Integer anIdx = aSeqEntities->Value(i);
Handle(Express_Item) anItem = myItems->Value(anIdx);
const TCollection_AsciiString& aName = anItem->Name();
const TCollection_AsciiString& anItemCPPName = anItem->CPPName();
Express::WriteMethodStamp(anOS, aName);
anOS << "Handle(" << anItemCPPName << ") " << aCPPName << "::" << aName
<< "() const\n"
"{\n"
" return Handle("
<< anItemCPPName
<< ")::DownCast(Value());\n"
"}\n";
}
// write methods Set and Get for Integer, Real, String and Enum
for (Standard_Integer i = 1; i <= aSeqMember->Length(); i++)
{
Standard_Integer anIdx = aSeqMember->Value(i);
Handle(Express_Item) anItem = myItems->Value(anIdx);
const TCollection_AsciiString& aName = anItem->Name();
const TCollection_AsciiString& anItemCPPName = anItem->CPPName();
TCollection_AsciiString aStamp = "Set";
aStamp += aName;
Express::WriteMethodStamp(anOS, aStamp);
Standard_Boolean isString =
(anItemCPPName.Location("HAsciiString", 1, anItemCPPName.Length()) > 0);
TCollection_AsciiString aNameFunc;
TCollection_AsciiString aFunc;
Standard_Boolean isEnum = anItem->IsKind(STANDARD_TYPE(Express_Enum));
if (!isEnum)
{
if (isString)
{
aFunc += "String";
}
else
{
aNameFunc += anItemCPPName;
aFunc = aNameFunc;
Standard_Integer aSplitInd = aNameFunc.Location("_", 1, anItemCPPName.Length());
if (aSplitInd)
{
aFunc = aNameFunc.Split(aSplitInd);
}
}
}
// write method set
if (isString)
{
anOS << "void " << aCPPName << "::Set" << aName << " (const Handle(" << anItemCPPName
<< ") &theVal)\n";
}
else
{
anOS << "void " << aCPPName << "::Set" << aName << " (const " << anItemCPPName
<< " theVal)\n";
}
anOS << "{\n"
" Handle("
<< aCPPName << "Member) SelMem = Handle(" << aCPPName
<< "Member)::DownCast(Value());\n"
" if (SelMem.IsNull()) return;\n"
" Handle(TCollection_HAsciiString) aName = new TCollection_HAsciiString(\""
<< aName
<< "\");\n"
" SelMem->SetName (aName->ToCString());\n";
if (isEnum)
{
anOS << " SelMem->SetEnum ((Standard_Integer)theVal);\n";
}
else if (isString)
{
anOS << " SelMem->Set" << aFunc << " (theVal->ToCString());\n";
}
else
{
anOS << " SelMem->Set" << aFunc << " (theVal);\n";
}
anOS << "}\n";
// write method get
Express::WriteMethodStamp(anOS, aName);
if (isString)
{
anOS << "Handle(" << anItemCPPName << ") " << aCPPName << "::" << aName << "() const\n";
}
else
{
anOS << anItemCPPName << " " << aCPPName << "::" << aName << "() const\n";
}
anOS << "{\n"
" Handle("
<< aCPPName << "Member) SelMem = Handle(" << aCPPName
<< "Member)::DownCast (Value());\n"
" if (SelMem.IsNull()) return 0;\n"
" Handle(TCollection_HAsciiString) aName = new TCollection_HAsciiString;\n"
" aName->AssignCat (SelMem->Name());\n"
" Handle(TCollection_HAsciiString) aNameItem = new TCollection_HAsciiString(\""
<< aName
<< "\");\n"
" if (aName->IsDifferent (aNameItem)) return 0;\n";
if (isEnum)
{
anOS << " Standard_Integer aNumIt = SelMem->Enum();\n"
" "
<< anItemCPPName
<< " aVal;\n"
" switch (aNumIt)\n"
" {\n";
Handle(Express_Enum) anEnum = Handle(Express_Enum)::DownCast(anItem);
Handle(TColStd_HSequenceOfHAsciiString) anEnItems = anEnum->Names();
TCollection_AsciiString aPrefix = Express::EnumPrefix(aName);
for (Standard_Integer k = 1; k <= anEnItems->Length(); k++)
{
anOS << " case " << k << " : aVal = " << aName << "_" << aPrefix
<< anEnItems->Value(k)->String() << "; break;\n";
}
anOS << " default : return 0; break;\n"
" }\n";
}
else if (isString)
{
anOS << " Handle(TCollection_HAsciiString) aVal = new TCollection_HAsciiString;\n"
" aVal->AssignCat (SelMem->String());\n";
}
else
{
anOS << " " << anItemCPPName << " aVal = SelMem->" << aFunc << "();\n";
}
anOS << " return aVal;\n"
"}\n";
}
aStreamPtr.reset();
}
return Standard_True;
}
//=================================================================================================
void Express_Select::PropagateUse() const
{
const TCollection_AsciiString& aPack = GetPackageName();
const TCollection_AsciiString& aName = Name();
for (Standard_Integer i = 1; i <= myItems->Length(); i++)
{
Handle(Express_Item) anItem = myItems->Value(i);
anItem->Use2(aName, aPack);
}
}
//=================================================================================================
Standard_Boolean Express_Select::generateSelectMember(
const Handle(TColStd_HSequenceOfInteger)& theSeqMember) const
{
TCollection_AsciiString aCPPname = CPPName();
aCPPname += "Member";
// create a package directory (if not yet exist)
OSD_Protection aProt(OSD_RWXD, OSD_RWXD, OSD_RX, OSD_RX);
TCollection_AsciiString aPack = GetPackageName();
OSD_Path aPath(aPack);
OSD_Directory aDir(aPath);
aDir.Build(aProt);
aPack += "/";
aPack += aCPPname;
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
// Step 1: generating HXX
{
// Open HXX file
std::shared_ptr<std::ostream> aStreamPtr =
aFileSystem->OpenOStream(aPack.Cat(".hxx"), std::ios::out | std::ios::binary);
Standard_OStream& anOS = *aStreamPtr;
// write header
Express::WriteFileStamp(anOS);
// write start define
anOS << "#ifndef _" << aCPPname
<< "_HeaderFile\n"
"#define _"
<< aCPPname
<< "_HeaderFile\n"
"\n";
// includes
anOS << "#include <Standard.hxx>\n"
"#include <Standard_Type.hxx>\n"
"#include <Standard_Boolean.hxx>\n"
"#include <Standard_CString.hxx>\n"
"#include <Standard_Integer.hxx>\n"
"#include <StepData_SelectNamed.hxx>\n"
"\n"
"DEFINE_STANDARD_HANDLE("
<< aCPPname
<< ", StepData_SelectNamed)\n"
"\n";
// write start of declaration (inheritance)
anOS << " //! Representation of member for STEP SELECT type " << Name()
<< "\n"
"class "
<< aCPPname
<< " : public StepData_SelectNamed\n"
"{\n"
"public:\n";
// write methods
anOS << " //! Empty constructor\n"
" Standard_EXPORT "
<< aCPPname
<< "();\n"
"\n"
" //! Returns True if has name\n"
" Standard_EXPORT virtual Standard_Boolean HasName() const Standard_OVERRIDE;\n"
"\n"
" //! Returns name\n"
" Standard_EXPORT virtual Standard_CString Name() const Standard_OVERRIDE;\n"
"\n"
" //! Set name\n"
" Standard_EXPORT virtual Standard_Boolean SetName(const Standard_CString name) "
"Standard_OVERRIDE;\n"
"\n"
" //! Tells if the name of a SelectMember matches a given one;\n"
" Standard_EXPORT virtual Standard_Boolean Matches (const Standard_CString name) "
"const Standard_OVERRIDE;\n"
"\n";
// write fields
anOS << "private:\n"
" Standard_Integer myCase;\n"
"\n";
// write end
anOS << "};\n"
"#endif // _"
<< aCPPname << "_HeaderFile\n";
aStreamPtr.reset();
}
//===============================
// Step 2: generating CXX
{
// Open CXX file
std::shared_ptr<std::ostream> aStreamPtr =
aFileSystem->OpenOStream(aPack.Cat(".cxx"), std::ios::out | std::ios::binary);
Standard_OStream& anOS = *aStreamPtr;
// write header
Express::WriteFileStamp(anOS);
// write include section
anOS << "#include <" << aCPPname
<< ".hxx>\n"
"#include <TCollection_HAsciiString.hxx>\n";
// write constructor
Express::WriteMethodStamp(anOS, aCPPname);
anOS << aCPPname << "::" << aCPPname
<< "() : myCase(0) \n"
"{\n"
"}\n";
// write method HasName
Express::WriteMethodStamp(anOS, "HasName");
anOS << "Standard_Boolean " << aCPPname
<< "::HasName() const\n"
"{\n"
" return myCase > 0;\n"
"}\n";
Standard_Boolean hasEnum = Standard_False;
// write method Name
Express::WriteMethodStamp(anOS, "Name");
anOS << "Standard_CString " << aCPPname
<< "::Name() const\n"
"{\n"
" Handle(TCollection_HAsciiString) aName = new TCollection_HAsciiString;\n"
" switch (myCase)"
" {\n";
for (Standard_Integer i = 1; i <= theSeqMember->Length(); i++)
{
Standard_Integer anIdx = theSeqMember->Value(i);
Handle(Express_Item) anItem = myItems->Value(anIdx);
if (anItem->IsKind(STANDARD_TYPE(Express_Enum)))
{
hasEnum = Standard_True;
}
anOS << " case " << i << " : aName->AssignCat (\"" << myNames->Value(anIdx)->String()
<< "\"); break;\n";
}
anOS << " default : break;\n"
" }\n"
" return aName->String();\n"
"}\n";
// write static method for compare name
Express::WriteMethodStamp(anOS, "CompareNames");
anOS << "static Standard_Integer CompareNames (const Standard_CString theName";
if (hasEnum)
{
anOS << ", Standard_Integer &theNumEn)\n";
}
else
{
anOS << ")\n";
}
anOS << "{\n"
" Standard_Integer aCase = 0;\n"
" if (!theName || theName[0] == \'/0\') aCase = 0;\n";
for (Standard_Integer i = 1; i <= theSeqMember->Length(); i++)
{
Standard_Integer anIdx = theSeqMember->Value(i);
Handle(Express_Item) anItem = myItems->Value(anIdx);
if (anItem->IsKind(STANDARD_TYPE(Express_Enum)))
{
Handle(Express_Enum) en = Handle(Express_Enum)::DownCast(anItem);
for (Standard_Integer k = 1; k <= en->Names()->Length(); k++)
{
anOS << " else if (!strcmp (theName, \"" << en->Names()->Value(k)->String()
<< "\"))\n"
" {\n"
" aCase = "
<< i
<< ";\n"
" theNumEn = "
<< k
<< ";\n"
" }\n";
}
}
else
{
anOS << " else if (!strcmp (theName, \"" << myNames->Value(anIdx)->String()
<< "\")) aCase = " << i << ";\n";
}
}
anOS << " return aCase;\n"
"}\n";
// write method SetName
Express::WriteMethodStamp(anOS, "SetName");
anOS << "Standard_Boolean " << aCPPname
<< "::SetName (const Standard_CString theName) \n"
"{\n";
if (hasEnum)
{
anOS << " Standard_Integer aNumIt = 0;\n"
" myCase = CompareNames (theName, aNumIt);\n"
" if (aNumIt) SetInteger (aNumIt);\n";
}
else
{
anOS << " myCase = CompareNames (theName);\n";
}
anOS << " return (myCase > 0);\n"
"}\n";
// write method Matches
Express::WriteMethodStamp(anOS, "Matches");
anOS << "Standard_Boolean " << aCPPname
<< "::Matches (const Standard_CString theName) const\n"
"{\n";
if (hasEnum)
{
anOS << " Standard_Integer aNumIt = 0;\n"
" Standard_Integer aCase = CompareNames (theName, aNumIt);\n";
}
else
{
anOS << " Standard_Integer aCase = CompareNames (theName);\n";
}
anOS << " return (aCase > 0);\n"
"}\n";
aStreamPtr.reset();
}
return Standard_True;
}

View File

@ -1,60 +0,0 @@
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Express_Select_HeaderFile
#define _Express_Select_HeaderFile
#include <Standard_Type.hxx>
#include <Express_Item.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_CString.hxx>
#include <TColStd_HSequenceOfHAsciiString.hxx>
#include <TColStd_HSequenceOfInteger.hxx>
class Express_HSequenceOfItem;
//! Implements TYPE SELECT item of the EXPRESS
//! schema, with interface for deferred Item class.
class Express_Select : public Express_Item
{
public:
//! Create SELECT item and initialize it
Standard_EXPORT Express_Select(const Standard_CString theName,
const Handle(TColStd_HSequenceOfHAsciiString)& theNames);
//! Returns names of types included in this SELECT
Standard_EXPORT const Handle(TColStd_HSequenceOfHAsciiString)& Names() const;
//! Returns sequence of items corresponding to typenames
Standard_EXPORT const Handle(Express_HSequenceOfItem)& Items() const;
//! Create HXX/CXX files from item
Standard_EXPORT virtual Standard_Boolean GenerateClass() const Standard_OVERRIDE;
//! Propagates the calls of Use function
Standard_EXPORT virtual void PropagateUse() const Standard_OVERRIDE;
DEFINE_STANDARD_RTTIEXT(Express_Select, Express_Item)
protected:
private:
Standard_EXPORT Standard_Boolean
generateSelectMember(const Handle(TColStd_HSequenceOfInteger)& theSeqMember) const;
Handle(TColStd_HSequenceOfHAsciiString) myNames;
Handle(Express_HSequenceOfItem) myItems;
};
#endif // _Express_Select_HeaderFile

View File

@ -1,22 +0,0 @@
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef Express_SequenceOfEntity_HeaderFile
#define Express_SequenceOfEntity_HeaderFile
#include <Express_Entity.hxx>
#include <NCollection_Sequence.hxx>
typedef NCollection_Sequence<Handle(Express_Entity)> Express_SequenceOfEntity;
#endif

View File

@ -1,22 +0,0 @@
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef Express_SequenceOfField_HeaderFile
#define Express_SequenceOfField_HeaderFile
#include <Express_Field.hxx>
#include <NCollection_Sequence.hxx>
typedef NCollection_Sequence<Handle(Express_Field)> Express_SequenceOfField;
#endif

View File

@ -1,22 +0,0 @@
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef Express_SequenceOfItem_HeaderFile
#define Express_SequenceOfItem_HeaderFile
#include <Express_Item.hxx>
#include <NCollection_Sequence.hxx>
typedef NCollection_Sequence<Handle(Express_Item)> Express_SequenceOfItem;
#endif

View File

@ -1,21 +0,0 @@
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Express_Set_HeaderFile
#define _Express_Set_HeaderFile
#include <Express_ComplexType.hxx>
typedef Express_ComplexType Express_Set;
#endif // _Express_Set_HeaderFile

View File

@ -1,37 +0,0 @@
// Created: Tue Nov 2 15:27:26 1999
// Author: Andrey BETENEV
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Express_String.hxx>
#include <TCollection_AsciiString.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Express_String, Express_PredefinedType)
//=================================================================================================
Express_String::Express_String() {}
//=================================================================================================
const TCollection_AsciiString Express_String::CPPName() const
{
return "TCollection_HAsciiString";
}
//=================================================================================================
Standard_Boolean Express_String::IsStandard() const
{
return Standard_False;
}

View File

@ -1,42 +0,0 @@
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Express_String_HeaderFile
#define _Express_String_HeaderFile
#include <Express_PredefinedType.hxx>
#include <Standard_Type.hxx>
class TCollection_AsciiString;
//! Implements EXPRESS type 'STRING'
class Express_String : public Express_PredefinedType
{
public:
//! Empty constructor
Standard_EXPORT Express_String();
//! Returns "TCollection_HAsciiString"
Standard_EXPORT virtual const TCollection_AsciiString CPPName() const Standard_OVERRIDE;
//! Returns False
Standard_EXPORT virtual Standard_Boolean IsStandard() const Standard_OVERRIDE;
DEFINE_STANDARD_RTTIEXT(Express_String, Express_PredefinedType)
protected:
private:
};
#endif // _Express_String_HeaderFile

View File

@ -1,54 +0,0 @@
// Created: Tue Nov 2 15:11:36 1999
// Author: Andrey BETENEV
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Express_Type.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Express_Type, Standard_Transient)
//=================================================================================================
Express_Type::Express_Type() {}
//=================================================================================================
Standard_Boolean Express_Type::IsStandard() const
{
return Standard_False;
}
//=================================================================================================
Standard_Boolean Express_Type::IsSimple() const
{
return IsStandard();
}
//=================================================================================================
Standard_Boolean Express_Type::IsHandle() const
{
return !IsSimple();
}
//=================================================================================================
Standard_Boolean Express_Type::Use() const
{
return Standard_False;
}
//=================================================================================================
void Express_Type::Use2(const TCollection_AsciiString&, const TCollection_AsciiString&) const {}

View File

@ -1,61 +0,0 @@
// Copyright (c) 1999-2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Express_Type_HeaderFile
#define _Express_Type_HeaderFile
#include <Standard_Type.hxx>
class TCollection_AsciiString;
//! Provides basis for identification (reference) to some type
//! in express schema
class Express_Type : public Standard_Transient
{
public:
//! Returns CPP-style name of the type
Standard_EXPORT virtual const TCollection_AsciiString CPPName() const = 0;
//! Return True if type is defined in package Standard (False by default)
Standard_EXPORT virtual Standard_Boolean IsStandard() const;
//! Return True if type is simple (not a class)
//! (by default returns IsStandard())
Standard_EXPORT virtual Standard_Boolean IsSimple() const;
//! Return True if type is Transient
//! (by default returns ! IsSimple())
Standard_EXPORT virtual Standard_Boolean IsHandle() const;
//! Declares type as used by some item being generated.
//! Calls Use() for all referred types and schema items.
//! Default instantiation does nothing
Standard_EXPORT virtual Standard_Boolean Use() const;
//! Declares type as used by some item being generated.
//! Calls Use() for all referred types and schema items.
//! Default instantiation does nothing
Standard_EXPORT virtual void Use2(const TCollection_AsciiString& theRefName,
const TCollection_AsciiString& theRefPack) const;
DEFINE_STANDARD_RTTIEXT(Express_Type, Standard_Transient)
protected:
//! Empty constructor
Standard_EXPORT Express_Type();
private:
};
#endif // _Express_Type_HeaderFile

View File

@ -1,48 +0,0 @@
Express.cxx
Express.hxx
Express_Alias.cxx
Express_Alias.hxx
Express_Array.hxx
Express_Bag.hxx
Express_Boolean.cxx
Express_Boolean.hxx
Express_ComplexType.cxx
Express_ComplexType.hxx
Express_DataMapOfAsciiStringItem.hxx
Express_Entity.cxx
Express_Entity.hxx
Express_Enum.cxx
Express_Enum.hxx
Express_Field.cxx
Express_Field.hxx
Express_HSequenceOfEntity.hxx
Express_HSequenceOfField.hxx
Express_HSequenceOfItem.hxx
Express_Integer.cxx
Express_Integer.hxx
Express_Item.cxx
Express_Item.hxx
Express_List.hxx
Express_Logical.cxx
Express_Logical.hxx
Express_NamedType.cxx
Express_NamedType.hxx
Express_Number.hxx
Express_PredefinedType.cxx
Express_PredefinedType.hxx
Express_Real.cxx
Express_Real.hxx
Express_Reference.cxx
Express_Reference.hxx
Express_Schema.cxx
Express_Schema.hxx
Express_Select.cxx
Express_Select.hxx
Express_SequenceOfEntity.hxx
Express_SequenceOfField.hxx
Express_SequenceOfItem.hxx
Express_Set.hxx
Express_String.cxx
Express_String.hxx
Express_Type.cxx
Express_Type.hxx

View File

@ -1,3 +1,2 @@
Express
Expr
ExprIntrp
ExprIntrp