Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
698b9e0371 | ||
|
|
a33cba8cef | ||
|
|
8808a38a2e | ||
|
|
76adc60ac3 | ||
|
|
3275d36d80 | ||
|
|
17cec63877 | ||
|
|
5f39d9a466 | ||
|
|
363a82e6a8 | ||
|
|
598e91a092 | ||
|
|
e313f9b3a0 | ||
|
|
ee13526af5 | ||
|
|
58e340b36c | ||
|
|
f5787c6225 | ||
|
|
4dc0e38c99 | ||
|
|
1131c3042f | ||
|
|
71c90857ed | ||
|
|
7e5c20ea92 | ||
|
|
891589683f | ||
|
|
94b2dde59c | ||
|
|
b8275218a8 | ||
|
|
b4458bbe79 | ||
|
|
2dcfaedae2 | ||
|
|
ae8d48481a | ||
|
|
f049631f70 | ||
|
|
217dd34edf | ||
|
|
bda4c94ed7 | ||
|
|
b2dd22cc84 | ||
|
|
004235d0c2 | ||
|
|
803323549e | ||
|
|
754ae304fa | ||
|
|
78916d9b4d | ||
|
|
bad745c9b9 | ||
|
|
da91e9735c | ||
|
|
758a45089e | ||
|
|
3df1d1ccce | ||
|
|
f125079519 | ||
|
|
7be54f3fec | ||
|
|
b72eea6fac | ||
|
|
9ca98fc4ce | ||
|
|
c56ed86391 | ||
|
|
f4a0feb33a | ||
|
|
4527aadff6 | ||
|
|
2b46efb15f | ||
|
|
1c12e5d102 | ||
|
|
278e45caa7 | ||
|
|
a9c64bc448 | ||
|
|
261ae1d67e | ||
|
|
1d34753c03 | ||
|
|
aa97040c83 | ||
|
|
c2b87f8f0b | ||
|
|
1a32be9308 | ||
|
|
52bb54d87b | ||
|
|
f9390c6f8c | ||
|
|
e421f70ce0 | ||
|
|
767a01a8f0 | ||
|
|
5af38feaa7 | ||
|
|
2067e48bbd | ||
|
|
883bc716ce | ||
|
|
89f8807c6e | ||
|
|
6c76d7b184 | ||
|
|
1e18361351 | ||
|
|
0bea3efca0 | ||
|
|
225180f35d | ||
|
|
6f60a8a7f9 | ||
|
|
910faf0198 | ||
|
|
dd6ef88aa1 | ||
|
|
6b1ba4aa5d | ||
|
|
5aca33785c | ||
|
|
a1d6b25e75 | ||
|
|
626bb73cb9 | ||
|
|
8a2665e980 | ||
|
|
4740f4d45c | ||
|
|
04f4c1da66 | ||
|
|
0a12237f8b | ||
|
|
c77471a5f8 | ||
|
|
a9173c8b41 | ||
|
|
521f4427ea | ||
|
|
7628642baf | ||
|
|
c446fc391b | ||
|
|
473223d831 | ||
|
|
b4cf4236f2 | ||
|
|
52635e7d8b | ||
|
|
6817e1b868 | ||
|
|
a72fa6eb86 | ||
|
|
a86b035dc7 | ||
|
|
7425e55db7 | ||
|
|
905254125e | ||
|
|
db31ea0455 | ||
|
|
7b54e23e1a | ||
|
|
c676850fab | ||
|
|
b507ee8179 | ||
|
|
347df4f231 | ||
|
|
00ad279a63 | ||
|
|
0878a6d359 | ||
|
|
77ab82b571 | ||
|
|
0a954f1976 | ||
|
|
75706a942a | ||
|
|
d8d293bbf8 | ||
|
|
3be42207ee | ||
|
|
b49d2beb6a | ||
|
|
245ff1458b | ||
|
|
010e02b7a6 | ||
|
|
c84330b26a | ||
|
|
88e09ca813 | ||
|
|
ee13cdaca3 | ||
|
|
b60f85be1d | ||
|
|
f7cde9fc20 | ||
|
|
3010afa7ea | ||
|
|
f5d0cc59aa | ||
|
|
bd320c403d | ||
|
|
e83fc64bc9 | ||
|
|
0e9cc5c6ae | ||
|
|
a215cae560 | ||
|
|
6c708845bf | ||
|
|
2e1befa0bf | ||
|
|
884949bbab | ||
|
|
ea7adb4d18 | ||
|
|
6ada55b7fe | ||
|
|
f705842bb7 | ||
|
|
c1636b4d01 | ||
|
|
0c424b4eb5 | ||
|
|
dea7f8c3a1 | ||
|
|
16e3749b8f | ||
|
|
3953a2268e | ||
|
|
5f1465e4e6 | ||
|
|
f3eab5d91a | ||
|
|
7f588a64cf | ||
|
|
38d2a49967 | ||
|
|
89035cdb2c | ||
|
|
16743b297b | ||
|
|
7ec9f7d8fb | ||
|
|
4e0d73d001 | ||
|
|
7ce8bcbefb | ||
|
|
4d6d249dad | ||
|
|
82c84e7337 | ||
|
|
4d68ec0b19 | ||
|
|
69e0813cf7 | ||
|
|
d0e2c156a1 | ||
|
|
b84921e9d8 | ||
|
|
d3418ed48c | ||
|
|
96f5f28058 | ||
|
|
ca155ce50d | ||
|
|
1bbbc219ba | ||
|
|
59cf7ec1ed | ||
|
|
f053df82db | ||
|
|
8cad6ec2aa | ||
|
|
5f345c700e | ||
|
|
37594fc4a2 | ||
|
|
d6da97ec30 | ||
|
|
5f88f509b2 | ||
|
|
d87d07a26c | ||
|
|
50b9032d32 | ||
|
|
d56795946c | ||
|
|
117ba3972f | ||
|
|
8595a291cb | ||
|
|
ee78ba9c52 | ||
|
|
575c77dda9 | ||
|
|
bd9942dc36 | ||
|
|
10999e7a48 | ||
|
|
becb8405ba | ||
|
|
dca5e0c843 | ||
|
|
47ecd2088f | ||
|
|
1cc2774b52 | ||
|
|
f12e16b3a7 | ||
|
|
ee689a10e1 | ||
|
|
3fd222218f | ||
|
|
212c11453e | ||
|
|
92d83ef14a | ||
|
|
950407a067 | ||
|
|
fb79eb2183 | ||
|
|
572e9adc0b | ||
|
|
ac702af7f3 | ||
|
|
c316f21fe6 | ||
|
|
14926414c3 | ||
|
|
260fd55f10 | ||
|
|
d94a44944b | ||
|
|
2be1cc40be | ||
|
|
809e1dd495 | ||
|
|
3aee5f353c | ||
|
|
6e6fb8197c | ||
|
|
235b1e6ca3 | ||
|
|
e99240a780 | ||
|
|
ca0824dd0d | ||
|
|
5dc04396ad | ||
|
|
3e8c11661d | ||
|
|
a63ac738af | ||
|
|
7a6ba24f81 | ||
|
|
1481950409 | ||
|
|
0073b386ef | ||
|
|
2d7ed17697 | ||
|
|
ffdeac2552 | ||
|
|
8dcfec46c9 | ||
|
|
14985062f7 | ||
|
|
e9e576e4f8 | ||
|
|
fad0cf4b3d | ||
|
|
4cd7e7c806 | ||
|
|
22cbb3efcf | ||
|
|
c415e49894 | ||
|
|
064a2b41b5 | ||
|
|
fffaba61f2 | ||
|
|
4ab01a7773 | ||
|
|
873a86de8b | ||
|
|
3a9fa997b3 | ||
|
|
2d26da7d24 | ||
|
|
c0c423c625 | ||
|
|
555a574eef | ||
|
|
82898d74a4 | ||
|
|
09f347234b | ||
|
|
3ce06bce27 | ||
|
|
e7d3c2a075 | ||
|
|
e1b374a7d6 | ||
|
|
33c66b0954 | ||
|
|
eb61193bcf | ||
|
|
2535a4f8b2 | ||
|
|
ed76f0b625 | ||
|
|
f3a82debec | ||
|
|
1da31f6501 | ||
|
|
67f8897429 | ||
|
|
81b82cdd24 | ||
|
|
28a988854f | ||
|
|
e36a1a69bd | ||
|
|
defd675944 | ||
|
|
ec97362602 | ||
|
|
586b8f8996 | ||
|
|
c1b57435b2 | ||
|
|
2b0da3fd41 | ||
|
|
15f9c40c54 | ||
|
|
0aa9b5dd97 | ||
|
|
97ef6d97ed | ||
|
|
d0293fd0c7 | ||
|
|
355f08f50e | ||
|
|
f688f2a0c9 | ||
|
|
07ed8f6968 | ||
|
|
993167ede1 | ||
|
|
870edbffa8 | ||
|
|
0f3b6262cd | ||
|
|
03fd892382 | ||
|
|
7712b9bb23 | ||
|
|
dcdd77a49d | ||
|
|
166425a9b8 | ||
|
|
ca4940e6e9 | ||
|
|
3156ea7fb6 | ||
|
|
2179c8a83b | ||
|
|
80208dcdd6 | ||
|
|
737c53ef28 | ||
|
|
ae9dbbd70e | ||
|
|
4ddce869b2 | ||
|
|
3bff65bc9b | ||
|
|
81dc369b03 | ||
|
|
388901d20c | ||
|
|
90dc1d6592 | ||
|
|
d0a425f403 | ||
|
|
2647e16a53 | ||
|
|
0869e41b28 | ||
|
|
5e9dfd7e94 | ||
|
|
dc302ea085 | ||
|
|
c771b270f3 | ||
|
|
5c8c5aaca6 | ||
|
|
2e01a01bf5 | ||
|
|
0705c500a5 | ||
|
|
c409145b25 | ||
|
|
457d51e303 | ||
|
|
69acdf329d | ||
|
|
c3f9ff563f | ||
|
|
d6b1570894 | ||
|
|
f853b997d7 | ||
|
|
ba12196a88 | ||
|
|
879f5092b7 | ||
|
|
6226717d18 | ||
|
|
784285605e | ||
|
|
71bd7b235a | ||
|
|
13204e4027 | ||
|
|
48dff49299 | ||
|
|
3ed8797097 | ||
|
|
a13ba2152a | ||
|
|
ed8474e132 | ||
|
|
da0a395c2d | ||
|
|
0bb182b4e7 | ||
|
|
1cfb41d6b3 | ||
|
|
65791a2812 | ||
|
|
ca50d5352f | ||
|
|
cb35164af7 | ||
|
|
88e9634541 | ||
|
|
e54780743a | ||
|
|
6aa4695322 | ||
|
|
deb55618fe | ||
|
|
c4dd81a0bc | ||
|
|
402225e3e8 | ||
|
|
73cc97f8ff | ||
|
|
86b9f12098 | ||
|
|
d6aa13f4b2 | ||
|
|
93678232d8 | ||
|
|
04d29c0bfb | ||
|
|
4dc08910c6 | ||
|
|
4c5a8e038d | ||
|
|
d06753403c | ||
|
|
d35f73f87f | ||
|
|
d190a1e042 | ||
|
|
dc30ee21fd | ||
|
|
fa615a1786 | ||
|
|
59349657da | ||
|
|
dbdf7a99f1 | ||
|
|
ee908d69ed | ||
|
|
d2e40ddf91 | ||
|
|
c6bc7ec185 | ||
|
|
f491d500a6 | ||
|
|
3ed94ababd | ||
|
|
96fdcf9e54 | ||
|
|
dd4538ce50 | ||
|
|
373d415a07 | ||
|
|
de3495d03f | ||
|
|
6871bc4eca | ||
|
|
6b95067732 | ||
|
|
99abb18825 | ||
|
|
c4971681e5 | ||
|
|
b277759f58 | ||
|
|
88a1229a23 | ||
|
|
c987ad03d2 | ||
|
|
6418c44e30 | ||
|
|
d4517fbe64 | ||
|
|
6d84278f86 | ||
|
|
5eeba5b34b | ||
|
|
f2cafe04ff | ||
|
|
d08ffa5eb4 | ||
|
|
89055ea452 | ||
|
|
d0c9541679 | ||
|
|
392dfc6352 | ||
|
|
157c747d18 | ||
|
|
f5a130a3b7 | ||
|
|
79e77ff65c | ||
|
|
dba8c3fd9d | ||
|
|
1faaf698fd | ||
|
|
27ce5604c2 | ||
|
|
1ad14e1334 | ||
|
|
fffd710005 | ||
|
|
770e4a885e | ||
|
|
254b5a3dfb | ||
|
|
b12562a639 | ||
|
|
db00ec914f | ||
|
|
73b69e2df6 | ||
|
|
bbaed49beb | ||
|
|
d6d7c48230 | ||
|
|
995c19d6da | ||
|
|
aef6e73a60 | ||
|
|
b8fc557543 | ||
|
|
be58f09ec0 | ||
|
|
e72ca29407 | ||
|
|
da7639aa2f | ||
|
|
ec7e8ac2d1 |
@@ -13,6 +13,7 @@ Morrison, Christopher Sean (sean, morrison, brlcad)
|
||||
Paviot, Thomas (tpaviot)
|
||||
Pictor, Mark (mpictor)
|
||||
Thomas, Dawn (homovulgaris, madant)
|
||||
Wouters, Dave (davyw)
|
||||
Yapp, Clifford (starseeker)
|
||||
|
||||
Special thanks:
|
||||
|
||||
+216
-108
@@ -38,36 +38,61 @@
|
||||
# This file contains the top level CMakeLists.txt logic for the
|
||||
# SCL software package.
|
||||
|
||||
PROJECT(SCL)
|
||||
|
||||
# SCL version
|
||||
SET(SCL_VERSION_MAJOR 0)
|
||||
SET(SCL_VERSION_MINOR 5-dev)
|
||||
SET(SCL_VERSION ${SCL_VERSION_MAJOR}.${SCL_VERSION_MINOR})
|
||||
|
||||
# SCL ABI version. SCL_ABI_SOVERSION should be incremented
|
||||
# for each release introducing API incompatibilities
|
||||
SET(SCL_ABI_SOVERSION 2)
|
||||
SET(SCL_ABI_VERSION ${SCL_ABI_SOVERSION}.0.0)
|
||||
|
||||
# Minimum required version of CMake
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
||||
IF(COMMAND CMAKE_POLICY)
|
||||
CMAKE_POLICY(SET CMP0003 NEW)
|
||||
CMAKE_POLICY(SET CMP0003 NEW)
|
||||
ENDIF(COMMAND CMAKE_POLICY)
|
||||
|
||||
# set CMake project name
|
||||
PROJECT(SCL)
|
||||
IF( NOT DEFINED SCL_BUILD_TYPE )
|
||||
SET( SCL_BUILD_TYPE "Debug" CACHE STRING "Build type" ) # By default set debug build
|
||||
ENDIF( NOT DEFINED SCL_BUILD_TYPE )
|
||||
IF(NOT SCL_IS_SUBBUILD)
|
||||
SET(CMAKE_BUILD_TYPE ${SCL_BUILD_TYPE} CACHE INTERNAL "Build type, immutable" FORCE )
|
||||
ELSE(NOT SCL_IS_SUBBUILD)
|
||||
SET(CMAKE_BUILD_TYPE ${SCL_BUILD_TYPE} )
|
||||
ENDIF(NOT SCL_IS_SUBBUILD)
|
||||
|
||||
if( CMAKE_BUILD_TYPE STREQUAL "" )
|
||||
message( "Debug build - to override, rerun cmake with '-DCMAKE_BUILD_TYPE=Release'." )
|
||||
set( CMAKE_BUILD_TYPE Debug )
|
||||
endif()
|
||||
# Define helper macro OPTION_WITH_DEFAULT
|
||||
MACRO( OPTION_WITH_DEFAULT OPTION_NAME OPTION_STRING OPTION_DEFAULT )
|
||||
IF( NOT DEFINED ${OPTION_NAME} )
|
||||
SET( ${OPTION_NAME} ${OPTION_DEFAULT} )
|
||||
ENDIF( NOT DEFINED ${OPTION_NAME} )
|
||||
OPTION( ${OPTION_NAME} "${OPTION_STRING}" ${${OPTION_NAME}} )
|
||||
ENDMACRO( OPTION_WITH_DEFAULT OPTION_NAME OPTION_STRING OPTION_DEFAULT )
|
||||
|
||||
# build shared libs by default
|
||||
OPTION(BUILD_SHARED_LIBS "Build shared libraries" ON)
|
||||
OPTION_WITH_DEFAULT(SCL_BUILD_SHARED_LIBS "Build shared libs" ON )
|
||||
|
||||
# build static libs by default
|
||||
OPTION(BUILD_STATIC_LIBS "Build static libraries" OFF)
|
||||
# don't build static libs by default
|
||||
OPTION_WITH_DEFAULT(SCL_BUILD_STATIC_LIBS "Build static libs" OFF)
|
||||
|
||||
# Set version
|
||||
SET(SCL_VERSION_MAJOR "3")
|
||||
SET(SCL_VERSION_MINOR "2")
|
||||
SET(SCL_VERSION_PATCH "0")
|
||||
SET(SCL_VERSION "${SCL_VERSION_MAJOR}.${SCL_VERSION_MINOR}.${SCL_VERSION_PATCH}")
|
||||
OPTION_WITH_DEFAULT(SCL_PYTHON_GENERATOR "Compile fedex_python" ON)
|
||||
OPTION_WITH_DEFAULT(SCL_CPP_GENERATOR "Compile fedex_plus" ON)
|
||||
|
||||
OPTION_WITH_DEFAULT(SCL_MEMMGR_ENABLE_CHECKS "Enable scl_memmgr's memory leak detection" OFF)
|
||||
OPTION_WITH_DEFAULT(SCL_TRACE_FPRINTF "Enable extra comments in generated code so the code's source in fedex_plus may be located" OFF)
|
||||
|
||||
# CMake derives much of its functionality from modules, typically
|
||||
# stored in one directory - let CMake know where to find them.
|
||||
SET(SCL_CMAKE_DIR "${SCL_SOURCE_DIR}/cmake")
|
||||
SET(CMAKE_MODULE_PATH "${SCL_CMAKE_DIR};${CMAKE_MODULE_PATH}")
|
||||
if(NOT IS_SUBBUILD)
|
||||
SET(CMAKE_MODULE_PATH "${SCL_CMAKE_DIR};${CMAKE_MODULE_PATH}")
|
||||
else(NOT IS_SUBBUILD)
|
||||
SET(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${SCL_CMAKE_DIR}")
|
||||
endif(NOT IS_SUBBUILD)
|
||||
|
||||
INCLUDE(${SCL_CMAKE_DIR}/SCL_Utils.cmake)
|
||||
|
||||
@@ -77,92 +102,89 @@ SET(_orig_lc_all $ENV{LC_ALL})
|
||||
SET(_orig_lc_messages $ENV{LC_MESSAGES})
|
||||
SET(_orig_lang $ENV{LANG})
|
||||
IF(_orig_lc_all)
|
||||
SET(ENV{LC_ALL} C)
|
||||
SET(ENV{LC_ALL} C)
|
||||
ENDIF(_orig_lc_all)
|
||||
IF(_orig_lc_messages)
|
||||
SET(ENV{LC_MESSAGES} C)
|
||||
SET(ENV{LC_MESSAGES} C)
|
||||
ENDIF(_orig_lc_messages)
|
||||
IF(_orig_lang)
|
||||
SET(ENV{LANG} C)
|
||||
SET(ENV{LANG} C)
|
||||
ENDIF(_orig_lang)
|
||||
|
||||
# For NFS volumes, to ensure proper file creation.
|
||||
IF(NOT WIN32)
|
||||
IF(NOT UMASK)
|
||||
EXEC_PROGRAM(umask ARGS 022 OUTPUT_VARIABLE exec_out)
|
||||
ELSE(NOT UMASK)
|
||||
EXEC_PROGRAM(umask ARGS ${UMASK} OUTPUT_VARIABLE exec_out)
|
||||
ENDIF(NOT UMASK)
|
||||
ENDIF(NOT WIN32)
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
# Testing option
|
||||
OPTION( ENABLE_TESTING "Enable unittesting framework" OFF )
|
||||
IF(ENABLE_TESTING)
|
||||
set( CMAKE_EXE_LINKER_FLAGS "-fprofile-arcs -ftest-coverage" ) #for code coverage
|
||||
set( CMAKE_SHARED_LINKER_FLAGS "-fprofile-arcs -ftest-coverage" )
|
||||
if( NOT DEFINED BUILD_SCHEMAS )
|
||||
set( BUILD_SCHEMAS "ALL" ) #test all schemas, unless otherwise specified
|
||||
endif()
|
||||
INCLUDE(CTest)
|
||||
ENABLE_TESTING()
|
||||
SUBDIRS(test)
|
||||
ENDIF(ENABLE_TESTING)
|
||||
OPTION_WITH_DEFAULT( SCL_ENABLE_TESTING "Enable unittesting framework" OFF )
|
||||
IF(SCL_ENABLE_TESTING)
|
||||
if( NOT DEFINED SCL_BUILD_SCHEMAS )
|
||||
set( SCL_BUILD_SCHEMAS "ALL" ) #test all schemas, unless otherwise specified
|
||||
endif()
|
||||
INCLUDE(CTest)
|
||||
ENABLE_TESTING()
|
||||
ENDIF(SCL_ENABLE_TESTING)
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
# The following logic is what allows binaries to run successfully in
|
||||
# the build directory AND install directory. Thanks to plplot for
|
||||
# Coverage option
|
||||
OPTION_WITH_DEFAULT( SCL_ENABLE_COVERAGE "Enable code coverage test" OFF )
|
||||
IF(SCL_ENABLE_COVERAGE)
|
||||
SET(SCL_ENABLE_TESTING ON CACHE BOOL "Testing enabled by coverage option" FORCE)
|
||||
# build static libs, better coverage report
|
||||
SET(SCL_BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libs" FORCE )
|
||||
SET(SCL_BUILD_STATIC_LIBS ON CACHE BOOL "Build static libs" FORCE )
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -fprofile-arcs -ftest-coverage" CACHE STRING "Extra compile flags required by code coverage" FORCE)
|
||||
SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -fprofile-arcs -ftest-coverage" CACHE STRING "Extra compile flags required by code coverage" FORCE)
|
||||
SET(CMAKE_MODULE_LINKER_FLAGS_DEBUG "-fprofile-arcs -ftest-coverage" CACHE STRING "Extra linker flags required by code coverage" FORCE)
|
||||
SET(SCL_BUILD_TYPE "Debug" CACHE STRING "Build type required by testing framework" FORCE)
|
||||
ENDIF(SCL_ENABLE_COVERAGE)
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
# The following logic is what allows binaries to run successfully in
|
||||
# the build directory AND install directory. Thanks to plplot for
|
||||
# identifying the necessity of setting CMAKE_INSTALL_NAME_DIR on OSX.
|
||||
# Documentation of these options is available at
|
||||
# http://www.cmake.org/Wiki/CMake_RPATH_handling
|
||||
|
||||
# use, i.e. don't skip the full RPATH for the build tree
|
||||
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
|
||||
set(CMAKE_SKIP_BUILD_RPATH FALSE)
|
||||
|
||||
# when building, don't use the install RPATH already
|
||||
# (but later on when installing)
|
||||
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
||||
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
||||
|
||||
# the RPATH/INSTALL_NAME_DIR to be used when installing
|
||||
if (NOT APPLE)
|
||||
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
|
||||
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib:\$ORIGIN/../lib")
|
||||
endif(NOT APPLE)
|
||||
SET(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
|
||||
# On OSX, we need to set INSTALL_NAME_DIR instead of RPATH
|
||||
# http://www.cmake.org/cmake/help/cmake-2-8-docs.html#variable:CMAKE_INSTALL_NAME_DIR
|
||||
set(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
|
||||
|
||||
# add the automatically determined parts of the RPATH which point to
|
||||
# add the automatically determined parts of the RPATH which point to
|
||||
# directories outside the build tree to the install RPATH
|
||||
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
|
||||
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Output directories.
|
||||
IF(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
|
||||
IF(WIN32)
|
||||
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${SCL_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all libraries.")
|
||||
ELSE(WIN32)
|
||||
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${SCL_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all libraries.")
|
||||
ENDIF(WIN32)
|
||||
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${SCL_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all libraries.")
|
||||
ENDIF(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
|
||||
IF(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
|
||||
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${SCL_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all archives.")
|
||||
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${SCL_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all archives.")
|
||||
ENDIF(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
|
||||
IF(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
|
||||
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${SCL_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all executables.")
|
||||
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${SCL_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all executables.")
|
||||
ENDIF(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
|
||||
|
||||
FOREACH(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
|
||||
STRING(TOUPPER "${CFG_TYPE}" CFG_TYPE)
|
||||
IF(NOT "CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE}")
|
||||
IF(WIN32)
|
||||
SET("CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE}" ${SCL_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all libraries.")
|
||||
ELSE(WIN32)
|
||||
SET("CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE}" ${SCL_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all libraries.")
|
||||
ENDIF(WIN32)
|
||||
ENDIF(NOT "CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE}")
|
||||
IF(NOT "CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFG_TYPE}")
|
||||
SET("CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFG_TYPE}" ${SCL_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all archives.")
|
||||
ENDIF(NOT "CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFG_TYPE}")
|
||||
IF(NOT "CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE}")
|
||||
SET("CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE}" ${SCL_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all executables.")
|
||||
ENDIF(NOT "CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE}")
|
||||
STRING(TOUPPER "${CFG_TYPE}" CFG_TYPE)
|
||||
IF(NOT "CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE}")
|
||||
SET("CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE}" ${SCL_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all libraries.")
|
||||
ENDIF(NOT "CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE}")
|
||||
IF(NOT "CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFG_TYPE}")
|
||||
SET("CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFG_TYPE}" ${SCL_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all archives.")
|
||||
ENDIF(NOT "CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFG_TYPE}")
|
||||
IF(NOT "CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE}")
|
||||
SET("CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE}" ${SCL_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all executables.")
|
||||
ENDIF(NOT "CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE}")
|
||||
ENDFOREACH()
|
||||
|
||||
|
||||
@@ -172,85 +194,171 @@ ENDFOREACH()
|
||||
# The location in which to install SCL. Need a good Debug location
|
||||
# for Windows. Only do this if CMAKE_INSTALL_PREFIX hasn't been set
|
||||
# already, to try and allow parent builds (if any) some control.
|
||||
IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
IF(NOT WIN32)
|
||||
IF ("${CMAKE_BUILD_TYPE}" MATCHES "Release")
|
||||
SET(CMAKE_INSTALL_PREFIX "/usr")
|
||||
ELSEIF ("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
|
||||
MESSAGE("setting debug output dir")
|
||||
SET(CMAKE_INSTALL_PREFIX "${SCL_SOURCE_DIR}/../scl-install")
|
||||
ELSE("${CMAKE_BUILD_TYPE}" MATCHES "Release")
|
||||
SET(CMAKE_INSTALL_PREFIX "/usr/local")
|
||||
ENDIF ("${CMAKE_BUILD_TYPE}" MATCHES "Release")
|
||||
ENDIF(NOT WIN32)
|
||||
SET(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE STRING "SCL install prefix" FORCE)
|
||||
SET(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT 0)
|
||||
ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
if(NOT SCL_IS_SUBBUILD)
|
||||
IF(NOT WIN32)
|
||||
IF (${CMAKE_BUILD_TYPE} MATCHES "Debug")
|
||||
SET(SCL_INSTALL_PREFIX "${SCL_SOURCE_DIR}/../scl-install")
|
||||
ELSE()
|
||||
SET(SCL_INSTALL_PREFIX "/usr/local")
|
||||
ENDIF()
|
||||
ENDIF(NOT WIN32)
|
||||
SET( SCL_INSTALL_PREFIX ${SCL_INSTALL_PREFIX} CACHE
|
||||
PATH "Install prefix prepended to target to create install location" )
|
||||
SET( CMAKE_INSTALL_PREFIX ${SCL_INSTALL_PREFIX} CACHE INTERNAL "Prefix prepended to install directories if target destination is not absolute, immutable" FORCE )
|
||||
endif(NOT SCL_IS_SUBBUILD)
|
||||
|
||||
OPTION(SCL-BUILD_EXPRESS_ONLY "Only build express parser." OFF)
|
||||
MARK_AS_ADVANCED(SCL-BUILD_EXPRESS_ONLY)
|
||||
OPTION(SCL_BUILD_EXPRESS_ONLY "Only build express parser." OFF)
|
||||
MARK_AS_ADVANCED(SCL_BUILD_EXPRESS_ONLY)
|
||||
|
||||
# Take the scl config file template and copy it to the build directory so CMake
|
||||
# scripts can append to it if need be
|
||||
configure_file(${SCL_SOURCE_DIR}/include/scl_cf_cmake.h.in ${SCL_BINARY_DIR}/include/scl_cf.h.in COPYONLY)
|
||||
# Take the scl config file template as the starting point for
|
||||
# scl_cf.h.in - scripts may need to append to the template, so
|
||||
# it is read into memory initially.
|
||||
SET(CONFIG_H_FILE ${SCL_BINARY_DIR}/include/scl_cf.h.in)
|
||||
set(CMAKE_CURRENT_PROJECT SCL)
|
||||
define_property(GLOBAL PROPERTY SCL_CONFIG_H_CONTENTS BRIEF_DOCS "config.h.in contents" FULL_DOCS "config.h.in contents for SCL project")
|
||||
if(NOT COMMAND CONFIG_H_APPEND)
|
||||
macro(CONFIG_H_APPEND PROJECT_NAME NEW_CONTENTS)
|
||||
if(PROJECT_NAME)
|
||||
get_property(${PROJECT_NAME}_CONFIG_H_CONTENTS GLOBAL PROPERTY ${PROJECT_NAME}_CONFIG_H_CONTENTS)
|
||||
set(${PROJECT_NAME}_CONFIG_H_FILE_CONTENTS "${${PROJECT_NAME}_CONFIG_H_CONTENTS}${NEW_CONTENTS}")
|
||||
set_property(GLOBAL PROPERTY ${PROJECT_NAME}_CONFIG_H_CONTENTS "${${PROJECT_NAME}_CONFIG_H_FILE_CONTENTS}")
|
||||
endif(PROJECT_NAME)
|
||||
endmacro(CONFIG_H_APPEND NEW_CONTENTS)
|
||||
endif(NOT COMMAND CONFIG_H_APPEND)
|
||||
file(READ ${SCL_SOURCE_DIR}/include/scl_cf_cmake.h.in CONFIG_H_FILE_CONTENTS)
|
||||
CONFIG_H_APPEND(SCL "${CONFIG_H_FILE_CONTENTS}")
|
||||
|
||||
INCLUDE(CheckLibraryExists)
|
||||
INCLUDE(CheckIncludeFile)
|
||||
INCLUDE(CheckFunctionExists)
|
||||
INCLUDE(CheckTypeSize)
|
||||
INCLUDE(CMakePushCheckState)
|
||||
INCLUDE(CheckCXXSourceRuns)
|
||||
INCLUDE(${SCL_CMAKE_DIR}/FindLEX.cmake)
|
||||
INCLUDE(${SCL_CMAKE_DIR}/FindYACC.cmake)
|
||||
|
||||
CHECK_INCLUDE_FILE(ndir.h HAVE_NDIR_H)
|
||||
CHECK_INCLUDE_FILE(stdarg.h HAVE_STDARG_H)
|
||||
CHECK_INCLUDE_FILE(sys/stat.h HAVE_SYS_STAT_H)
|
||||
CHECK_INCLUDE_FILE(sys/param.h HAVE_SYS_PARAM_H)
|
||||
CHECK_INCLUDE_FILE(sysent.h HAVE_SYSENT_H)
|
||||
CHECK_INCLUDE_FILE(unistd.h HAVE_UNISTD_H)
|
||||
CHECK_INCLUDE_FILE(dirent.h HAVE_DIRENT_H)
|
||||
CHECK_INCLUDE_FILE(stdbool.h HAVE_STDBOOL_H)
|
||||
CHECK_INCLUDE_FILE(process.h HAVE_PROCESS_H)
|
||||
CHECK_INCLUDE_FILE(io.h HAVE_IO_H)
|
||||
|
||||
CHECK_FUNCTION_EXISTS(abs HAVE_ABS)
|
||||
CHECK_FUNCTION_EXISTS(memcpy HAVE_MEMCPY)
|
||||
CHECK_FUNCTION_EXISTS(memmove HAVE_MEMMOVE)
|
||||
CHECK_FUNCTION_EXISTS(getopt HAVE_GETOPT)
|
||||
|
||||
CHECK_TYPE_SIZE("ssize_t" SSIZE_T)
|
||||
|
||||
#set GIT_COMMIT_ID to the output of `git describe`
|
||||
find_package(Git)
|
||||
if(GIT_FOUND)
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags RESULT_VARIABLE res_var OUTPUT_VARIABLE GIT_COM_ID )
|
||||
if( NOT ${res_var} EQUAL 0 )
|
||||
set( GIT_COMMIT_ID "unknown (git failed!)")
|
||||
message( WARNING "Git failed (not a repo?). Build will not contain git revision info." )
|
||||
endif()
|
||||
string( REPLACE "\n" "" GIT_COMMIT_ID ${GIT_COM_ID} )
|
||||
else()
|
||||
set( GIT_COMMIT_ID "unknown (git not found!)")
|
||||
message( WARNING "Git not found. Build will not contain git revision info." )
|
||||
endif()
|
||||
set( TEST_STD_THREAD "
|
||||
#include <iostream>
|
||||
#include <thread>
|
||||
void do_work() {
|
||||
std::cout << \"thread\" << std::endl;
|
||||
}
|
||||
int main() {
|
||||
std::thread t(do_work);
|
||||
t.join();
|
||||
}
|
||||
" )
|
||||
cmake_push_check_state()
|
||||
if( UNIX )
|
||||
set( CMAKE_REQUIRED_FLAGS "-pthread -std=c++0x" )
|
||||
else( UNIX )
|
||||
# vars probably need set for MSVC11, embarcadero, etc
|
||||
endif( UNIX )
|
||||
CHECK_CXX_SOURCE_RUNS( "${TEST_STD_THREAD}" HAVE_STD_THREAD ) #quotes are *required*!
|
||||
cmake_pop_check_state()
|
||||
|
||||
# Now that all the tests are done, configure the scl_cf.h file:
|
||||
configure_file(${SCL_BINARY_DIR}/include/scl_cf.h.in ${SCL_BINARY_DIR}/include/scl_cf.h)
|
||||
get_property(CONFIG_H_FILE_CONTENTS GLOBAL PROPERTY SCL_CONFIG_H_CONTENTS)
|
||||
file(WRITE ${CONFIG_H_FILE} "${CONFIG_H_FILE_CONTENTS}")
|
||||
configure_file(${CONFIG_H_FILE} ${SCL_BINARY_DIR}/include/scl_cf.h)
|
||||
|
||||
add_definitions(
|
||||
-DHAVE_CONFIG_H -Wall
|
||||
)
|
||||
################ create scl_version_string.h, http://stackoverflow.com/questions/3780667
|
||||
# Using 'ver_string' instead of 'scl_version_string.h' is a trick to force the
|
||||
# command to always execute when the custom target is built. It works because
|
||||
# a file by that name never exists.
|
||||
configure_file(${SCL_CMAKE_DIR}/scl_version_string.cmake ${SCL_BINARY_DIR}/scl_version_string.cmake @ONLY)
|
||||
add_custom_target(version_string ALL DEPENDS ver_string )
|
||||
# creates scl_version_string.h using cmake script
|
||||
add_custom_command(OUTPUT ver_string ${CMAKE_CURRENT_BINARY_DIR}/include/scl_version_string.h
|
||||
COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${SCL_SOURCE_DIR}
|
||||
-DBINARY_DIR=${SCL_BINARY_DIR}
|
||||
-P ${SCL_BINARY_DIR}/scl_version_string.cmake)
|
||||
# scl_version_string.h is a generated file
|
||||
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/include/scl_version_string.h
|
||||
PROPERTIES GENERATED TRUE
|
||||
HEADER_FILE_ONLY TRUE )
|
||||
################
|
||||
|
||||
if(MSVC)
|
||||
# add_definitions( -Wall )
|
||||
add_definitions( -D__MSVC__ -D__WIN32__ )
|
||||
# Disable warning for preferred usage of secure functions (example strcpy should be strcpy_s, ...)
|
||||
add_definitions( -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS )
|
||||
elseif(BORLAND)
|
||||
add_definitions( -D__BORLAND__ -D__WIN32__ )
|
||||
else()
|
||||
add_definitions( -pedantic -W -Wall -Wundef -Wfloat-equal -Wshadow -Winline -Wno-long-long )
|
||||
endif()
|
||||
|
||||
include_directories(
|
||||
${SCL_SOURCE_DIR}/include
|
||||
${SCL_BINARY_DIR}/include
|
||||
)
|
||||
${SCL_SOURCE_DIR}/include
|
||||
${SCL_BINARY_DIR}/include
|
||||
)
|
||||
|
||||
ADD_SUBDIRECTORY(src/base)
|
||||
ADD_SUBDIRECTORY(src/express)
|
||||
ADD_SUBDIRECTORY(src/exppp)
|
||||
ADD_SUBDIRECTORY(src/fedex_plus)
|
||||
ADD_SUBDIRECTORY(src/fedex_python)
|
||||
ADD_SUBDIRECTORY(src/clstepcore)
|
||||
ADD_SUBDIRECTORY(src/cleditor)
|
||||
ADD_SUBDIRECTORY(src/cldai)
|
||||
ADD_SUBDIRECTORY(src/clutils)
|
||||
ADD_SUBDIRECTORY(include)
|
||||
ADD_SUBDIRECTORY(data)
|
||||
IF(SCL_ENABLE_TESTING)
|
||||
ADD_SUBDIRECTORY( test )
|
||||
ENDIF(SCL_ENABLE_TESTING)
|
||||
ADD_SUBDIRECTORY(doc)
|
||||
|
||||
# this is for testing - 'make core' builds everything that isn't generated
|
||||
add_custom_target( core )
|
||||
add_dependencies( core stepdai check-express stepeditor fedex_plus )
|
||||
|
||||
if(NOT SCL_IS_SUBBUILD)
|
||||
###############################################################################
|
||||
# SCL Packaging #
|
||||
# $make package #
|
||||
###############################################################################
|
||||
|
||||
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "STEPcode")
|
||||
SET(CPACK_SET_DESTDIR "ON")
|
||||
|
||||
SET(CPACK_PACKAGE_VERSION_MAJOR ${SCL_VERSION_MAJOR})
|
||||
SET(CPACK_PACKAGE_VERSION_MINOR ${SCL_VERSION_MINOR})
|
||||
SET(CPACK_PACKAGE_NAME SCL )
|
||||
|
||||
SET(CPACK_PACKAGE_CONTACT "SCL Developers <scl-dev@googlegroups.com>")
|
||||
INCLUDE(CPack)
|
||||
|
||||
########################################################################################
|
||||
# Uninstall code #
|
||||
# From http://www.cmake.org/Wiki/CMake_FAQ#Can_I_do_.22make_uninstall.22_with_CMake.3F #
|
||||
# ######################################################################################
|
||||
configure_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
||||
IMMEDIATE @ONLY)
|
||||
|
||||
add_custom_target(uninstall
|
||||
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
|
||||
|
||||
endif(NOT SCL_IS_SUBBUILD)
|
||||
|
||||
@@ -2,7 +2,7 @@ Modifications to the original NIST code are (C)opyright by their
|
||||
respective authors. Unless otherwise specified, they are copyright
|
||||
on the date those changes were committed to whichever repository
|
||||
they were committed to first (i.e. BRL-CAD on SourceForge.net,
|
||||
mpictor/StepClassLibrary on github, etc).
|
||||
mpictor/StepClassLibrary or stepcode/stepcode on github).
|
||||
|
||||
Modifications which were first commited to the repository on github
|
||||
are licensed under the 3-clause BSD license below. Changes committed
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
Recent changes are recorded in the publicly available repository:
|
||||
https://github.com/mpictor/StepClassLibrary
|
||||
http://github.com/stepcode/stepcode
|
||||
|
||||
This repo was moved and renamed in May 2012. Previously, it was at
|
||||
http://github.com/mpictor/StepClassLibrary
|
||||
|
||||
Some are duplicates of changes recorded in the BRL-CAD repo:
|
||||
http://brlcad.svn.sourceforge.net/viewvc/brlcad/brlcad/trunk/src/other/step/?view=log
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
INSTALL
|
||||
|
||||
This file is contains installation instructions for the
|
||||
STEP Class Library.
|
||||
This file is contains installation instructions for STEPcode.
|
||||
|
||||
These installation requires that you have the following software
|
||||
available:
|
||||
|
||||
- C and C++ compilers (only gcc has been tested recently)
|
||||
- C and C++ compilers (Tested with GCC, MSVC, Embarcadero)
|
||||
- bison, byacc, or yacc (only bison has been tested recently)
|
||||
- flex or lex (only flex has been tested recently)
|
||||
- CMake
|
||||
@@ -21,12 +20,22 @@ Installation
|
||||
* Build system uses CMake now: configure, Makefile, and all
|
||||
autotools files have been removed, as has mkProbe.
|
||||
|
||||
* To build:
|
||||
cd scl
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
make
|
||||
* Building SCL from the command prompt:
|
||||
- cd scl
|
||||
- mkdir build
|
||||
- cd build
|
||||
- cmake ..
|
||||
- make
|
||||
- make install # optional
|
||||
|
||||
* Building SCL from the GUI:
|
||||
- Run cmake-gui, set it to build in scl/build
|
||||
- Select the correct build file generator
|
||||
- Press Configure
|
||||
- Change options as necessary, configuring again afterwards
|
||||
- If there are errors, some options may not be visible until the error is resolved
|
||||
- Press Generate
|
||||
- Open the main build file using your preferred build tool
|
||||
|
||||
* Build options (append to the 'cmake ..' line):
|
||||
-DBUILD_SCHEMAS="path/to/schema.exp;path/to/schema2.exp"
|
||||
@@ -45,3 +54,16 @@ Installation
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
- this causes binaries to be built without debugging information
|
||||
- without this, cmake defaults to a Debug build
|
||||
|
||||
* Using CTest to test SCL:
|
||||
- Read the comments in run_ctest.cmake
|
||||
- (OPTIONAL) Create scl/../.SCL_CTEST_PREFS.cmake, and set variables
|
||||
in it (this file is required for CDash submission to be enabled)
|
||||
- Run tests with `ctest -S run_ctest.cmake`
|
||||
|
||||
* Using CTest to regenerate the schema matrix on the github SCL wiki:
|
||||
- Requires:
|
||||
- git
|
||||
- python
|
||||
- a clone of the git repo for the wiki at scl/../wiki-scl
|
||||
- run `ctest -S ctest_matrix.cmake`
|
||||
|
||||
@@ -1,5 +1,50 @@
|
||||
STEP Class Library ------ https://github.com/mpictor/StepClassLibrary
|
||||
STEPcode ------ http://github.com/stepcode/stepcode
|
||||
************************************************************************
|
||||
Release 0.6 (May, 2012)
|
||||
|
||||
New since v0.5:
|
||||
* Renamed from STEP Class Library to STEPcode, moved to github.com/stepcode/stepcode
|
||||
* Advances in [Python](http://github.com/stepcode/stepcode/wiki/python-generator) support (#185)
|
||||
* ABI versioning
|
||||
* Implement memory manager with reporting of memory that isn't freed,
|
||||
fix many memory leaks (#148, #160, #162, #168)
|
||||
* MSVC fixes (> 128 nested if...else - #152), etc
|
||||
* Add AP219, AP238, PDM schema, AP203a1, syntax highlighting files
|
||||
* Improvements to CMake files, mostly from Cliff @ BRL-CAD (#143, #163, #181)
|
||||
* Allow runtime bounds for aggregates (discovered with AP209e2) (#166)
|
||||
* fedex_plus fprintf's can be traced with -DSCL_TRACE_FPRINTF=ON (#176)
|
||||
************************************************************************
|
||||
Release 0.5 (Feb 23, 2012)
|
||||
|
||||
New since v0.4:
|
||||
* MSVC and Embarcadero support, along with many warning fixes
|
||||
* Experimental Python support
|
||||
* Now handles most features of EXPRESS - all included schemas,
|
||||
with the exception of AP209 CD, are parsed without error. Enums are
|
||||
now in their own dictionary. Allow indexing on aggregates, generics,
|
||||
and binaries.
|
||||
* Changes to fedex_plus that improve the generated c++ - use a
|
||||
namespace, break up large static strings, make EXPRESS multiple
|
||||
inheritance work by not printing multiple copies of inherited members.
|
||||
All schemas now compile without error, but there are numerous warnings.
|
||||
* Exchange files: handle all comments, fill in some missing attributes.
|
||||
* More cleanup of source code, more documentation in scl/doc
|
||||
* Special thanks to @davyw and @tpaviot for their large contributions
|
||||
(MSVC and Python, respectively)
|
||||
************************************************************************
|
||||
Release 0.4 (Nov 13, 2011)
|
||||
|
||||
New since v0.3:
|
||||
* Improve p21read performance by ~30%
|
||||
* Improve fedex_plus performance by ~4300% (!)
|
||||
* A variable defined in a LOCAL is not required to have a type label
|
||||
(affected ap242,210e3,209)
|
||||
* Enums and entities are allowed to have the same names
|
||||
(affected ap242,210e3,209)
|
||||
* Remove the SCLP23 macro
|
||||
http://github.com/stepcode/stepcode/wiki/changelog-v0.4
|
||||
************************************************************************
|
||||
|
||||
Release 0.3 (Oct 29, 2011)
|
||||
|
||||
What's new since v0.2?
|
||||
@@ -27,10 +72,10 @@ What's new since v0.1?
|
||||
* Add BNF files, schemas, and CAX-IF Part 21 files
|
||||
|
||||
For a detailed list of changes, see
|
||||
https://github.com/mpictor/StepClassLibrary/wiki/changelog-v0.2
|
||||
https://github.com/stepcode/stepcode/wiki/changelog-v0.2
|
||||
|
||||
For a list of closed issues, see
|
||||
https://github.com/mpictor/StepClassLibrary/issues?state=closed&milestone=2
|
||||
https://github.com/stepcode/stepcode/issues?state=closed&milestone=2
|
||||
|
||||
************************************************************************
|
||||
|
||||
@@ -53,10 +98,10 @@ What's new since the SCL 3.2 release in 1998?
|
||||
parser debug output to a specified range of lines in the schema.
|
||||
|
||||
For a detailed list of changes, see
|
||||
https://github.com/mpictor/StepClassLibrary/wiki/changelog-v0.1
|
||||
https://github.com/stepcode/stepcode/wiki/changelog-v0.1
|
||||
|
||||
For a list of closed issues, see
|
||||
https://github.com/mpictor/StepClassLibrary/issues?state=closed&milestone=1
|
||||
https://github.com/stepcode/stepcode/issues?state=closed&milestone=1
|
||||
|
||||
Pre-BRL-CAD changes:
|
||||
* Patches from http://www.statik.tu-cottbus.de/fileadmin/project_dth/scl/
|
||||
|
||||
@@ -1,63 +1,34 @@
|
||||
***********************************************************************
|
||||
Step Class Library v0.3 -- https://github.com/mpictor/StepClassLibrary
|
||||
STEPcode v0.6 -- http://github.com/stepcode/stepcode
|
||||
|
||||
* What is SCL? SCL reads ISO10303-11 EXPRESS schemas and generates
|
||||
C++ source code that can read and write Part 21 files conforming
|
||||
to that schema. SCL once worked with ObjectStore, OODB, and
|
||||
CORBA IDL - but that code has not been used in a very long time.
|
||||
We are in the process of removing this code because ObjectStore,
|
||||
CORBA, etc. are no longer part of the STEP standard.
|
||||
|
||||
* SCL is packaged along with some other tools. See
|
||||
"THE NIST STEP TOOLSET", below. In particular, Data Probe
|
||||
requires InterViews, an obsolete UI toolkit. I (mpictor) have not
|
||||
had luck building the data probe with it. It may be more productive
|
||||
to replace InterViews with a modern toolkit such as Qt. I
|
||||
expect that this would be non-trivial.
|
||||
* What is STEPcode? SC reads ISO10303-11 EXPRESS schemas and generates
|
||||
C++ source code that can read and write Part 21 files conforming
|
||||
to that schema. In addition to C++, SC includes experimental
|
||||
support for Python.
|
||||
|
||||
* Much of the work to update SCL has been done by the developers of
|
||||
BRL-CAD, and SCL was originally created at NIST in the 90's.
|
||||
* Renamed in April/May 2012: SC was formerly known as STEP Class
|
||||
Libraries, SCL for short. It was renamed because the name wasn't
|
||||
accurate: the class libraries make up only a part of the code.
|
||||
|
||||
* Build system uses only CMake now: configure, Makefile, and all
|
||||
autotools files have been removed, as has mkProbe.
|
||||
|
||||
* To build:
|
||||
cd scl
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
make
|
||||
|
||||
* Build options (append to the 'cmake ..' line):
|
||||
-DBUILD_SCHEMAS="path/to/schema.exp;path/to/schema2.exp"
|
||||
- this generates c++ for the schema, and compiles it into a
|
||||
library. Also works with directories, as long as each dir only
|
||||
has one express file.
|
||||
- multiple files/directories are separated by semicolons
|
||||
- this also builds a 'p21read' program, which reads one step file
|
||||
and writes another. It may change whitespace or remove comments;
|
||||
otherwise, the input and output files should be identical. If
|
||||
they are not identical, either the file does not match the
|
||||
schema, or SCL generated incorrect source code.
|
||||
-DBUILD_SCHEMAS=ALL
|
||||
- Added to make use of ctest easier. If BUILD_SCHEMAS == ALL,
|
||||
then CMake adds each *.exp file found in data/.
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
- this causes binaries to be built without debugging information
|
||||
- without this, cmake defaults to a Debug build
|
||||
* Much of the work to update SC has been done by the developers of
|
||||
BRL-CAD, and SC (then STEP Class Library) was originally created at
|
||||
NIST in the 90's.
|
||||
|
||||
* Using CTest to test SCL:
|
||||
- Read the comments in run_ctest.cmake
|
||||
- (OPTIONAL) Create scl/../.SCL_CTEST_PREFS.cmake, and set variables
|
||||
in it (this file is required for CDash submission to be enabled)
|
||||
- Run tests with `ctest -S run_ctest.cmake`
|
||||
* For information on changes version-by-version, see the NEWS file
|
||||
|
||||
* Building and testing SCL - see the INSTALL file
|
||||
|
||||
* For more details on the libraries and executables, see the wiki:
|
||||
http://github.com/stepcode/stepcode/wiki/About-STEPcode
|
||||
|
||||
* For license details, see the COPYING file. Summary: 3-clause BSD.
|
||||
|
||||
***********************************************************************
|
||||
|
||||
***********************************************************************
|
||||
CODING STANDARDS
|
||||
|
||||
SCL's source has been reformatted with astyle. When making changes, try
|
||||
SC's source has been reformatted with astyle. When making changes, try
|
||||
to match the current formatting. The main points are:
|
||||
|
||||
- compact (java-style) brackets:
|
||||
@@ -83,542 +54,4 @@ Download astyle from http://sourceforge.net/projects/astyle/files/astyle/
|
||||
|
||||
***********************************************************************
|
||||
|
||||
|
||||
***********************************************************************
|
||||
Notes/TODO items specific to the STEP libraries as included in BRL-CAD:
|
||||
|
||||
* Original build system has been replaced with Makefile.am and
|
||||
configure.ac files in the style of BRL-CAD's autotools build
|
||||
system.
|
||||
|
||||
* Changes have been made to src/express to get it compiling with
|
||||
the output of different versions of lex/flex/bison. These
|
||||
changes are not yet tested in terms of impact on functionality
|
||||
and should be a starting point for any debugging of EXPRESS
|
||||
parsing issues.
|
||||
|
||||
* Of the original test code, only p21read has been incorporated into
|
||||
the new build system, but they are still present in src/test
|
||||
|
||||
* Express and exppp header files have been relocated to subdirectories
|
||||
in include. The names of the library files being built have been
|
||||
altered, and clstepcore and cleditor now build as separate libraries.
|
||||
|
||||
* Numerous minor changes have been made, mostly including stdlib
|
||||
and other required files.
|
||||
|
||||
***********************************************************************
|
||||
|
||||
|
||||
=====================================================
|
||||
Much has changed since README.scl was written.
|
||||
However, it is reproduced in its entirety below.
|
||||
=====================================================
|
||||
|
||||
README.scl (top level README) February 1998
|
||||
|
||||
THE NIST STEP TOOLSET
|
||||
=====================
|
||||
|
||||
Included in this release of the NIST STEP Toolset are
|
||||
|
||||
STEP Class Library (SCL)
|
||||
fedex_plus
|
||||
fedex_idl
|
||||
fedex_os
|
||||
Data Probe application
|
||||
Part 21 Reader application
|
||||
mkProbe script
|
||||
NIST EXPRESS Toolkit
|
||||
NIST EXPRESS Pretty Printing Toolkit
|
||||
|
||||
The focus of our work since our last release has been on developing a
|
||||
reference implementation of the binding of EXPRESS to C++ and IDL as
|
||||
specified by STEP's Parts 23 and 26 respectively. To this we have
|
||||
added a persistence capability (based on the ObjectStore OODB from
|
||||
Object Design, Inc) and a distribution capability (based on Orbix by
|
||||
Iona Technologies, Ltd). We also experimented with the Open OODB from
|
||||
Texas Instruments and with DSOM from IBM.
|
||||
|
||||
The STEP Class Library (SCL) and fedex_plus are used to build
|
||||
STEP-related applications in C++. They support STEP Parts 21 (the
|
||||
exchange file format), 22 (the functional specification of STEP's
|
||||
Standard Data Access Interface, SDAI), 23 (the C++ binding to SDAI),
|
||||
and 26 (the IDL interface to SDAI). fedex_plus is an application of
|
||||
the NIST EXPRESS Toolkit (based on STEP Part 11) which generates a C++
|
||||
class library representation of an EXPRESS schema based on STEP's Part
|
||||
23. The generated classes work with the STEP Class Library. The NIST
|
||||
EXPRESS Pretty Printing Toolkit is used to format and output EXPRESS.
|
||||
fedex_os is used to generate software (in addition to fedex_plus)
|
||||
needed to use SCL with the ObjectStore OODB. fedex_idl translates
|
||||
EXPRESS to the Interface Definition Language (according to Part 26)
|
||||
for use with Orbix.
|
||||
|
||||
The Data Probe software and mkProbe script are used to generate
|
||||
schema-specific class libraries (a.k.a. "Schema Class Library"), Data
|
||||
Probe editors, and Part 21 file readers. mkProbe generates a C++
|
||||
library representing a schema (using fedex_plus) and links the schema
|
||||
library with other libraries of the SCL and Data Probe to create a
|
||||
schema specific editor, known as a Data Probe. The Data Probe is a
|
||||
graphical editor for STEP data; it is used to browse and edit data
|
||||
instances of the objects in an EXPRESS model. It may also be used to
|
||||
visually browse the objects contained in the EXPRESS schema itself.
|
||||
Data Probes are X Windows-based and use the InterViews Toolkit from
|
||||
Stanford University.
|
||||
|
||||
The Data Probe source code was designed with reusability in mind. The
|
||||
runtime-code uses three class libraries: the STEP Class Library
|
||||
(developed at NIST), the InterViews Toolkit (user interface
|
||||
developer's toolkit from Stanford), and a standard C++ Class Library.
|
||||
The NIST STEP Class Library is divided into component libraries
|
||||
including STEP Core, Editor, Utilities, Data Access Interface,
|
||||
Interviews extensions, and Probe. The STEP Core, Editor, and Utils
|
||||
libraries can be used without the user interface libraries (Interviews
|
||||
extensions and Probe) for applications needing to represent the
|
||||
EXPRESS data structures. At this point the Data Access Interface is a
|
||||
partial implementation of SDAI's Session schema.
|
||||
|
||||
Dependencies between these modules have been minimized so that an
|
||||
executable program, the Data Probe, can be easily reconfigured to
|
||||
support different conceptual schemas.
|
||||
|
||||
We have experimented with replacing the Interviews-based interface
|
||||
with a tcl interface with good success; however, it is not in our work
|
||||
plan to complete. If anyone is interested in extending the toolkit
|
||||
with a more modern interface, we would be glad to discuss it with you.
|
||||
|
||||
The Part 21 Reader was originally developed to test whether a Schema
|
||||
Class built and linked without problems. It is also useful for
|
||||
checking Part 21 files. It displays the error messages from the STEP
|
||||
Class Library as a file is read.
|
||||
|
||||
|
||||
SYSTEM REQUIREMENTS
|
||||
===================
|
||||
|
||||
Depending on how you want to use the toolkit, additional pieces of
|
||||
software will need to be available on your local system:
|
||||
|
||||
- UNIX SunOS 4.1.x or Solaris 5.x operating system.
|
||||
At NIST, the SCL including the Data Probe has been built on
|
||||
SunOS workstations. The SCL without the Data Probe has been
|
||||
built on Solaris. (We did not build the InterViews Library
|
||||
on Solaris.) NOTE: earlier versions of the SCL 2.1 without
|
||||
the Data Probe had been ported to AIX, HP, linux, and Windows NT.
|
||||
|
||||
- a C++ compiler -- cfront version 2.1 or higher
|
||||
|
||||
NOTE: The current SCL release has been built with SUN C/C++,
|
||||
and GNU's gcc/g++ compilers. Earlier versions of the SCL were
|
||||
built using CenterLine on SunOS and CSet++ on AIX.
|
||||
|
||||
If you successfully port the current version to other
|
||||
compilers and/or operating systems (and are willing to share)
|
||||
please contact us (stepcl@cme.nist.gov) so that we can point
|
||||
others to it.
|
||||
|
||||
- The NIST EXPRESS Toolkit -- available from NIST
|
||||
Included in this release; also available as:
|
||||
ftp.cme.nist.gov:pub/step/npttools/exptk.tar.Z
|
||||
|
||||
- The NIST EXPRESS Pretty Printer -- available from NIST
|
||||
Included in this release; also available as:
|
||||
ftp.cme.nist.gov:pub/step/npttools/exppp.tar.Z
|
||||
|
||||
The following components are optional:
|
||||
|
||||
- Version 3.1 of the InterViews Toolkit from Stanford.
|
||||
ftp://interviews.stanford.edu:pub/3.1.tar.Z
|
||||
|
||||
NOTE: InterViews is only needed for the Data Probe portion of
|
||||
the toolkit. The STEP Class Library without the Data Probe
|
||||
and InterViews has been built on more platforms than with these
|
||||
components.
|
||||
|
||||
- Orbix version 2.0. Available from Iona Technologies:
|
||||
http://www.iona.com
|
||||
|
||||
- Object Store version 4. Available from Object Design Inc.:
|
||||
http://www.odi.com.
|
||||
|
||||
|
||||
INSTALLATION INSTRUCTIONS
|
||||
=========================
|
||||
|
||||
Refer to the file INSTALL.
|
||||
|
||||
In the instructions below, you will see references to the directory
|
||||
<ARCH_DIR>. This directory name should be interpreted as the directory
|
||||
which is named to reflect your compiler and/or system architecture
|
||||
when installing the SCL using configure: i.e. "arch.centerline" or
|
||||
"arch-gnu.solaris"
|
||||
|
||||
|
||||
CREATING A NEW SCHEMA CLASS LIBRARY AND/OR DATA PROBE
|
||||
=====================================================
|
||||
|
||||
The <ARCH_DIR>/bin/mkProbe script automates the process of building
|
||||
new Schema Class Libraries and Data Probe executables. When run with
|
||||
the -l option only the Schema Class Library will be created. See man
|
||||
page in ~scl/man.
|
||||
|
||||
Examples
|
||||
|
||||
Input command line output (name and location)
|
||||
----------------------------------------------------
|
||||
mkProbe part41.exp pt41 ./pt41/dp_pt41
|
||||
|
||||
mkProbe -i part101.exp dp ~scl/<ARCH_DIR>/Probes/dp/dp_dp
|
||||
|
||||
mkProbe -l example.exp example ./example/libCexample.a
|
||||
|
||||
mkProbe -p example.exp example ./example/p21read_example
|
||||
|
||||
|
||||
CONTENTS
|
||||
========
|
||||
|
||||
This directory contains the following files and subdirectories.
|
||||
|
||||
This software release includes all the NIST software needed for
|
||||
creating new versions of the Data Probe program. Two example schemas
|
||||
are included in the data directory.
|
||||
|
||||
INSTALL - File discussing installation of SCL.
|
||||
|
||||
README.scl - This file.
|
||||
|
||||
src/test/README - README discussing SCL coding examples under src/test/
|
||||
|
||||
disclaim.txt - NIST disclaimer for this distribution.
|
||||
|
||||
build-apps.txt - Discusses how to build applications using the STEP
|
||||
Class Library.
|
||||
|
||||
whatsnew.3-1.txt- Discusses new features in the STEP Class Library and
|
||||
Data Probe 3.1 release.
|
||||
|
||||
whatsnew.2-1.txt- This was the `whatsnew' file released with SCL 2.1.
|
||||
Most of the information is still relevant.
|
||||
|
||||
configure - Script used to install the SCL.
|
||||
|
||||
configure.in - File used to create the configure script using gnu's
|
||||
autoconf software.
|
||||
|
||||
configure.files_notes.txt - Discusses various files used by the
|
||||
configure script.
|
||||
|
||||
Makefile - Contains a default rule to build SCL using the
|
||||
configure installation script.
|
||||
|
||||
<ARCH_DIR>/bin/mkProbe - Script used to generate a new Schema Class Library
|
||||
and/or Data Probe executable.
|
||||
(see CREATING A NEW SCHEMA CLASS LIBRARY AND/OR DATA PROBE)
|
||||
|
||||
config/ - Directory containing various templates needed by the
|
||||
configure installation script.
|
||||
|
||||
config/examples/ - Directory containing examples of using configure to
|
||||
install SCL.
|
||||
|
||||
arch_template/ - Directory containing templates used by configure to
|
||||
create an architecture specific SCL installation.
|
||||
|
||||
src/ - Source code files for the C++ libraries included in this
|
||||
release.
|
||||
|
||||
src/cl* - Directories containing the source code for the C++
|
||||
libraries in the STEP Class Library. These
|
||||
libraries are documented in the VTS Design document
|
||||
(see DOCUMENTATION below). They are as follows:
|
||||
|
||||
src/clutils - utilities needed by the other libraries.
|
||||
|
||||
src/clstepcore - "core" classes representing EXPRESS types
|
||||
and dictionary info.
|
||||
|
||||
src/cldai - classes for a partial implementation of the
|
||||
Session schema of STEP's Standard Data
|
||||
Access Interface (STEP Part 23).
|
||||
|
||||
src/cleditor - classes for managing data instances and
|
||||
exchange files.
|
||||
|
||||
src/clivfasd - customizations to the Interviews class
|
||||
library.
|
||||
|
||||
src/clprobe-ui - user interface classes for the Data Probe.
|
||||
|
||||
src/clSchemas - Contain subdirectories with schema specific source
|
||||
code generated by the mkProbe script.
|
||||
|
||||
src/express - Directory containing the EXPRESS Toolkit.
|
||||
|
||||
src/exppp - Directory containing EXPRESS Pretty Printer Toolkit.
|
||||
|
||||
src/test - Directory containing example STEP Class Library
|
||||
applications.
|
||||
|
||||
src/fedex_plus - Directory containing source code and makefile for
|
||||
fedex_plus, fedex_idl, fedex_os
|
||||
|
||||
<ARCH_DIR>
|
||||
|
||||
- <ARCH_DIR> is the installer-supplied name of the
|
||||
directory which is created when you run configure to
|
||||
install SCL. (See the file INSTALL for more
|
||||
information.) This directory contains computer
|
||||
architecture-specific files. Additional arch dirs
|
||||
may be created to support multiple platforms or C++
|
||||
compilers which all refer to the same source
|
||||
code under src/. The arch dir contains the subdirectories
|
||||
ofiles, bin, lib, and Probes.
|
||||
|
||||
<ARCH_DIR>/ofiles/ - Directory containing object (.o) files for SCL.
|
||||
|
||||
<ARCH_DIR>/ofiles/sdaiOrbix - Directory containing IDL files and
|
||||
Makefile needed to build and use SCL with Orbix.
|
||||
|
||||
<ARCH_DIR>/lib/ - Directory containing library (.a) files for SCL.
|
||||
|
||||
<ARCH_DIR>/Probes/ - The <ARCH_DIR>/Probes directory will contain
|
||||
directories for versions of the Schema Class Library
|
||||
and Data Probe generated using the mkProbe script
|
||||
with the -i option.
|
||||
|
||||
<ARCH_DIR>/bin/ - The fedex, fedex_plus, fedex_idl, and fedex_os,
|
||||
exppp, and symlink executables and mkProbe,
|
||||
sclbuild, and setup-arch scripts are placed in this
|
||||
directory during installation.
|
||||
|
||||
data/ - Directory containing sample EXPRESS files to use to
|
||||
create SCL applications such as the Data Probe or
|
||||
Part 21 Reader. Also contains data for some of the
|
||||
examples.
|
||||
|
||||
bin/ - Directory containing various scripts.
|
||||
|
||||
man/ - Directory containing man pages for the software in
|
||||
the release. You may look at the man page by
|
||||
issuing the command: nroff -man <manpagefile> or by
|
||||
adding this directory to your MANPATH.
|
||||
|
||||
|
||||
EXAMPLES
|
||||
========
|
||||
|
||||
Example of creating a Data Probe
|
||||
--------------------------------
|
||||
|
||||
To create a new version of the Data Probe run the script mkProbe. For
|
||||
example, to create a Data Probe based on the "example_schema" EXPRESS
|
||||
schema included in this release, issue the following command in a
|
||||
directory from which you would like a subdirectory containing the new
|
||||
Data Probe to be created:
|
||||
|
||||
% mkProbe ~scl/data/example/example.exp example
|
||||
|
||||
This command creates a new version of the Data Probe in the file:
|
||||
|
||||
% ./example/dp_example
|
||||
|
||||
(It also creates subdirectory example/ if it does not exist already.)
|
||||
|
||||
|
||||
Examples of using the STEP Class Library
|
||||
----------------------------------------
|
||||
|
||||
To use the Schema Class Library source code (without the Data Probe
|
||||
software) refer to the examples in the directory src/test.
|
||||
|
||||
Example of a Part 21 file reader
|
||||
--------------------------------
|
||||
|
||||
To create a file reader based on STEP's Part 21 format use the mkProbe
|
||||
script with the -p option.
|
||||
|
||||
% mkProbe -p ~scl/data/example/example.exp example
|
||||
|
||||
The executable p21read_example is created. Run it as follows:
|
||||
|
||||
% p21read_example your_part_21_file
|
||||
|
||||
This program reads a file the name of which is supplied as an
|
||||
argument to the program. Any errors encountered when reading the file
|
||||
are reported to standard output. A summary of the file is also
|
||||
reported. The file is then written back out to a file the name of
|
||||
which may be supplied as the second argument to the program. If no
|
||||
name is given, "file.out" is used.
|
||||
|
||||
|
||||
FOR MORE INFORMATION
|
||||
====================
|
||||
|
||||
SCL HOME PAGE
|
||||
-------------
|
||||
|
||||
The SCL home page is located on the world wide web at,
|
||||
|
||||
http://www.nist.gov/scl
|
||||
|
||||
The SCL home page will provide important, up-to-date information on
|
||||
the status of the SCL, new developments and fixes, links to related
|
||||
software and projects, and may eventually contain an FAQ sheet.
|
||||
|
||||
SCL DOCUMENTATION
|
||||
-----------------
|
||||
|
||||
Documentation can be accessed from the SCL world wide web home page
|
||||
located at http://www.nist.gov/scl
|
||||
The following files (in postscript format) are particularly relevant:
|
||||
|
||||
Design of a C++ Software Library for Implementing EXPRESS: The NIST
|
||||
STEP Class Library
|
||||
|
||||
Data Probe User's Guide
|
||||
|
||||
Data Probe: A Tool for EXPRESS-based Data
|
||||
|
||||
Architecture for the Validation Testing System Software
|
||||
|
||||
Validation Testing System Software Reusable Software Component Design
|
||||
|
||||
Diagrams of basic SCL data structures
|
||||
|
||||
|
||||
ISO DOCUMENTATION
|
||||
-----------------
|
||||
|
||||
Copies of the International Standard documents (including STEP Part 11
|
||||
the EXPRESS Language Reference Manual, Part 21 the STEP Exchange File
|
||||
Format, Part 22 STEP's Standard Data Access Interface, and Part 23 the
|
||||
C++ language binding to SDAI) can be ordered from the ISO
|
||||
International Organization of Standardization or your national
|
||||
body. The United States distribution is managed by the US Product Data
|
||||
Exchange Association at:
|
||||
|
||||
U.S. Product Data Association (USPro)
|
||||
Trident Research Center, Suite 204
|
||||
5300 International Blvd.
|
||||
N. Charleston, SC 29418
|
||||
|
||||
http://www.uspro.scra.org
|
||||
uspro@scra.org
|
||||
Ph: 803-760-3327
|
||||
FAX: 803-760-3349
|
||||
|
||||
MAILING LIST
|
||||
------------
|
||||
|
||||
Announcements of new releases or bug fixes will also be sent to the
|
||||
mailing list scl@cme.nist.gov. To be added to the scl mailing list
|
||||
send a request to majordomo@cme.nist.gov. Include in the body of the
|
||||
message:
|
||||
|
||||
subscribe scl
|
||||
|
||||
For additional help, include in the body of the message:
|
||||
|
||||
help
|
||||
|
||||
If you use a signature within your email, end your majordomo
|
||||
command sequence with the word "end". For example,
|
||||
|
||||
subscribe scl
|
||||
end
|
||||
|
||||
|
||||
REPORTING PROBLEMS AND SUGGESTIONS
|
||||
==================================
|
||||
|
||||
We would like feedback on all parts of the software. Please let us
|
||||
know if you
|
||||
|
||||
- have problems following the instructions in the README file,
|
||||
- have problems installing the software,
|
||||
- have problems compiling your own valid EXPRESS schema, or
|
||||
- have suggestions for improvements to the software.
|
||||
- really like the software :)
|
||||
|
||||
Send your comments to
|
||||
|
||||
stepcl@cme.nist.gov
|
||||
|
||||
(For users of version 2, note the new mailing address of "stepcl...".)
|
||||
|
||||
Questions about availability or accessing the software should be
|
||||
directed to the SOLIS administrator
|
||||
|
||||
Gaylen Rinaudot
|
||||
npt-info@cme.nist.gov
|
||||
301-975-3386
|
||||
|
||||
ACKNOWLEDGMENTS
|
||||
===============
|
||||
|
||||
The STEP Class Library (SCL) was developed by the Manufacturing
|
||||
Systems Integration Division at the National Institute of Standards
|
||||
and Technology (http://www.mel/nist.gov/msid) to support testing of
|
||||
the Standard for the Exchange of Product Model Data (a.k.a STEP) and
|
||||
validation of STEP's emerging implementation specifications. Funding
|
||||
for the project has come from the U.S. Department of Commerce, and the
|
||||
Department of Defense agencies including the Office of the Defense
|
||||
CALS (Continuous Acquisition and Life-Cycle Support) Executive and the
|
||||
Defense Advanced Research Projects Agency (DARPA). Recent
|
||||
enhancements were sponsored by the National Industrial Information
|
||||
Infrastructure Consortium (NIIIP) (http://www.niiip.org) and the NAMT
|
||||
Framework project
|
||||
(http://www.mel.nist.gov/msid/projs/97projs/framewrk.htm) of NIST's
|
||||
Systems Integration for Manufacturing Applications (SIMA) program
|
||||
(http://www.mel.nist.gov/msid/sima/sima.htm).
|
||||
|
||||
LICENSING RESTRICTIONS and DISCLAIMERS
|
||||
======================================
|
||||
|
||||
This software was produced by the National Institute of Standards and
|
||||
Technology (NIST), an agency of the U.S. government, and by statute
|
||||
is not subject to copyright in the United States. Recipients of this
|
||||
software assume all responsibility associated with its operation,
|
||||
modification, maintenance, and subsequent re-distribution.
|
||||
|
||||
There is no warranty for the NIST STEP Toolkit.
|
||||
If the NIST STEP Toolkit is modified by someone else and passed on,
|
||||
NIST wants the Toolkit's recipients to know that what they have is not
|
||||
what NIST originally distributed.
|
||||
|
||||
Distribution Rights
|
||||
1. Anyone may copy and distribute verbatim copies of the NIST STEP Toolkit
|
||||
source code as received in any medium.
|
||||
|
||||
2. Anyone may modify their copy or copies of the NIST STEP Toolkit source
|
||||
code or any portion of it, and copy and distribute such modifications
|
||||
provided that all modifications are clearly associated with the entity
|
||||
that performs the modifications.
|
||||
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!DISCLAIMERS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
Names of companies and products are provided in order to adequately
|
||||
specify procedures and equipment used. In no case does such
|
||||
identification imply recommendation or endorsement by the National
|
||||
Institute of Standards and Technology, nor does it imply that the
|
||||
products are necessarily the best available for the purpose.
|
||||
|
||||
NO WARRANTY
|
||||
===========
|
||||
|
||||
NIST PROVIDES ABSOLUTELY NO WARRANTY. THE NIST STEP TOOLKIT
|
||||
IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS
|
||||
WITH YOU. SHOULD ANY PORTION OF THE NIST STEP TOOLKIT PROVE DEFECTIVE,
|
||||
YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.
|
||||
|
||||
IN NO EVENT WILL NIST BE LIABLE FOR DAMAGES, INCLUDING ANY LOST
|
||||
PROFITS, LOST MONIES, OR OTHER SPECIAL, INCIDENTAL OR CONSEQUENTIAL
|
||||
DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE (INCLUDING BUT NOT
|
||||
LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE, OR LOSSES
|
||||
SUSTAINED BY THIRD PARTIES, OR A FAILURE OF THE PROGRAM TO OPERATE
|
||||
WITH PROGRAMS NOT DISTRIBUTED BY NIST) THE PROGRAMS, EVEN IF YOU HAVE
|
||||
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, OR FOR ANY CLAIM BY
|
||||
ANY OTHER PARTY.
|
||||
For more info, see the wiki.
|
||||
@@ -0,0 +1 @@
|
||||
0.6
|
||||
@@ -151,9 +151,6 @@ IF(LEX_EXECUTABLE)
|
||||
SET(FILE_RUN_DEFINITIONS "-DYYTEXT_POINTER=1")
|
||||
CHECK_C_FILE_RUNS(${CMAKE_CURRENT_SOURCE_DIR}/cmake/test_srcs/sys_wait_test.c YYTEXT_POINTER)
|
||||
SET(FILE_RUN_DEFINITIONS)
|
||||
IF(CONFIG_H_FILE)
|
||||
FILE(APPEND ${CONFIG_H_FILE} "#cmakedefine YYTEXT_POINTER 1\n")
|
||||
ENDIF(CONFIG_H_FILE)
|
||||
|
||||
|
||||
ENDIF(LEX_EXECUTABLE)
|
||||
|
||||
+120
-58
@@ -1,75 +1,137 @@
|
||||
# Will need windows logic someday, even though it doesn't work yet, so go ahead
|
||||
# and add the DLL_DEFINE macro
|
||||
|
||||
MACRO(DLL_DEFINE libname)
|
||||
IF(MSVC)
|
||||
STRING(REGEX REPLACE "lib" "" LOWERCORE "${libname}")
|
||||
STRING(TOUPPER ${LOWERCORE} UPPER_CORE)
|
||||
add_definitions("-D${UPPER_CORE}_EXPORT_DLL")
|
||||
ENDIF(MSVC)
|
||||
ENDMACRO()
|
||||
# set compile definitions for dll exports on windows
|
||||
MACRO(DEFINE_DLL_EXPORTS libname)
|
||||
IF( MSVC OR BORLAND )
|
||||
if( ${libname} MATCHES "sdai_.*" )
|
||||
set( export "SCL_SCHEMA_DLL_EXPORTS" )
|
||||
else()
|
||||
STRING(REGEX REPLACE "lib" "" shortname "${libname}")
|
||||
STRING(REGEX REPLACE "step" "" LOWERCORE "${shortname}")
|
||||
STRING(TOUPPER ${LOWERCORE} UPPER_CORE)
|
||||
set( export "SCL_${UPPER_CORE}_DLL_EXPORTS" )
|
||||
endif()
|
||||
get_target_property(defs ${libname} COMPILE_DEFINITIONS )
|
||||
if( defs ) #if no properties, ${defs} will be defs-NOTFOUND which CMake interprets as false
|
||||
set( defs "${defs};${export}")
|
||||
else( defs )
|
||||
set( defs "${export}")
|
||||
endif( defs )
|
||||
set_target_properties(${libname} PROPERTIES COMPILE_DEFINITIONS "${defs}" )
|
||||
ENDIF( MSVC OR BORLAND )
|
||||
ENDMACRO(DEFINE_DLL_EXPORTS libname)
|
||||
|
||||
# set compile definitions for dll imports on windows
|
||||
MACRO( DEFINE_DLL_IMPORTS tgt libs )
|
||||
IF( MSVC OR BORLAND )
|
||||
get_target_property(defs ${tgt} COMPILE_DEFINITIONS )
|
||||
if( NOT defs ) #if no properties, ${defs} will be defs-NOTFOUND which CMake interprets as false
|
||||
set( defs "")
|
||||
endif( NOT defs )
|
||||
foreach( lib ${libs} )
|
||||
STRING(REGEX REPLACE "lib" "" shortname "${lib}")
|
||||
STRING(REGEX REPLACE "step" "" LOWERCORE "${shortname}")
|
||||
STRING(TOUPPER ${LOWERCORE} UPPER_CORE)
|
||||
list( APPEND defs "SCL_${UPPER_CORE}_DLL_IMPORTS" )
|
||||
endforeach( lib ${libs} )
|
||||
if( DEFINED defs )
|
||||
if( defs )
|
||||
set_target_properties( ${tgt} PROPERTIES COMPILE_DEFINITIONS "${defs}" )
|
||||
endif( defs )
|
||||
endif( DEFINED defs )
|
||||
ENDIF( MSVC OR BORLAND )
|
||||
ENDMACRO( DEFINE_DLL_IMPORTS tgt libs )
|
||||
|
||||
#EXCLUDE_OR_INSTALL(target destination ARGV3)
|
||||
# installs ${target} in ${destination} unless testing is enabled AND ${arg_3} == "TESTABLE",
|
||||
# in which case the EXCLUDE_FROM_ALL property is set for testing.
|
||||
# EXCLUDE_FROM_ALL cannot be set on targets that are to be installed,
|
||||
# so either test the target or install it - but not both
|
||||
MACRO(EXCLUDE_OR_INSTALL target dest arg_3 )
|
||||
if( NOT ( ( SCL_ENABLE_TESTING ) AND ( "${arg_3}" STREQUAL "TESTABLE" ) ) )
|
||||
INSTALL(TARGETS ${target} DESTINATION ${dest})
|
||||
else( NOT ( ( SCL_ENABLE_TESTING ) AND ( "${arg_3}" STREQUAL "TESTABLE" ) ) )
|
||||
set_target_properties( ${target} PROPERTIES EXCLUDE_FROM_ALL ON )
|
||||
endif( NOT ( ( SCL_ENABLE_TESTING ) AND ( "${arg_3}" STREQUAL "TESTABLE" ) ) )
|
||||
ENDMACRO(EXCLUDE_OR_INSTALL target dest arg_3 )
|
||||
|
||||
#SCL_ADDEXEC( execname "source files" "linked libs" ["TESTABLE"] ["MSVC flag" ...])
|
||||
# optional 4th argument of "TESTABLE", passed to EXCLUDE_OR_INSTALL macro
|
||||
# optional args can also be used by MSVC-specific code, but it looks like these two uses
|
||||
# will not conflict because the MSVC args must contain "STRICT"
|
||||
MACRO(SCL_ADDEXEC execname srcs libs)
|
||||
STRING(REGEX REPLACE " " ";" srcslist "${srcs}")
|
||||
STRING(REGEX REPLACE " " ";" libslist "${libs}")
|
||||
add_executable(${execname} ${srcslist})
|
||||
target_link_libraries(${execname} ${libslist})
|
||||
INSTALL(TARGETS ${execname} DESTINATION bin)
|
||||
# Enable extra compiler flags if local executables and/or global options dictate
|
||||
SET(LOCAL_COMPILE_FLAGS "")
|
||||
FOREACH(extraarg ${ARGN})
|
||||
IF(${extraarg} MATCHES "STRICT" AND SCL-ENABLE_STRICT)
|
||||
SET(LOCAL_COMPILE_FLAGS "${LOCAL_COMPILE_FLAGS} ${STRICT_FLAGS}")
|
||||
ENDIF(${extraarg} MATCHES "STRICT" AND SCL-ENABLE_STRICT)
|
||||
ENDFOREACH(extraarg ${ARGN})
|
||||
IF(LOCAL_COMPILE_FLAGS)
|
||||
SET_TARGET_PROPERTIES(${execname} PROPERTIES COMPILE_FLAGS ${LOCAL_COMPILE_FLAGS})
|
||||
ENDIF(LOCAL_COMPILE_FLAGS)
|
||||
STRING(REGEX REPLACE " " ";" srcslist "${srcs}")
|
||||
STRING(REGEX REPLACE " " ";" libslist "${libs}")
|
||||
add_executable(${execname} ${srcslist})
|
||||
target_link_libraries(${execname} ${libslist})
|
||||
DEFINE_DLL_IMPORTS(${execname} "${libslist}") #add import definitions for all libs that the executable is linked to
|
||||
EXCLUDE_OR_INSTALL( ${execname} "bin" "${ARGV3}" )
|
||||
# Enable extra compiler flags if local executables and/or global options dictate
|
||||
SET(LOCAL_COMPILE_FLAGS "")
|
||||
FOREACH(extraarg ${ARGN})
|
||||
IF(${extraarg} MATCHES "STRICT" AND SCL-ENABLE_STRICT)
|
||||
SET(LOCAL_COMPILE_FLAGS "${LOCAL_COMPILE_FLAGS} ${STRICT_FLAGS}")
|
||||
ENDIF(${extraarg} MATCHES "STRICT" AND SCL-ENABLE_STRICT)
|
||||
ENDFOREACH(extraarg ${ARGN})
|
||||
IF(LOCAL_COMPILE_FLAGS)
|
||||
SET_TARGET_PROPERTIES(${execname} PROPERTIES COMPILE_FLAGS ${LOCAL_COMPILE_FLAGS})
|
||||
ENDIF(LOCAL_COMPILE_FLAGS)
|
||||
ENDMACRO(SCL_ADDEXEC execname srcs libs)
|
||||
|
||||
#SCL_ADDLIB( libname "source files" "linked libs" ["TESTABLE"] ["MSVC flag" ...])
|
||||
# optional 4th argument of "TESTABLE", passed to EXCLUDE_OR_INSTALL macro
|
||||
# optional args can also be used by MSVC-specific code, but it looks like these two uses
|
||||
# will not conflict because the MSVC args must contain "STRICT"
|
||||
MACRO(SCL_ADDLIB libname srcs libs)
|
||||
STRING(REGEX REPLACE " " ";" srcslist "${srcs}")
|
||||
STRING(REGEX REPLACE " " ";" libslist1 "${libs}")
|
||||
STRING(REGEX REPLACE "-framework;" "-framework " libslist "${libslist1}")
|
||||
DLL_DEFINE(${libname})
|
||||
IF(BUILD_SHARED_LIBS)
|
||||
add_library(${libname} SHARED ${srcslist})
|
||||
if(NOT ${libs} MATCHES "NONE")
|
||||
target_link_libraries(${libname} ${libslist})
|
||||
endif(NOT ${libs} MATCHES "NONE")
|
||||
SET_TARGET_PROPERTIES(${libname} PROPERTIES VERSION ${SCL_VERSION_MAJOR}.${SCL_VERSION_MINOR} SOVERSION ${SCL_VERSION_MAJOR} )
|
||||
INSTALL(TARGETS ${libname} DESTINATION lib)
|
||||
ENDIF(BUILD_SHARED_LIBS)
|
||||
IF(BUILD_STATIC_LIBS AND NOT MSVC)
|
||||
add_library(${libname}-static STATIC ${srcslist})
|
||||
if(NOT ${libs} MATCHES "NONE")
|
||||
target_link_libraries(${libname}-static ${libslist})
|
||||
endif(NOT ${libs} MATCHES "NONE")
|
||||
IF(NOT WIN32)
|
||||
SET_TARGET_PROPERTIES(${libname}-static PROPERTIES OUTPUT_NAME "${libname}")
|
||||
ENDIF(NOT WIN32)
|
||||
IF(WIN32)
|
||||
# We need the lib prefix on win32, so add it even if our add_library
|
||||
# wrapper function has removed it due to the target name - see
|
||||
# http://www.cmake.org/Wiki/CMake_FAQ#How_do_I_make_my_shared_and_static_libraries_have_the_same_root_name.2C_but_different_suffixes.3F
|
||||
SET_TARGET_PROPERTIES(${libname}-static PROPERTIES PREFIX "lib")
|
||||
ENDIF(WIN32)
|
||||
INSTALL(TARGETS ${libname}-static DESTINATION lib)
|
||||
ENDIF(BUILD_STATIC_LIBS AND NOT MSVC)
|
||||
IF(SCL_BUILD_SHARED_LIBS)
|
||||
add_library(${libname} SHARED ${srcslist})
|
||||
DEFINE_DLL_EXPORTS(${libname})
|
||||
if(NOT ${libs} MATCHES "NONE")
|
||||
target_link_libraries(${libname} ${libslist})
|
||||
DEFINE_DLL_IMPORTS(${libname} "${libslist}" )
|
||||
endif(NOT ${libs} MATCHES "NONE")
|
||||
SET_TARGET_PROPERTIES(${libname} PROPERTIES VERSION ${SCL_ABI_VERSION} SOVERSION ${SCL_ABI_SOVERSION} )
|
||||
EXCLUDE_OR_INSTALL( ${libname} "lib" "${ARGV3}" )
|
||||
if(APPLE)
|
||||
set_target_properties(${libname} PROPERTIES LINK_FLAGS "-flat_namespace -undefined suppress")
|
||||
endif(APPLE)
|
||||
ENDIF(SCL_BUILD_SHARED_LIBS)
|
||||
IF(SCL_BUILD_STATIC_LIBS AND NOT MSVC)
|
||||
add_library(${libname}-static STATIC ${srcslist})
|
||||
DEFINE_DLL_EXPORTS(${libname}-static)
|
||||
if(NOT ${libs} MATCHES "NONE")
|
||||
target_link_libraries(${libname}-static "${libslist}")
|
||||
DEFINE_DLL_IMPORTS(${libname}-static ${libslist} )
|
||||
endif(NOT ${libs} MATCHES "NONE")
|
||||
IF(NOT WIN32)
|
||||
SET_TARGET_PROPERTIES(${libname}-static PROPERTIES OUTPUT_NAME "${libname}")
|
||||
ENDIF(NOT WIN32)
|
||||
IF(WIN32)
|
||||
# We need the lib prefix on win32, so add it even if our add_library
|
||||
# wrapper function has removed it due to the target name - see
|
||||
# http://www.cmake.org/Wiki/CMake_FAQ#How_do_I_make_my_shared_and_static_libraries_have_the_same_root_name.2C_but_different_suffixes.3F
|
||||
SET_TARGET_PROPERTIES(${libname}-static PROPERTIES PREFIX "lib")
|
||||
ENDIF(WIN32)
|
||||
EXCLUDE_OR_INSTALL( ${libname}-static "lib" "${ARGV3}" )
|
||||
if(APPLE)
|
||||
set_target_properties(${libname}-static PROPERTIES LINK_FLAGS "-flat_namespace -undefined suppress")
|
||||
endif(APPLE)
|
||||
ENDIF(SCL_BUILD_STATIC_LIBS AND NOT MSVC)
|
||||
# Enable extra compiler flags if local libraries and/or global options dictate
|
||||
SET(LOCAL_COMPILE_FLAGS "")
|
||||
FOREACH(extraarg ${ARGN})
|
||||
IF(${extraarg} MATCHES "STRICT" AND SCL-ENABLE_STRICT)
|
||||
SET(LOCAL_COMPILE_FLAGS "${LOCAL_COMPILE_FLAGS} ${STRICT_FLAGS}")
|
||||
ENDIF(${extraarg} MATCHES "STRICT" AND SCL-ENABLE_STRICT)
|
||||
IF(${extraarg} MATCHES "STRICT" AND SCL-ENABLE_STRICT)
|
||||
SET(LOCAL_COMPILE_FLAGS "${LOCAL_COMPILE_FLAGS} ${STRICT_FLAGS}")
|
||||
ENDIF(${extraarg} MATCHES "STRICT" AND SCL-ENABLE_STRICT)
|
||||
ENDFOREACH(extraarg ${ARGN})
|
||||
IF(LOCAL_COMPILE_FLAGS)
|
||||
IF(BUILD_SHARED_LIBS)
|
||||
SET_TARGET_PROPERTIES(${libname} PROPERTIES COMPILE_FLAGS ${LOCAL_COMPILE_FLAGS})
|
||||
ENDIF(BUILD_SHARED_LIBS)
|
||||
IF(BUILD_STATIC_LIBS AND NOT MSVC)
|
||||
SET_TARGET_PROPERTIES(${libname}-static PROPERTIES COMPILE_FLAGS ${LOCAL_COMPILE_FLAGS})
|
||||
ENDIF(BUILD_STATIC_LIBS AND NOT MSVC)
|
||||
IF(BUILD_SHARED_LIBS)
|
||||
SET_TARGET_PROPERTIES(${libname} PROPERTIES COMPILE_FLAGS ${LOCAL_COMPILE_FLAGS})
|
||||
ENDIF(BUILD_SHARED_LIBS)
|
||||
IF(BUILD_STATIC_LIBS AND NOT MSVC)
|
||||
SET_TARGET_PROPERTIES(${libname}-static PROPERTIES COMPILE_FLAGS ${LOCAL_COMPILE_FLAGS})
|
||||
ENDIF(BUILD_STATIC_LIBS AND NOT MSVC)
|
||||
ENDIF(LOCAL_COMPILE_FLAGS)
|
||||
ENDMACRO(SCL_ADDLIB libname srcs libs)
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
if (NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
|
||||
message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
|
||||
endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
|
||||
|
||||
file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
|
||||
string(REGEX REPLACE "\n" ";" files "${files}")
|
||||
list(REVERSE files)
|
||||
foreach (file ${files})
|
||||
message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
|
||||
if (EXISTS "$ENV{DESTDIR}${file}")
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_COMMAND} -E remove "$ENV{DESTDIR}${file}"
|
||||
OUTPUT_VARIABLE rm_out
|
||||
RESULT_VARIABLE rm_retval
|
||||
)
|
||||
if(NOT ${rm_retval} EQUAL 0)
|
||||
message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
|
||||
endif (NOT ${rm_retval} EQUAL 0)
|
||||
else (EXISTS "$ENV{DESTDIR}${file}")
|
||||
message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
|
||||
endif (EXISTS "$ENV{DESTDIR}${file}")
|
||||
endforeach(file)
|
||||
@@ -0,0 +1,58 @@
|
||||
#use git for a pretty commit id
|
||||
#uses 'git describe --tags', so tags are required in the repo
|
||||
#create a tag with 'git tag <name>' and 'git push --tags'
|
||||
|
||||
# http://stackoverflow.com/questions/3780667
|
||||
# http://www.cmake.org/pipermail/cmake/2009-February/027014.html
|
||||
|
||||
#scl_version_string.h defines scl_version() which returns a pretty commit description and a build timestamp.
|
||||
|
||||
set(SCL_IS_SUBBUILD "@SCL_IS_SUBBUILD@")
|
||||
|
||||
set(VERS_FILE ${SOURCE_DIR}/SCL_VERSION.txt )
|
||||
if( EXISTS ${SOURCE_DIR}/.git )
|
||||
find_package(Git QUIET)
|
||||
if(GIT_FOUND)
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags RESULT_VARIABLE res_var OUTPUT_VARIABLE GIT_COMMIT_ID )
|
||||
if( NOT ${res_var} EQUAL 0 )
|
||||
file( READ ${VERS_FILE} GIT_COMMIT_ID LIMIT 255 )
|
||||
if(NOT SCL_IS_SUBBUILD)
|
||||
message( WARNING "Git failed (probably no tags in repo). Build will contain revision info from ${VERS_FILE}." )
|
||||
endif(NOT SCL_IS_SUBBUILD)
|
||||
endif()
|
||||
else(GIT_FOUND)
|
||||
file( READ ${VERS_FILE} GIT_COMMIT_ID LIMIT 255 )
|
||||
if(NOT SCL_IS_SUBBUILD)
|
||||
message( WARNING "Git not found. Build will contain revision info from ${VERS_FILE}." )
|
||||
endif(NOT SCL_IS_SUBBUILD)
|
||||
endif(GIT_FOUND)
|
||||
else()
|
||||
file( READ ${VERS_FILE} GIT_COMMIT_ID LIMIT 255 )
|
||||
if(NOT SCL_IS_SUBBUILD)
|
||||
message( WARNING "Git failed ('.git' not found). Build will contain revision info from ${VERS_FILE}." )
|
||||
endif(NOT SCL_IS_SUBBUILD)
|
||||
endif()
|
||||
|
||||
string( REPLACE "\n" "" GIT_COMMIT_ID ${GIT_COMMIT_ID} )
|
||||
|
||||
set( vstring "//scl_version_string.h - written by cmake. Changes will be lost!\n"
|
||||
"#ifndef SCL_VERSION_STRING\n"
|
||||
"#define SCL_VERSION_STRING\n\n"
|
||||
"/*\n** Returns a string like \"test-1-g5e1fb47, built at TIME on DATE\", where test is the\n"
|
||||
"** name of the last tagged git revision, 1 is the number of commits since that tag,\n"
|
||||
"** 'g' is unknown, 5e1fb47 is the first 7 chars of the git sha1 commit id, and TIME\n"
|
||||
"** and DATE are substituted by the compiler.\n*/\n\n"
|
||||
"const char* scl_version() {\n"
|
||||
" return \"git commit id ${GIT_COMMIT_ID}, built at \"__TIME__\" on \"__DATE__\;\n"
|
||||
"}\n\n"
|
||||
"#endif\n"
|
||||
)
|
||||
|
||||
file(WRITE scl_version_string.h.txt ${vstring} )
|
||||
# copy the file to the final header only if the version changes
|
||||
# reduces needless rebuilds
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
scl_version_string.h.txt ${BINARY_DIR}/include/scl_version_string.h)
|
||||
if(NOT SCL_IS_SUBBUILD)
|
||||
message("-- scl_version_string.h is up-to-date.")
|
||||
endif(NOT SCL_IS_SUBBUILD)
|
||||
@@ -0,0 +1,25 @@
|
||||
# run_ctest.cmake
|
||||
# `ctest -S run_ctest.cmake`
|
||||
|
||||
set( CTEST_SOURCE_DIRECTORY . )
|
||||
set( CTEST_BINARY_DIRECTORY build_matrix )
|
||||
set( CTEST_CMAKE_GENERATOR "Unix Makefiles" )
|
||||
set( CTEST_MEMORYCHECK_COMMAND /usr/bin/valgrind )
|
||||
set( CTEST_INITIAL_CACHE "
|
||||
SITE:STRING=${CTEST_SITE}
|
||||
BUILDNAME:STRING=${CTEST_BUILD_NAME}
|
||||
SCL_ENABLE_TESTING:BOOL=ON
|
||||
SCL_BUILD_TYPE:STRING=Debug
|
||||
")
|
||||
|
||||
|
||||
ctest_start(matrix)
|
||||
ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})
|
||||
ctest_configure( BUILD "${CTEST_BINARY_DIRECTORY}" OPTIONS -DSCL_ENABLE_TESTING=ON )
|
||||
ctest_build( BUILD "${CTEST_BINARY_DIRECTORY}" )
|
||||
message("running tests")
|
||||
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" INCLUDE_LABEL "cpp_schema_....*" )
|
||||
|
||||
message("running python script")
|
||||
execute_process( COMMAND python ../misc/wiki-scripts/update-matrix.py
|
||||
WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY} )
|
||||
+25
-67
@@ -1,49 +1,5 @@
|
||||
IF( INSTALL_DATA )
|
||||
SET(ap203_data
|
||||
ap203/203wseds.exp
|
||||
ap203/cube1.p21
|
||||
ap203/cube2.p21
|
||||
ap203/g_r_assembly1.p21
|
||||
ap203/gasket1.p21
|
||||
ap203/gasket2.p21
|
||||
ap203/gasket3.p21
|
||||
ap203/hex_prism1.p21
|
||||
ap203/rod_aspect1.p21
|
||||
ap203/star1.p21
|
||||
)
|
||||
INSTALL(FILES ${ap203_data} DESTINATION ${DATA_DIR}/data/ap203)
|
||||
|
||||
SET(ap227_data
|
||||
ap227/ap227.exp
|
||||
ap227/mitre.p21
|
||||
ap227/mitre.step.txt
|
||||
)
|
||||
INSTALL(FILES ${ap227_data} DESTINATION ${DATA_DIR}/data/ap227)
|
||||
|
||||
SET(step_example_data
|
||||
example/example.exp
|
||||
)
|
||||
INSTALL(FILES ${step_example_data} DESTINATION ${DATA_DIR}/data/example)
|
||||
|
||||
|
||||
|
||||
SET(step_datafiles
|
||||
pdmnet.exp
|
||||
select.exp
|
||||
)
|
||||
INSTALL(FILES ${step_datafiles} DESTINATION ${DATA_DIR}/data)
|
||||
ENDIF( INSTALL_DATA )
|
||||
|
||||
#this sets a property so that the target doesn't get built by 'make' or 'make all'
|
||||
#useful when testing generation of schema code/compiling schem libs/etc
|
||||
FUNCTION( TESTABLE_TARGET target )
|
||||
if(ENABLE_TESTING)
|
||||
set_target_properties( ${target} PROPERTIES EXCLUDE_FROM_ALL ON )
|
||||
endif()
|
||||
ENDFUNCTION( TESTABLE_TARGET )
|
||||
|
||||
# To build one or more schemas, configure with
|
||||
# 'cmake -DBUILD_SCHEMAS="path/to/schema.exp;path/to/schema2.exp"
|
||||
# 'cmake -DSCL_BUILD_SCHEMAS="path/to/schema.exp;path/to/schema2.exp"
|
||||
|
||||
# This function runs fedex on one express file. The generated source goes in a dir
|
||||
# in the build dir, and it is compiled into a library. A p21read executable is
|
||||
@@ -69,7 +25,8 @@ FUNCTION(BUILD_A_SCHEMA SCHEMA_FILE)
|
||||
file(STRINGS ${SCHEMA_FILE} SCHEMA_STATEMENT LIMIT_COUNT 1 REGEX "^SCHEMA .*")
|
||||
string(REGEX REPLACE "^SCHEMA \(.*\)\;$" "\\1" SCHEMA_N ${SCHEMA_STATEMENT} )
|
||||
string(TOUPPER ${SCHEMA_N} SCHEMA_LONG_NAME) #fedex_plus always uses upper case for file names
|
||||
get_filename_component(SCHEMA_SHORT_NAME ${SCHEMA_FILE} NAME_WE)
|
||||
get_filename_component( SCHEMA_SN ${SCHEMA_FILE} NAME )
|
||||
string( REGEX REPLACE "\(.*\).[Ee][Xx][Pp]" "\\1" SCHEMA_SHORT_NAME ${SCHEMA_SN} )
|
||||
|
||||
project( sdai_${SCHEMA_SHORT_NAME} )
|
||||
message( STATUS "Generating code for ${SCHEMA_SHORT_NAME}.")
|
||||
@@ -85,9 +42,9 @@ FUNCTION(BUILD_A_SCHEMA SCHEMA_FILE)
|
||||
# multiple schemas, each one will use the include dirs from all previous schemas. Since
|
||||
# one header (schema.h) is always named the same, this will not work. only workaround
|
||||
# seems to be set_target_properties( <target> PROPERTIES COMPILE_FLAGS <flags> )
|
||||
set( ${PROJECT_NAME}_COMPILE_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR} -I${SCL_SOURCE_DIR}/src/cldai -I${SCL_SOURCE_DIR}/src/cleditor -I${SCL_SOURCE_DIR}/src/clutils -I${SCHEMA_OUTPUT_DIR} -I${SCL_SOURCE_DIR}/src/clstepcore" )
|
||||
set( ${PROJECT_NAME}_COMPILE_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR} -I${SCL_SOURCE_DIR}/src/cldai -I${SCL_SOURCE_DIR}/src/cleditor -I${SCL_SOURCE_DIR}/src/clutils -I${SCHEMA_OUTPUT_DIR} -I${SCL_SOURCE_DIR}/src/clstepcore -I${SCL_SOURCE_DIR}/src/base" )
|
||||
|
||||
add_custom_target( generate_${SCHEMA_SHORT_NAME} SOURCES ${FEDEX_OUT} )
|
||||
add_custom_target( generate_cpp_${SCHEMA_SHORT_NAME} SOURCES ${FEDEX_OUT} )
|
||||
add_custom_command( OUTPUT ${SCHEMA_OUTPUT_DIR}
|
||||
COMMAND cmake ARGS -E make_directory ${SCHEMA_OUTPUT_DIR}
|
||||
COMMENT "Creating ${SCHEMA_OUTPUT_DIR} for schema ${SCHEMA_SHORT_NAME}")
|
||||
@@ -97,52 +54,53 @@ FUNCTION(BUILD_A_SCHEMA SCHEMA_FILE)
|
||||
WORKING_DIRECTORY ${SCHEMA_OUTPUT_DIR}
|
||||
COMMENT "Running fedex_plus for ${SCHEMA_SHORT_NAME}..."
|
||||
VERBATIM )
|
||||
add_library( ${PROJECT_NAME} SHARED ${FEDEX_OUT} )
|
||||
target_link_libraries(${PROJECT_NAME} stepdai stepcore express stepeditor )
|
||||
add_dependencies( ${PROJECT_NAME} generate_${SCHEMA_SHORT_NAME} )
|
||||
# if testing is enabled, "TESTABLE" sets property EXCLUDE_FROM_ALL and prevents installation
|
||||
SCL_ADDLIB( ${PROJECT_NAME} "${FEDEX_OUT}" "stepdai stepcore express stepeditor steputils base" "TESTABLE" )
|
||||
add_dependencies( ${PROJECT_NAME} generate_cpp_${SCHEMA_SHORT_NAME} )
|
||||
set_target_properties( ${PROJECT_NAME} PROPERTIES COMPILE_FLAGS
|
||||
${${PROJECT_NAME}_COMPILE_FLAGS} )
|
||||
TESTABLE_TARGET( ${PROJECT_NAME} )
|
||||
|
||||
add_test( NAME generate_${SCHEMA_SHORT_NAME}
|
||||
add_test( NAME generate_cpp_${SCHEMA_SHORT_NAME}
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
COMMAND ${CMAKE_COMMAND} --build .
|
||||
--target generate_${SCHEMA_SHORT_NAME}
|
||||
--target generate_cpp_${SCHEMA_SHORT_NAME}
|
||||
--config $<CONFIGURATION> )
|
||||
add_test( NAME build_${PROJECT_NAME}
|
||||
add_test( NAME build_cpp_${PROJECT_NAME}
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
COMMAND ${CMAKE_COMMAND} --build .
|
||||
--target p21read_${PROJECT_NAME}
|
||||
--config $<CONFIGURATION> )
|
||||
|
||||
# label the tests and set dependencies
|
||||
set_tests_properties( generate_${SCHEMA_SHORT_NAME} PROPERTIES LABELS schema_gen )
|
||||
set_tests_properties( build_${PROJECT_NAME} PROPERTIES DEPENDS generate_${SCHEMA_SHORT_NAME} LABELS schema_build )
|
||||
set_tests_properties( generate_cpp_${SCHEMA_SHORT_NAME} PROPERTIES LABELS cpp_schema_gen )
|
||||
set_tests_properties( build_cpp_${PROJECT_NAME} PROPERTIES DEPENDS generate_cpp_${SCHEMA_SHORT_NAME} LABELS cpp_schema_build )
|
||||
|
||||
add_executable( p21read_${PROJECT_NAME} ${SCL_SOURCE_DIR}/src/test/p21read/p21read.cc )
|
||||
target_link_libraries( p21read_${PROJECT_NAME} ${PROJECT_NAME} )
|
||||
if(MSVC OR BORLAND)
|
||||
set( WIN_EXTRA_SRCS ${SCL_SOURCE_DIR}/src/fedex_plus/xgetopt.cc )
|
||||
endif()
|
||||
SCL_ADDEXEC( p21read_${PROJECT_NAME} "${SCL_SOURCE_DIR}/src/test/p21read/p21read.cc ${WIN_EXTRA_SRCS}" "${PROJECT_NAME}" "TESTABLE" )
|
||||
add_dependencies( p21read_${PROJECT_NAME} version_string )
|
||||
set_target_properties( p21read_${PROJECT_NAME} PROPERTIES COMPILE_FLAGS
|
||||
${${PROJECT_NAME}_COMPILE_FLAGS} )
|
||||
TESTABLE_TARGET( p21read_${PROJECT_NAME} )
|
||||
|
||||
#find all part 21 files in schema dir, add a test for each one
|
||||
get_filename_component( SCHEMA_DIR ${SCHEMA_FILE} PATH )
|
||||
file( GLOB_RECURSE P21_FILES ${SCHEMA_DIR}/*.stp ${SCHEMA_DIR}/*.step ${SCHEMA_DIR}/*.p21 )
|
||||
file( GLOB_RECURSE P21_FILES ${SCHEMA_DIR}/*.stp ${SCHEMA_DIR}/*.step ${SCHEMA_DIR}/*.p21 ${SCHEMA_DIR}/*.ifc )
|
||||
foreach( TEST_FILE ${P21_FILES} )
|
||||
get_filename_component( FNAME ${TEST_FILE} NAME_WE )
|
||||
add_test( NAME read_write_${SCHEMA_SHORT_NAME}_${FNAME}
|
||||
add_test( NAME read_write_cpp_${SCHEMA_SHORT_NAME}_${FNAME}
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
COMMAND p21read_${PROJECT_NAME} ${TEST_FILE} )
|
||||
set_tests_properties( read_write_${SCHEMA_SHORT_NAME}_${FNAME} PROPERTIES DEPENDS build_${PROJECT_NAME} LABELS schema_rw )
|
||||
set_tests_properties( read_write_cpp_${SCHEMA_SHORT_NAME}_${FNAME} PROPERTIES DEPENDS build_cpp_${PROJECT_NAME} LABELS cpp_schema_rw )
|
||||
endforeach()
|
||||
|
||||
ENDFUNCTION(BUILD_A_SCHEMA)
|
||||
|
||||
if( DEFINED BUILD_SCHEMAS )
|
||||
if( BUILD_SCHEMAS STREQUAL "ALL" )
|
||||
file( GLOB_RECURSE BUILD_SCHEMAS ${SCL_SOURCE_DIR}/data/*.exp )
|
||||
if( DEFINED SCL_BUILD_SCHEMAS )
|
||||
if( SCL_BUILD_SCHEMAS STREQUAL "ALL" )
|
||||
file( GLOB_RECURSE SCL_BUILD_SCHEMAS ${SCL_SOURCE_DIR}/data/*.exp )
|
||||
endif()
|
||||
foreach( ap ${BUILD_SCHEMAS} )
|
||||
foreach( ap ${SCL_BUILD_SCHEMAS} )
|
||||
BUILD_A_SCHEMA( ${ap} )
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -5,7 +5,7 @@
|
||||
(* The schema is converted from ISO10303 P11-2003 to ISO10303 P11-1994 *)
|
||||
(* ===================================================================================== *)
|
||||
|
||||
SCHEMA Ap210_electronic_assembly_interconnect_and_packaging_design_mim_LF;
|
||||
SCHEMA wip210_electronic_assembly_interconnect_and_packaging_design_mim_LF;
|
||||
|
||||
|
||||
CONSTANT
|
||||
@@ -15,7 +15,7 @@ CONSTANT
|
||||
|
||||
dummy_gri : geometric_representation_item := representation_item('')||
|
||||
geometric_representation_item();
|
||||
schema_prefix : STRING := 'AP210_ELECTRONIC_ASSEMBLY_INTERCONNECT_AND_PACKAGING_DESIGN_MIM_LF.';
|
||||
schema_prefix : STRING := 'WIP210_ELECTRONIC_ASSEMBLY_INTERCONNECT_AND_PACKAGING_DESIGN_MIM_LF.';
|
||||
|
||||
the_empty_maths_tuple : maths_tuple := [];
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
+12
-5
@@ -1,7 +1,14 @@
|
||||
SET(scl_MANS
|
||||
man/man1/dataprobe.1
|
||||
man/man1/fedex.1
|
||||
man/man1/fedex_plus.1
|
||||
man/man1/mkProbe.1
|
||||
man/man1/dataprobe.1
|
||||
man/man1/fedex.1
|
||||
man/man1/fedex_plus.1
|
||||
man/man1/mkProbe.1
|
||||
)
|
||||
INSTALL(FILES ${scl_MANS} DESTINATION ${MAN_DIR}/man1)
|
||||
|
||||
if(NOT DEFINED MAN_DIR)
|
||||
set(MAN_DIR share/man)
|
||||
endif(NOT DEFINED MAN_DIR)
|
||||
|
||||
IF(NOT WIN32)
|
||||
INSTALL(FILES ${scl_MANS} DESTINATION ${CMAKE_INSTALL_PREFIX}/${MAN_DIR}/man1)
|
||||
ENDIF(NOT WIN32)
|
||||
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+1
-1
@@ -37,7 +37,7 @@ PROJECT_NUMBER = 3.2
|
||||
# for a project that appears at the top of each page and should give viewer
|
||||
# a quick idea about the purpose of the project. Keep the description short.
|
||||
|
||||
PROJECT_BRIEF = "STEP Class Library"
|
||||
PROJECT_BRIEF = "STEPcode"
|
||||
|
||||
# With the PROJECT_LOGO tag one can specify an logo or icon that is
|
||||
# included in the documentation. The maximum height of the logo should not
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+2
-2
@@ -68,7 +68,7 @@
|
||||
<qtHelp collectionFile="./doc/helpcollection.qhc"
|
||||
projectFile="./doc/helpcollection.qhcp"
|
||||
storage="./doc/qch" copyAction="copy">
|
||||
<title>StepClassLibrary</title>
|
||||
<title>STEPcode</title>
|
||||
<startPage>qthelp://com.github.mpictor/doc/index.html</startPage>
|
||||
<!-- See http://doc.trolltech.com/assistant-custom-help-viewer.html for more
|
||||
settings in the <assistant> section. -->
|
||||
@@ -100,7 +100,7 @@
|
||||
-->
|
||||
<project>
|
||||
<!-- The name of the project -->
|
||||
<name>StepClassLibrary</name>
|
||||
<name>STEPcode</name>
|
||||
<!-- The version number of the documentation -->
|
||||
<version>0.2</version>
|
||||
<!-- Whether to build version specific documentation for the projects or not.
|
||||
|
||||
@@ -47,16 +47,16 @@ $mathjax
|
||||
<!-- add module list -->
|
||||
<div id="navrow0" class="tabs">
|
||||
<ul class="tablist">
|
||||
<li><a href="../../doc.StepClassLibrary/doxygen-html/index.html"><span>Main</span></a></li>
|
||||
<li><a href="../../doc.StepClassLibrary.CLDAI/doxygen-html/index.html"><span>CLDAI</span></a></li>
|
||||
<li><a href="../../doc.StepClassLibrary.CLEditor/doxygen-html/index.html"><span>CLEditor</span></a></li>
|
||||
<li><a href="../../doc.StepClassLibrary.CLProbe-ui/doxygen-html/index.html"><span>CLProbe-ui</span></a></li>
|
||||
<li><a href="../../doc.StepClassLibrary.CLStepCore/doxygen-html/index.html"><span>CLStepCore</span></a></li>
|
||||
<li><a href="../../doc.StepClassLibrary.CLUtils/doxygen-html/index.html"><span>CLUtils</span></a></li>
|
||||
<li><a href="../../doc.StepClassLibrary.ExPPP/doxygen-html/index.html"><span>ExPPP</span></a></li>
|
||||
<li><a href="../../doc.StepClassLibrary.Express/doxygen-html/index.html"><span>Express</span></a></li>
|
||||
<li><a href="../../doc.StepClassLibrary.Fedex-Plus/doxygen-html/index.html"><span>Fedex-Plus</span></a></li>
|
||||
<li><a href="../../doc.StepClassLibrary.Tests/doxygen-html/index.html"><span>Tests</span></a></li>
|
||||
<li><a href="../../doc.STEPcode/doxygen-html/index.html"><span>Main</span></a></li>
|
||||
<li><a href="../../doc.STEPcode.CLDAI/doxygen-html/index.html"><span>CLDAI</span></a></li>
|
||||
<li><a href="../../doc.STEPcode.CLEditor/doxygen-html/index.html"><span>CLEditor</span></a></li>
|
||||
<li><a href="../../doc.STEPcode.CLProbe-ui/doxygen-html/index.html"><span>CLProbe-ui</span></a></li>
|
||||
<li><a href="../../doc.STEPcode.CLStepCore/doxygen-html/index.html"><span>CLStepCore</span></a></li>
|
||||
<li><a href="../../doc.STEPcode.CLUtils/doxygen-html/index.html"><span>CLUtils</span></a></li>
|
||||
<li><a href="../../doc.STEPcode.ExPPP/doxygen-html/index.html"><span>ExPPP</span></a></li>
|
||||
<li><a href="../../doc.STEPcode.Express/doxygen-html/index.html"><span>Express</span></a></li>
|
||||
<li><a href="../../doc.STEPcode.Fedex-Plus/doxygen-html/index.html"><span>Fedex-Plus</span></a></li>
|
||||
<li><a href="../../doc.STEPcode.Tests/doxygen-html/index.html"><span>Tests</span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- end module list -->
|
||||
|
||||
Binary file not shown.
+49
-48
@@ -1,57 +1,58 @@
|
||||
extern int exppp_nesting_indent; /* default nesting indent */
|
||||
extern int exppp_continuation_indent; /* default nesting indent for */
|
||||
#include <scl_export.h>
|
||||
|
||||
extern SCL_EXPPP_EXPORT int exppp_nesting_indent; /* default nesting indent */
|
||||
extern SCL_EXPPP_EXPORT int exppp_continuation_indent; /* default nesting indent for */
|
||||
/* continuation lines */
|
||||
extern int exppp_linelength; /* leave some slop for closing */
|
||||
extern SCL_EXPPP_EXPORT int exppp_linelength; /* leave some slop for closing */
|
||||
/* parens. \n is not included in */
|
||||
/* this count either */
|
||||
extern bool exppp_rmpp; /* if true, create rmpp */
|
||||
extern bool exppp_alphabetize; /* if true, alphabetize */
|
||||
extern bool exppp_terse; /* don't describe action to stdout */
|
||||
extern bool exppp_reference_info; /* if true, add commentary */
|
||||
extern SCL_EXPPP_EXPORT bool exppp_rmpp; /* if true, create rmpp */
|
||||
extern SCL_EXPPP_EXPORT bool exppp_alphabetize; /* if true, alphabetize */
|
||||
extern SCL_EXPPP_EXPORT bool exppp_terse; /* don't describe action to stdout */
|
||||
extern SCL_EXPPP_EXPORT bool exppp_reference_info; /* if true, add commentary */
|
||||
/* about where things came from */
|
||||
extern bool exppp_preserve_comments; /* if true, preserve comments where */
|
||||
extern SCL_EXPPP_EXPORT bool exppp_preserve_comments; /* if true, preserve comments where */
|
||||
/* possible */
|
||||
extern char * exppp_output_filename; /* force output filename */
|
||||
extern bool exppp_output_filename_reset; /* if true, force output filename */
|
||||
extern SCL_EXPPP_EXPORT char * exppp_output_filename; /* force output filename */
|
||||
|
||||
void EXPRESSout( Express e );
|
||||
SCL_EXPPP_EXPORT void EXPRESSout( Express e );
|
||||
|
||||
void ENTITYout( Entity e );
|
||||
void EXPRout( Expression expr );
|
||||
void FUNCout( Function f );
|
||||
void PROCout( Procedure p );
|
||||
void RULEout( Rule r );
|
||||
char * SCHEMAout( Schema s );
|
||||
void SCHEMAref_out( Schema s );
|
||||
void STMTout( Statement s );
|
||||
void TYPEout( Type t );
|
||||
void TYPEhead_out( Type t );
|
||||
void TYPEbody_out( Type t );
|
||||
void WHEREout( Linked_List w );
|
||||
SCL_EXPPP_EXPORT void ENTITYout( Entity e );
|
||||
SCL_EXPPP_EXPORT void EXPRout( Expression expr );
|
||||
SCL_EXPPP_EXPORT void FUNCout( Function f );
|
||||
SCL_EXPPP_EXPORT void PROCout( Procedure p );
|
||||
SCL_EXPPP_EXPORT void RULEout( Rule r );
|
||||
SCL_EXPPP_EXPORT char * SCHEMAout( Schema s );
|
||||
SCL_EXPPP_EXPORT void SCHEMAref_out( Schema s );
|
||||
SCL_EXPPP_EXPORT void STMTout( Statement s );
|
||||
SCL_EXPPP_EXPORT void TYPEout( Type t );
|
||||
SCL_EXPPP_EXPORT void TYPEhead_out( Type t );
|
||||
SCL_EXPPP_EXPORT void TYPEbody_out( Type t );
|
||||
SCL_EXPPP_EXPORT void WHEREout( Linked_List w );
|
||||
|
||||
char * REFto_string( Dictionary refdict, Linked_List reflist, char * type, int level );
|
||||
char * ENTITYto_string( Entity e );
|
||||
char * SUBTYPEto_string( Expression e );
|
||||
char * EXPRto_string( Expression expr );
|
||||
char * FUNCto_string( Function f );
|
||||
char * PROCto_string( Procedure p );
|
||||
char * RULEto_string( Rule r );
|
||||
char * SCHEMAref_to_string( Schema s );
|
||||
char * STMTto_string( Statement s );
|
||||
char * TYPEto_string( Type t );
|
||||
char * TYPEhead_to_string( Type t );
|
||||
char * TYPEbody_to_string( Type t );
|
||||
char * WHEREto_string( Linked_List w );
|
||||
SCL_EXPPP_EXPORT char * REFto_string( Dictionary refdict, Linked_List reflist, char * type, int level );
|
||||
SCL_EXPPP_EXPORT char * ENTITYto_string( Entity e );
|
||||
SCL_EXPPP_EXPORT char * SUBTYPEto_string( Expression e );
|
||||
SCL_EXPPP_EXPORT char * EXPRto_string( Expression expr );
|
||||
SCL_EXPPP_EXPORT char * FUNCto_string( Function f );
|
||||
SCL_EXPPP_EXPORT char * PROCto_string( Procedure p );
|
||||
SCL_EXPPP_EXPORT char * RULEto_string( Rule r );
|
||||
SCL_EXPPP_EXPORT char * SCHEMAref_to_string( Schema s );
|
||||
SCL_EXPPP_EXPORT char * STMTto_string( Statement s );
|
||||
SCL_EXPPP_EXPORT char * TYPEto_string( Type t );
|
||||
SCL_EXPPP_EXPORT char * TYPEhead_to_string( Type t );
|
||||
SCL_EXPPP_EXPORT char * TYPEbody_to_string( Type t );
|
||||
SCL_EXPPP_EXPORT char * WHEREto_string( Linked_List w );
|
||||
|
||||
int REFto_buffer( Dictionary refdict, Linked_List reflist, char * type, int level, char * buffer, int length );
|
||||
int ENTITYto_buffer( Entity e, char * buffer, int length );
|
||||
int EXPRto_buffer( Expression e, char * buffer, int length );
|
||||
int FUNCto_buffer( Function e, char * buffer, int length );
|
||||
int PROCto_buffer( Procedure e, char * buffer, int length );
|
||||
int RULEto_buffer( Rule e, char * buffer, int length );
|
||||
int SCHEMAref_to_buffer( Schema s, char * buffer, int length );
|
||||
int STMTto_buffer( Statement s, char * buffer, int length );
|
||||
int TYPEto_buffer( Type t, char * buffer, int length );
|
||||
int TYPEhead_to_buffer( Type t, char * buffer, int length );
|
||||
int TYPEbody_to_buffer( Type t, char * buffer, int length );
|
||||
int WHEREto_buffer( Linked_List w, char * buffer, int length );
|
||||
SCL_EXPPP_EXPORT int REFto_buffer( Dictionary refdict, Linked_List reflist, char * type, int level, char * buffer, int length );
|
||||
SCL_EXPPP_EXPORT int ENTITYto_buffer( Entity e, char * buffer, int length );
|
||||
SCL_EXPPP_EXPORT int EXPRto_buffer( Expression e, char * buffer, int length );
|
||||
SCL_EXPPP_EXPORT int FUNCto_buffer( Function e, char * buffer, int length );
|
||||
SCL_EXPPP_EXPORT int PROCto_buffer( Procedure e, char * buffer, int length );
|
||||
SCL_EXPPP_EXPORT int RULEto_buffer( Rule e, char * buffer, int length );
|
||||
SCL_EXPPP_EXPORT int SCHEMAref_to_buffer( Schema s, char * buffer, int length );
|
||||
SCL_EXPPP_EXPORT int STMTto_buffer( Statement s, char * buffer, int length );
|
||||
SCL_EXPPP_EXPORT int TYPEto_buffer( Type t, char * buffer, int length );
|
||||
SCL_EXPPP_EXPORT int TYPEhead_to_buffer( Type t, char * buffer, int length );
|
||||
SCL_EXPPP_EXPORT int TYPEbody_to_buffer( Type t, char * buffer, int length );
|
||||
SCL_EXPPP_EXPORT int WHEREto_buffer( Linked_List w, char * buffer, int length );
|
||||
|
||||
+22
-43
@@ -1,10 +1,8 @@
|
||||
#ifndef ALGORITHM_H
|
||||
#define ALGORITHM_H
|
||||
|
||||
/* $Id: alg.h,v 1.4 1997/01/21 19:17:11 dar Exp $ */
|
||||
|
||||
/************************************************************************
|
||||
** Module: Algorithm
|
||||
/** **********************************************************************
|
||||
** Module: Algorithm \file alg.h
|
||||
** Description: This module implements the Algorithm abstraction. An
|
||||
** algorithm can be a procedure, a function, or a rule. It consists
|
||||
** of a name, a return type (for functions and rules), a list of
|
||||
@@ -69,50 +67,47 @@ typedef struct Where_ * Where;
|
||||
/* hidden type definitions */
|
||||
/***************************/
|
||||
|
||||
/* each formal tag has one of these structs allocated to it */
|
||||
/* As each (real) call is resolved, the tag->type is temporarily borrowed */
|
||||
/** each formal tag has one of these structs allocated to it
|
||||
* As each (real) call is resolved, the tag->type is temporarily borrowed
|
||||
*/
|
||||
struct tag {
|
||||
char * name;
|
||||
Type type;
|
||||
};
|
||||
|
||||
/* location of fulltext of algorithm in source file */
|
||||
/** location of fulltext of algorithm in source file */
|
||||
struct FullText {
|
||||
char * filename;
|
||||
unsigned int start, end;
|
||||
};
|
||||
|
||||
/* 'parameters' are lists of lists of (type) expressions */
|
||||
/** 'parameters' are lists of lists of (type) expressions */
|
||||
struct Procedure_ {
|
||||
int pcount; /* # of parameters */
|
||||
int tag_count; /* # of different parameter tags */
|
||||
int pcount; /**< # of parameters */
|
||||
int tag_count; /**< # of different parameter tags */
|
||||
Linked_List parameters;
|
||||
Linked_List body;
|
||||
struct FullText text;
|
||||
int builtin; /* builtin if true */
|
||||
int builtin; /**< builtin if true */
|
||||
};
|
||||
|
||||
struct Function_ {
|
||||
int pcount; /* # of parameters */
|
||||
int tag_count; /* # of different parameter/return value tags */
|
||||
int pcount; /**< # of parameters */
|
||||
int tag_count; /**< # of different parameter/return value tags */
|
||||
Linked_List parameters;
|
||||
Linked_List body;
|
||||
Type return_type;
|
||||
struct FullText text;
|
||||
int builtin; /* builtin if true */
|
||||
int builtin; /**< builtin if true */
|
||||
};
|
||||
|
||||
struct Rule_ {
|
||||
Linked_List parameters;
|
||||
Linked_List body;
|
||||
struct FullText text;
|
||||
/*
|
||||
Linked_List where;
|
||||
moved to Scope - DEL 22-Jul-1993
|
||||
*/
|
||||
};
|
||||
|
||||
/* define a where clause */
|
||||
/** define a where clause */
|
||||
struct Where_ {
|
||||
Symbol * label;
|
||||
Expression expr;
|
||||
@@ -128,11 +123,11 @@ struct Where_ {
|
||||
#include "decstart.h"
|
||||
#endif /* ALGORITHM_C */
|
||||
|
||||
GLOBAL struct freelist_head ALG_fl;
|
||||
GLOBAL struct freelist_head FUNC_fl;
|
||||
GLOBAL struct freelist_head RULE_fl;
|
||||
GLOBAL struct freelist_head PROC_fl;
|
||||
GLOBAL struct freelist_head WHERE_fl;
|
||||
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head ALG_fl;
|
||||
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head FUNC_fl;
|
||||
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head RULE_fl;
|
||||
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head PROC_fl;
|
||||
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head WHERE_fl;
|
||||
|
||||
#include "de_end.h"
|
||||
|
||||
@@ -175,32 +170,16 @@ GLOBAL struct freelist_head WHERE_fl;
|
||||
#define FUNCget_return_type(f) ((f)->u.func->return_type)
|
||||
#define RULEget_where(r) ((r)->where)
|
||||
#define RULEput_where(r,w) ((r)->where = (w))
|
||||
/*
|
||||
#define RULEget_where_clause(r) ((r)->u.rule->where)
|
||||
*/
|
||||
#define WHEREget_label(w) ((w)->label)
|
||||
#define WHEREget_expression(w) ((w)->expr)
|
||||
|
||||
#if 0
|
||||
extern void ALGput_parameters PROTO( ( Algorithm, Linked_List ) );
|
||||
extern void ALGput_body PROTO( ( Algorithm, Linked_List ) );
|
||||
extern void FUNCput_return_type PROTO( ( Algorithm, Type ) );
|
||||
extern void RULEput_where_clause PROTO( ( Algorithm, Linked_List ) );
|
||||
#endif
|
||||
|
||||
/***********************/
|
||||
/* function prototypes */
|
||||
/***********************/
|
||||
|
||||
extern Scope ALGcreate PROTO( ( char ) );
|
||||
extern void ALGinitialize PROTO( ( void ) );
|
||||
extern void ALGput_full_text PROTO( ( Scope, int, int ) );
|
||||
extern SCL_EXPRESS_EXPORT Scope ALGcreate PROTO( ( char ) );
|
||||
extern SCL_EXPRESS_EXPORT void ALGinitialize PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT void ALGput_full_text PROTO( ( Scope, int, int ) );
|
||||
|
||||
/********************/
|
||||
/* inline functions */
|
||||
/********************/
|
||||
|
||||
#if supports_inline_functions || defined(ALGORITHM_C)
|
||||
#endif /* supports_inline_functions || defined(ALGORITHM_C) */
|
||||
|
||||
#endif /* ALGORITHM_H */
|
||||
|
||||
+9
-16
@@ -1,7 +1,6 @@
|
||||
#ifndef BASIC_H
|
||||
#define BASIC_H
|
||||
|
||||
/* $Id: basic.h,v 1.8 1997/10/22 16:06:28 sauderd Exp $ */
|
||||
|
||||
/*
|
||||
* This work was supported by the United States Government, and is
|
||||
@@ -72,14 +71,19 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <scl_cf.h>
|
||||
#include <scl_export.h>
|
||||
#include <stdio.h>
|
||||
|
||||
/******************************/
|
||||
/* type Boolean and constants */
|
||||
/******************************/
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifdef HAVE_STDBOOL_H
|
||||
# include <stdbool.h>
|
||||
#else
|
||||
# include <scl_stdbool.h>
|
||||
#endif
|
||||
|
||||
/************************/
|
||||
/* Generic pointer type */
|
||||
@@ -107,7 +111,7 @@ typedef int ( *intFuncptr )();
|
||||
/******************************/
|
||||
|
||||
#if !defined(static_inline)
|
||||
#if !defined(__GNUC__) || defined(__STRICT_ANSI)
|
||||
#if (!defined(__GNUC__) && !defined(__MSVC__)) || defined(__STRICT_ANSI)
|
||||
#define static_inline
|
||||
#undef supports_inline_functions
|
||||
#else
|
||||
@@ -132,7 +136,7 @@ typedef int ( *intFuncptr )();
|
||||
# define PROTO(x) x
|
||||
# else
|
||||
|
||||
# ifdef __CLCC__
|
||||
# if defined(__CLCC__) || defined(__MSVC__) || defined(__BORLAND__)
|
||||
# define PROTO(x) x
|
||||
#else
|
||||
# define PROTO(x) ()
|
||||
@@ -141,17 +145,6 @@ typedef int ( *intFuncptr )();
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/* pacify IBM's c89 */
|
||||
#if !defined(_POSIX_SOURCE)
|
||||
#define _POSIX_SOURCE
|
||||
#endif
|
||||
|
||||
/* backward compatibility */
|
||||
typedef char * String;
|
||||
#define STRINGequal(x,y) (0 == strcmp((x),(y)))
|
||||
|
||||
|
||||
#endif /* */
|
||||
|
||||
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
#ifndef CASE_ITEM_H
|
||||
#define CASE_ITEM_H
|
||||
|
||||
/* $Id: caseitem.h,v 1.3 1997/01/21 19:17:11 dar Exp $ */
|
||||
|
||||
/************************************************************************
|
||||
** Module: Case_Item
|
||||
/** **********************************************************************
|
||||
** Module: Case_Item \file caseitem.h
|
||||
** Description: This module implements the Case_Item abstraction. A
|
||||
** case item represents a single branch in a case statement; it
|
||||
** thus consists of a list of labels and a statement to execute
|
||||
@@ -78,7 +76,7 @@ struct Case_Item_ {
|
||||
#include "decstart.h"
|
||||
#endif /*CASE_ITEM_C*/
|
||||
|
||||
GLOBAL struct freelist_head CASE_IT_fl;
|
||||
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head CASE_IT_fl;
|
||||
|
||||
#include "de_end.h"
|
||||
|
||||
@@ -96,14 +94,7 @@ GLOBAL struct freelist_head CASE_IT_fl;
|
||||
#define CASE_IT_new() (struct Case_Item_ *)MEM_new(&CASE_IT_fl)
|
||||
#define CASE_IT_destroy(x) MEM_destroy(&CASE_IT_fl,(Freelist *)(Generic)x)
|
||||
|
||||
extern Case_Item CASE_ITcreate PROTO( ( Linked_List, struct Statement_ * ) );
|
||||
extern void CASE_ITinitialize PROTO( ( void ) );
|
||||
|
||||
/********************/
|
||||
/* inline functions */
|
||||
/********************/
|
||||
|
||||
#if supports_inline_functions || defined(CASE_ITEM_C)
|
||||
#endif /* supports_inline_functions || defined(CASE_ITEM_C) */
|
||||
extern SCL_EXPRESS_EXPORT Case_Item CASE_ITcreate PROTO( ( Linked_List, struct Statement_ * ) );
|
||||
extern SCL_EXPRESS_EXPORT void CASE_ITinitialize PROTO( ( void ) );
|
||||
|
||||
#endif /*CASE_ITEM_H*/
|
||||
|
||||
+14
-24
@@ -1,10 +1,8 @@
|
||||
#ifndef DICTIONARY_H
|
||||
#define DICTIONARY_H
|
||||
|
||||
/* $Id: dict.h,v 1.4 1997/01/21 19:17:11 dar Exp $ */
|
||||
|
||||
/************************************************************************
|
||||
** Module: Dictionary
|
||||
/** **********************************************************************
|
||||
** Module: Dictionary \file dict.h
|
||||
** Description: This module implements the dictionary abstraction. A
|
||||
** dictionary is a repository for a number of objects, all of which
|
||||
** can be named using the same function. A dictionary is limited to
|
||||
@@ -52,7 +50,6 @@
|
||||
|
||||
#include "hash.h"
|
||||
#include "error.h"
|
||||
#include "dict.h"
|
||||
|
||||
/************/
|
||||
/* typedefs */
|
||||
@@ -81,8 +78,7 @@ typedef HashEntry DictionaryEntry;
|
||||
#include "decstart.h"
|
||||
#endif /*DICTIONARY_C*/
|
||||
|
||||
GLOBAL char DICT_type; /* set as a side-effect of DICT lookup routines */
|
||||
/* to type of object found */
|
||||
GLOBAL SCL_EXPRESS_EXPORT char DICT_type; /**< set as a side-effect of DICT lookup routines to type of object found */
|
||||
|
||||
#include "de_end.h"
|
||||
|
||||
@@ -91,12 +87,12 @@ GLOBAL char DICT_type; /* set as a side-effect of DICT lookup routines */
|
||||
/*******************************/
|
||||
|
||||
#define DICTcreate(estimated_max_size) HASHcreate(estimated_max_size)
|
||||
/* should really can DICTdo_init and rename do_type_init to do_init! */
|
||||
/** should really can DICTdo_init and rename do_type_init to do_init! */
|
||||
#define DICTdo_init(dict,de) HASHlistinit((dict),(de))
|
||||
#define DICTdo_type_init(dict,de,t) HASHlistinit_by_type((dict),(de),(t))
|
||||
#define DICTdo_end(hash_entry) HASHlistend(hash_entry)
|
||||
|
||||
/* modify dictionary entry in-place */
|
||||
/** modify dictionary entry in-place */
|
||||
#define DICTchange(e,obj,sym,typ) { \
|
||||
(e)->data = (obj); \
|
||||
(e)->symbol = (sym); \
|
||||
@@ -109,20 +105,14 @@ GLOBAL char DICT_type; /* set as a side-effect of DICT lookup routines */
|
||||
/* function prototypes */
|
||||
/***********************/
|
||||
|
||||
extern void DICTinitialize PROTO( ( void ) );
|
||||
extern int DICTdefine PROTO( ( Dictionary, char *, Generic, Symbol *, char ) );
|
||||
extern int DICT_define PROTO( ( Dictionary, char *, Generic, Symbol *, char ) );
|
||||
extern void DICTundefine PROTO( ( Dictionary, char * ) );
|
||||
extern Generic DICTlookup PROTO( ( Dictionary, char * ) );
|
||||
extern Generic DICTlookup_symbol PROTO( ( Dictionary, char *, Symbol ** ) );
|
||||
extern Generic DICTdo PROTO( ( DictionaryEntry * ) );
|
||||
extern void DICTprint PROTO( ( Dictionary ) );
|
||||
|
||||
/********************/
|
||||
/* inline functions */
|
||||
/********************/
|
||||
|
||||
#if supports_inline_functions || defined(DICTIONARY_C)
|
||||
#endif /*supports_inline_functions || defined(DICTIONARY_C)*/
|
||||
extern SCL_EXPRESS_EXPORT void DICTinitialize PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT void DICTcleanup PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT int DICTdefine PROTO( ( Dictionary, char *, Generic, Symbol *, char ) );
|
||||
extern SCL_EXPRESS_EXPORT int DICT_define PROTO( ( Dictionary, char *, Generic, Symbol *, char ) );
|
||||
extern SCL_EXPRESS_EXPORT void DICTundefine PROTO( ( Dictionary, char * ) );
|
||||
extern SCL_EXPRESS_EXPORT Generic DICTlookup PROTO( ( Dictionary, char * ) );
|
||||
extern SCL_EXPRESS_EXPORT Generic DICTlookup_symbol PROTO( ( Dictionary, char *, Symbol ** ) );
|
||||
extern SCL_EXPRESS_EXPORT Generic DICTdo PROTO( ( DictionaryEntry * ) );
|
||||
extern SCL_EXPRESS_EXPORT void DICTprint PROTO( ( Dictionary ) );
|
||||
|
||||
#endif /*DICTIONARY_H*/
|
||||
|
||||
+31
-60
@@ -1,10 +1,8 @@
|
||||
#ifndef ENTITY_H
|
||||
#define ENTITY_H
|
||||
|
||||
/* $Id: entity.h,v 1.12 1997/01/21 19:17:11 dar Exp $ */
|
||||
|
||||
/************************************************************************
|
||||
** Module: Entity
|
||||
/** **********************************************************************
|
||||
** Module: Entity \file entity.h
|
||||
** Description: This module represents Express entity definitions. An
|
||||
** entity definition consists of a name, a list of attributes, a
|
||||
** collection of uniqueness sets, a specification of the entity's
|
||||
@@ -62,6 +60,7 @@
|
||||
/* packages used */
|
||||
/*****************/
|
||||
|
||||
#include <scl_export.h>
|
||||
#include "expbasic.h" /* get basic definitions */
|
||||
#include "symbol.h"
|
||||
#include "scope.h"
|
||||
@@ -85,25 +84,18 @@ typedef struct Scope_ * Entity;
|
||||
/***************************/
|
||||
|
||||
struct Entity_ {
|
||||
Linked_List supertype_symbols; /* linked list of original symbols*/
|
||||
/* as generated by parser */
|
||||
Linked_List supertypes; /* linked list of supertypes (as entities) */
|
||||
Linked_List subtypes; /* simple list of subtypes */
|
||||
/* useful for simple lookups */
|
||||
Expression subtype_expression; /* DAG of subtypes, with complete */
|
||||
/* information including, OR, AND, and ONEOF */
|
||||
Linked_List attributes; /* explicit attributes */
|
||||
int inheritance; /* total number of attributes */
|
||||
/* inherited from supertypes */
|
||||
int attribute_count;
|
||||
Linked_List unique; /* list of identifiers that are unique */
|
||||
Linked_List instances; /* hook for applications */
|
||||
int mark; /* usual hack - prevent traversing sub/super */
|
||||
/* graph twice */
|
||||
bool abstract;/* is this an abstract supertype? */
|
||||
Type type; /* type pointing back to ourself */
|
||||
/* Useful to have when evaluating */
|
||||
/* expressions involving entities */
|
||||
Linked_List supertype_symbols; /**< linked list of original symbols as generated by parser */
|
||||
Linked_List supertypes; /**< linked list of supertypes (as entities) */
|
||||
Linked_List subtypes; /**< simple list of subtypes useful for simple lookups */
|
||||
Expression subtype_expression; /**< DAG of subtypes, with complete information including, OR, AND, and ONEOF */
|
||||
Linked_List attributes; /**< explicit attributes */
|
||||
int inheritance; /**< total number of attributes inherited from supertypes */
|
||||
int attribute_count;
|
||||
Linked_List unique; /**< list of identifiers that are unique */
|
||||
Linked_List instances; /**< hook for applications */
|
||||
int mark; /**< usual hack - prevent traversing sub/super graph twice */
|
||||
bool abstract; /**< is this an abstract supertype? */
|
||||
Type type; /**< type pointing back to ourself, useful to have when evaluating expressions involving entities */
|
||||
};
|
||||
|
||||
/********************/
|
||||
@@ -116,9 +108,9 @@ struct Entity_ {
|
||||
#include "decstart.h"
|
||||
#endif /* ENTITY_C */
|
||||
|
||||
GLOBAL struct freelist_head ENTITY_fl;
|
||||
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head ENTITY_fl;
|
||||
|
||||
GLOBAL int ENTITY_MARK INITIALLY( 0 );
|
||||
GLOBAL SCL_EXPRESS_EXPORT int ENTITY_MARK INITIALLY( 0 );
|
||||
|
||||
#include "de_end.h"
|
||||
|
||||
@@ -157,40 +149,19 @@ GLOBAL int ENTITY_MARK INITIALLY( 0 );
|
||||
/* function prototypes */
|
||||
/***********************/
|
||||
|
||||
extern struct Scope_ * ENTITYcreate PROTO( ( struct Symbol_ * ) );
|
||||
extern void ENTITYinitialize PROTO( ( void ) );
|
||||
extern void ENTITYadd_attribute PROTO( ( struct Scope_ *, struct Variable_ * ) );
|
||||
extern struct Scope_ * ENTITYcopy PROTO( ( struct Scope_ * ) );
|
||||
extern Entity ENTITYfind_inherited_entity PROTO( ( struct Scope_ *, char *, int ) );
|
||||
extern Variable ENTITYfind_inherited_attribute PROTO( ( struct Scope_ *, char *, struct Symbol_ ** ) );
|
||||
extern Variable ENTITYresolve_attr_ref PROTO( ( Entity, Symbol *, Symbol * ) );
|
||||
extern bool ENTITYhas_immediate_supertype PROTO( ( Entity, Entity ) );
|
||||
extern Variable ENTITYget_named_attribute PROTO( ( Entity, char * ) );
|
||||
extern Linked_List ENTITYget_all_attributes PROTO( ( Entity ) );
|
||||
extern bool ENTITYhas_supertype PROTO( ( Entity, Entity ) );
|
||||
extern void ENTITYadd_instance PROTO( ( Entity, Generic ) );
|
||||
extern int ENTITYget_initial_offset PROTO( ( Entity ) );
|
||||
extern bool ENTITYdeclares_variable PROTO( ( Entity, struct Variable_ * ) );
|
||||
|
||||
#if 0
|
||||
extern void ENTITYdelete_instance PROTO( ( Entity, Generic ) );
|
||||
extern bool ENTITYhas_subtype PROTO( ( Entity, Entity ) );
|
||||
extern Entity ENTITYget_supertype PROTO( ( Entity, String ) );
|
||||
extern Entity ENTITYget_subtype PROTO( ( Entity, String ) );
|
||||
extern bool ENTITYhas_immediate_subtype PROTO( ( Entity, Entity ) );
|
||||
extern Expression ENTITYget_subtype_expression PROTO( ( Entity ) );
|
||||
extern int ENTITYget_attribute_offset PROTO( ( Entity, Variable ) );
|
||||
extern int ENTITYget_named_attribute_offset PROTO( ( Entity, String ) );
|
||||
extern Linked_List ENTITYget_uniqueness_list PROTO( ( Entity ) );
|
||||
extern Linked_List ENTITYget_constraints PROTO( ( Entity ) );
|
||||
extern Linked_List ENTITYget_instances PROTO( ( Entity ) );
|
||||
#endif /*0*/
|
||||
|
||||
/********************/
|
||||
/* inline functions */
|
||||
/********************/
|
||||
|
||||
#if supports_inline_functions || defined(ENTITY_C)
|
||||
#endif /* supports_inline_functions || defined(ENTITY_C) */
|
||||
extern SCL_EXPRESS_EXPORT struct Scope_ * ENTITYcreate PROTO( ( struct Symbol_ * ) );
|
||||
extern SCL_EXPRESS_EXPORT void ENTITYinitialize PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT void ENTITYadd_attribute PROTO( ( struct Scope_ *, struct Variable_ * ) );
|
||||
extern SCL_EXPRESS_EXPORT struct Scope_ * ENTITYcopy PROTO( ( struct Scope_ * ) );
|
||||
extern SCL_EXPRESS_EXPORT Entity ENTITYfind_inherited_entity PROTO( ( struct Scope_ *, char *, int ) );
|
||||
extern SCL_EXPRESS_EXPORT Variable ENTITYfind_inherited_attribute PROTO( ( struct Scope_ *, char *, struct Symbol_ ** ) );
|
||||
extern SCL_EXPRESS_EXPORT Variable ENTITYresolve_attr_ref PROTO( ( Entity, Symbol *, Symbol * ) );
|
||||
extern SCL_EXPRESS_EXPORT bool ENTITYhas_immediate_supertype PROTO( ( Entity, Entity ) );
|
||||
extern SCL_EXPRESS_EXPORT Variable ENTITYget_named_attribute PROTO( ( Entity, char * ) );
|
||||
extern SCL_EXPRESS_EXPORT Linked_List ENTITYget_all_attributes PROTO( ( Entity ) );
|
||||
extern SCL_EXPRESS_EXPORT bool ENTITYhas_supertype PROTO( ( Entity, Entity ) );
|
||||
extern SCL_EXPRESS_EXPORT void ENTITYadd_instance PROTO( ( Entity, Generic ) );
|
||||
extern SCL_EXPRESS_EXPORT int ENTITYget_initial_offset PROTO( ( Entity ) );
|
||||
extern SCL_EXPRESS_EXPORT bool ENTITYdeclares_variable PROTO( ( Entity, struct Variable_ * ) );
|
||||
|
||||
#endif /* ENTITY_H */
|
||||
|
||||
+58
-59
@@ -1,10 +1,8 @@
|
||||
#ifndef ERROR_H
|
||||
#define ERROR_H
|
||||
|
||||
/* $Id: error.h,v 1.8 1997/01/21 19:16:55 dar Exp $ */
|
||||
|
||||
/************************************************************************
|
||||
** Module: Error
|
||||
/** **********************************************************************
|
||||
** Module: Error \file error.h
|
||||
** Description: This module implements the ERROR abstraction.
|
||||
************************************************************************/
|
||||
|
||||
@@ -30,8 +28,9 @@
|
||||
* prettied up interface to print_objects_when_running
|
||||
*/
|
||||
|
||||
#include <scl_export.h>
|
||||
#include "basic.h" /* get basic definitions */
|
||||
#include "setjmp.h"
|
||||
#include <setjmp.h>
|
||||
|
||||
/*************/
|
||||
/* constants */
|
||||
@@ -88,29 +87,29 @@ typedef struct Error_Warning_ {
|
||||
#include "decstart.h"
|
||||
#endif /* ERROR_C */
|
||||
|
||||
GLOBAL bool __ERROR_buffer_errors INITIALLY( false );
|
||||
GLOBAL char * current_filename INITIALLY( "stdin" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT bool __ERROR_buffer_errors INITIALLY( false );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * current_filename INITIALLY( "stdin" );
|
||||
|
||||
/* flag to remember whether non-warning errors have occurred */
|
||||
GLOBAL bool ERRORoccurred INITIALLY( false );
|
||||
GLOBAL SCL_EXPRESS_EXPORT bool ERRORoccurred INITIALLY( false );
|
||||
|
||||
|
||||
GLOBAL Error experrc INITIALLY( ERROR_none );
|
||||
GLOBAL Error ERROR_subordinate_failed INITIALLY( ERROR_none );
|
||||
GLOBAL Error ERROR_syntax_expecting INITIALLY( ERROR_none );
|
||||
GLOBAL SCL_EXPRESS_EXPORT Error experrc INITIALLY( ERROR_none );
|
||||
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_subordinate_failed INITIALLY( ERROR_none );
|
||||
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_syntax_expecting INITIALLY( ERROR_none );
|
||||
|
||||
/* all of these are 1 if true, 0 if false switches */
|
||||
/* for debugging fedex */
|
||||
GLOBAL int ERRORdebugging INITIALLY( 0 );
|
||||
GLOBAL SCL_EXPRESS_EXPORT int ERRORdebugging INITIALLY( 0 );
|
||||
/* for debugging malloc during resolution */
|
||||
GLOBAL int malloc_debug_resolve INITIALLY( 0 );
|
||||
GLOBAL SCL_EXPRESS_EXPORT int malloc_debug_resolve INITIALLY( 0 );
|
||||
/* for debugging yacc/lex */
|
||||
GLOBAL int debug INITIALLY( 0 );
|
||||
GLOBAL SCL_EXPRESS_EXPORT int debug INITIALLY( 0 );
|
||||
|
||||
GLOBAL struct Linked_List_ * ERRORwarnings;
|
||||
GLOBAL struct freelist_head ERROR_OPT_fl;
|
||||
GLOBAL SCL_EXPRESS_EXPORT struct Linked_List_ * ERRORwarnings;
|
||||
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head ERROR_OPT_fl;
|
||||
|
||||
GLOBAL void ( *ERRORusage_function ) PROTO( ( void ) );
|
||||
GLOBAL SCL_EXPRESS_EXPORT void ( *ERRORusage_function ) PROTO( ( void ) );
|
||||
|
||||
#include "de_end.h"
|
||||
|
||||
@@ -121,6 +120,14 @@ GLOBAL void ( *ERRORusage_function ) PROTO( ( void ) );
|
||||
#define ERROR_OPT_new() (struct Error_Warning_ *)MEM_new(&ERROR_OPT_fl)
|
||||
#define ERROR_OPT_destroy(x) MEM_destroy(&ERROR_OPT_fl,(Freelist *)(Generic)x)
|
||||
|
||||
/***********************/
|
||||
/* function prototypes */
|
||||
/***********************/
|
||||
|
||||
#if defined(__MSVC__) || defined(__BORLAND__)
|
||||
extern SCL_EXPRESS_EXPORT void ERROR_start_message_buffer PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT void ERROR_flush_message_buffer PROTO( ( void ) );
|
||||
#endif
|
||||
|
||||
/********************/
|
||||
/* Inline functions */
|
||||
@@ -128,34 +135,27 @@ GLOBAL void ( *ERRORusage_function ) PROTO( ( void ) );
|
||||
|
||||
#if supports_inline_functions || defined(ERROR_C)
|
||||
|
||||
static_inline
|
||||
void
|
||||
ERRORdisable( Error error ) {
|
||||
static_inline void ERRORdisable( Error error ) {
|
||||
if( error != ERROR_none ) {
|
||||
error->enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
static_inline
|
||||
void
|
||||
ERRORenable( Error error ) {
|
||||
static_inline void ERRORenable( Error error ) {
|
||||
if( error != ERROR_none ) {
|
||||
error->enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
static_inline
|
||||
bool
|
||||
ERRORis_enabled( Error error ) {
|
||||
static_inline bool ERRORis_enabled( Error error ) {
|
||||
return error->enabled;
|
||||
}
|
||||
|
||||
static_inline
|
||||
void
|
||||
ERRORbuffer_messages( bool flag ) {
|
||||
static_inline void ERRORbuffer_messages( bool flag ) {
|
||||
#if !defined(__MSVC__) && !defined(__BORLAND__)
|
||||
extern void ERROR_start_message_buffer( void ),
|
||||
ERROR_flush_message_buffer( void );
|
||||
|
||||
#endif
|
||||
__ERROR_buffer_errors = flag;
|
||||
if( __ERROR_buffer_errors ) {
|
||||
ERROR_start_message_buffer();
|
||||
@@ -164,11 +164,11 @@ ERRORbuffer_messages( bool flag ) {
|
||||
}
|
||||
}
|
||||
|
||||
static_inline
|
||||
void
|
||||
ERRORflush_messages( void ) {
|
||||
static_inline void ERRORflush_messages( void ) {
|
||||
#if !defined(__MSVC__) && !defined(__BORLAND__)
|
||||
extern void ERROR_start_message_buffer( void ),
|
||||
ERROR_flush_message_buffer( void );
|
||||
#endif
|
||||
|
||||
if( __ERROR_buffer_errors ) {
|
||||
ERROR_flush_message_buffer();
|
||||
@@ -182,33 +182,32 @@ ERRORflush_messages( void ) {
|
||||
/* function prototypes */
|
||||
/***********************/
|
||||
|
||||
extern void ERRORinitialize PROTO( ( void ) );
|
||||
extern void ERRORinitialize_after_LIST PROTO( ( void ) );
|
||||
extern void ERRORnospace PROTO( ( void ) );
|
||||
extern void ERRORabort PROTO( ( int ) );
|
||||
extern Error ERRORcreate PROTO( ( char *, Severity ) );
|
||||
extern void ERRORreport PROTO( ( Error, ... ) );
|
||||
/*SUPPRESS 652*/ /* 1.? */
|
||||
/*SUPPRESS 842*/ /* 4.0.2 */
|
||||
extern SCL_EXPRESS_EXPORT void ERRORinitialize PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT void ERRORinitialize_after_LIST PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT void ERRORcleanup PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT void ERRORnospace PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT void ERRORabort PROTO( ( int ) );
|
||||
extern SCL_EXPRESS_EXPORT Error ERRORcreate PROTO( ( char *, Severity ) );
|
||||
extern SCL_EXPRESS_EXPORT void ERRORreport PROTO( ( Error, ... ) );
|
||||
extern SCL_EXPRESS_EXPORT void ERRORdestroy PROTO( ( Error ) );
|
||||
|
||||
struct Symbol_; /* mention Symbol to avoid warning on following line */
|
||||
extern void ERRORreport_with_symbol PROTO( ( Error, struct Symbol_ *, ... ) );
|
||||
extern void ERRORreport_with_line PROTO( ( Error, int, ... ) );
|
||||
extern void ERRORbuffer_messages PROTO( ( bool ) );
|
||||
extern void ERRORflush_messages PROTO( ( void ) );
|
||||
|
||||
extern void ERROR_start_message_buffer PROTO( ( void ) );
|
||||
extern void ERROR_flush_message_buffer PROTO( ( void ) );
|
||||
|
||||
extern void ERRORcreate_warning PROTO( ( char *, Error ) );
|
||||
extern void ERRORset_warning PROTO( ( char *, int ) );
|
||||
extern void ERRORset_all_warnings PROTO( ( int ) );
|
||||
extern void ERRORsafe PROTO( ( jmp_buf env ) );
|
||||
extern void ERRORunsafe PROTO( ( void ) );
|
||||
|
||||
#if deprecated
|
||||
extern void ERRORdisable PROTO( ( Error ) );
|
||||
extern void ERRORenable PROTO( ( Error ) );
|
||||
extern Boolean ERRORis_enabled PROTO( ( Error ) );
|
||||
extern SCL_EXPRESS_EXPORT void ERRORreport_with_symbol PROTO( ( Error, struct Symbol_ *, ... ) );
|
||||
extern SCL_EXPRESS_EXPORT void ERRORreport_with_line PROTO( ( Error, int, ... ) );
|
||||
#if !supports_inline_functions
|
||||
extern SCL_EXPRESS_EXPORT void ERRORbuffer_messages PROTO( ( bool ) );
|
||||
extern SCL_EXPRESS_EXPORT void ERRORflush_messages PROTO( ( void ) );
|
||||
#endif
|
||||
|
||||
#if !defined(__MSVC__) && !defined(__BORLAND__)
|
||||
extern SCL_EXPRESS_EXPORT void ERROR_start_message_buffer PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT void ERROR_flush_message_buffer PROTO( ( void ) );
|
||||
#endif
|
||||
|
||||
extern SCL_EXPRESS_EXPORT void ERRORcreate_warning PROTO( ( char *, Error ) );
|
||||
extern SCL_EXPRESS_EXPORT void ERRORset_warning PROTO( ( char *, int ) );
|
||||
extern SCL_EXPRESS_EXPORT void ERRORset_all_warnings PROTO( ( int ) );
|
||||
extern SCL_EXPRESS_EXPORT void ERRORsafe PROTO( ( jmp_buf env ) );
|
||||
extern SCL_EXPRESS_EXPORT void ERRORunsafe PROTO( ( void ) );
|
||||
|
||||
#endif /* ERROR_H */
|
||||
|
||||
+29
-33
@@ -1,4 +1,3 @@
|
||||
/* $Id: expbasic.h,v 1.7 1997/01/21 19:17:11 dar Exp $ */
|
||||
|
||||
/*
|
||||
* This software was developed by U.S. Government employees as part of
|
||||
@@ -72,84 +71,81 @@ typedef char * Binary;
|
||||
#define UNRESOLVED 0x0
|
||||
#define RESOLVED 0x1
|
||||
#define RESOLVE_FAILED 0x2
|
||||
#define RESOLVE_IN_PROGRESS 0x4 /* only if actively being resolved */
|
||||
/* not if it's just between passes */
|
||||
#define RESOLVE_IN_PROGRESS 0x4 /**< only if actively being resolved not if it's just between passes */
|
||||
|
||||
/* used during rename resolution to catch recursive USE/REFs */
|
||||
/** used during rename resolution to catch recursive USE/REFs */
|
||||
#define is_resolve_in_progress_raw(x) ((x)->resolved & RESOLVE_IN_PROGRESS)
|
||||
#define resolve_in_progress_raw(x) (x)->resolved |= RESOLVE_IN_PROGRESS
|
||||
#define resolve_not_in_progress_raw(x) (x)->resolved &= ~RESOLVE_IN_PROGRESS
|
||||
|
||||
/* and type resolution to catch recursive types (A = B and B = A) */
|
||||
/** and type resolution to catch recursive types (A = B and B = A) */
|
||||
#define resolve_in_progress(x) (x)->symbol.resolved |= RESOLVE_IN_PROGRESS
|
||||
|
||||
/* test/set whether anything has failed resolution */
|
||||
/** test/set whether anything has failed resolution */
|
||||
#define is_resolve_failed(x) ((x)->symbol.resolved & RESOLVE_FAILED)
|
||||
#define is_resolve_failed_raw(x) ((x)->resolved & RESOLVE_FAILED)
|
||||
#define resolve_failed(x) (x)->symbol.resolved |= RESOLVE_FAILED
|
||||
#define resolve_failed_raw(x) (x)->resolved |= RESOLVE_FAILED
|
||||
|
||||
/* test/set whether anything has succeeded resolution */
|
||||
/** test/set whether anything has succeeded resolution */
|
||||
#define is_resolved(x) ((x)->symbol.resolved & RESOLVED)
|
||||
|
||||
/* test possibility of future resolution */
|
||||
/** test possibility of future resolution */
|
||||
#define is_resolvable(x) (!is_not_resolvable(x))
|
||||
#define is_not_resolvable(x) ((x)->symbol.resolved & (RESOLVE_FAILED|RESOLVED|RESOLVE_IN_PROGRESS))
|
||||
|
||||
/* mark something resolved */
|
||||
/** mark something resolved */
|
||||
#define resolved_all(x) x->symbol.resolved = RESOLVED
|
||||
|
||||
|
||||
/* define the object types that can appear in a symbol table */
|
||||
/* basically anything that is usefully named, but that cannot be */
|
||||
/* differentiated from another type when handed a generic pointer */
|
||||
/* Entity, schema and alg can be differentiated but it is just very */
|
||||
/* useful to be able to differentiate this way. */
|
||||
#define OBJ_ANY '*' /* Matches anything - special to DICT funcs */
|
||||
#define OBJ_EXPRESS '!' /* I can't figure out the mnemonic either! */
|
||||
/** define the object types that can appear in a symbol table
|
||||
* basically anything that is usefully named, but that cannot be
|
||||
* differentiated from another type when handed a generic pointer
|
||||
* Entity, schema and alg can be differentiated but it is just very
|
||||
* useful to be able to differentiate this way. */
|
||||
#define OBJ_ANY '*' /**< Matches anything - special to DICT funcs */
|
||||
#define OBJ_EXPRESS '!' /**< I can't figure out the mnemonic either! */
|
||||
#define OBJ_PASS '#'
|
||||
|
||||
/* The following are all odd-ball scopes, that aren't ever looked up by */
|
||||
/* type - but the data structures might as well be descriptive */
|
||||
/** The following are all odd-ball scopes, that aren't ever looked up by
|
||||
* type - but the data structures might as well be descriptive */
|
||||
#define OBJ_INCREMENT '+'
|
||||
#define OBJ_ALIAS 'a'
|
||||
#define OBJ_QUERY 'q' /* isn't even stored anywhere! */
|
||||
#define OBJ_QUERY 'q' /**< isn't even stored anywhere! */
|
||||
|
||||
#define OBJ_PROCEDURE 'p'
|
||||
#define OBJ_RENAME 'n'
|
||||
#define OBJ_RULE 'r'
|
||||
#define OBJ_FUNCTION 'f'
|
||||
#define OBJ_TAG 'g' /* a type, but only when used as a type tag */
|
||||
#define OBJ_TAG 'g' /**< a type, but only when used as a type tag */
|
||||
#define OBJ_ENTITY 'e'
|
||||
#define OBJ_SCHEMA 's'
|
||||
#define OBJ_TYPE 't'
|
||||
#define OBJ_UNKNOWN 'u' /*things that won't ever be looked up by type*/
|
||||
#define OBJ_UNKNOWN 'u' /**< things that won't ever be looked up by type*/
|
||||
#define OBJ_VARIABLE 'v'
|
||||
#define OBJ_WHERE 'w'
|
||||
#define OBJ_EXPRESSION 'x' /* so far only enums get looked up by name & */
|
||||
#define OBJ_ENUM 'x' /* appear this way, perhaps they should be */
|
||||
/* variables? */
|
||||
#define OBJ_AMBIG_ENUM 'z' /* enumerations of the same name which are */
|
||||
/* visible in the same scope when qualified */
|
||||
/* z is of no mnemonic significance (so far) */
|
||||
#define OBJ_EXPRESSION 'x' /**< so far only enums get looked up by name & */
|
||||
#define OBJ_ENUM 'x' /**< appear this way, perhaps they should be variables? */
|
||||
#define OBJ_AMBIG_ENUM 'z' /**< enumerations of the same name which are
|
||||
* visible in the same scope when qualified
|
||||
* z is of no mnemonic significance (so far) */
|
||||
#define IS_ENUM(x) (((x) == OBJ_ENUM) || ((x) == OBJ_AMBIG_ENUM))
|
||||
|
||||
/* these represent a different way of selecting classes of objects */
|
||||
/* these are particularly useful when looking for multiple types concurrently */
|
||||
/** these represent a different way of selecting classes of objects
|
||||
* these are particularly useful when looking for multiple types concurrently */
|
||||
#define OBJ_TYPE_BITS 0x1
|
||||
#define OBJ_ENTITY_BITS 0x2
|
||||
#define OBJ_FUNCTION_BITS 0x4
|
||||
#define OBJ_PROCEDURE_BITS 0x8
|
||||
#define OBJ_PASS_BITS 0x10 /* i.e., EXPRESSpass */
|
||||
#define OBJ_PASS_BITS 0x10 /**< i.e., EXPRESSpass */
|
||||
#define OBJ_RULE_BITS 0x20
|
||||
#define OBJ_EXPRESSION_BITS 0x40 /* as above, only used for */
|
||||
/* finding enums */
|
||||
#define OBJ_EXPRESSION_BITS 0x40 /**< as above, only used for finding enums */
|
||||
#define OBJ_SCHEMA_BITS 0x80
|
||||
#define OBJ_VARIABLE_BITS 0x100
|
||||
#define OBJ_WHERE_BITS 0x200
|
||||
|
||||
#define OBJ_ANYTHING_BITS 0x0fffffff
|
||||
#define OBJ_UNFINDABLE_BITS 0x10000000 /* should never be found */
|
||||
#define OBJ_UNFINDABLE_BITS 0x10000000 /**< should never be found */
|
||||
#define OBJ_ALGORITHM_BITS (OBJ_FUNCTION_BITS | OBJ_PROCEDURE_BITS | \
|
||||
OBJ_RULE_BITS)
|
||||
#define OBJ_SCOPE_BITS (OBJ_ALGORITHM_BITS | OBJ_ENTITY_BITS | \
|
||||
|
||||
+51
-57
@@ -1,10 +1,8 @@
|
||||
#ifndef EXPRESSION_H
|
||||
#define EXPRESSION_H
|
||||
|
||||
/* $Id: expr.h,v 1.4 1997/01/21 19:17:11 dar Exp $ */
|
||||
|
||||
/************************************************************************
|
||||
** Module: Expression
|
||||
/** **********************************************************************
|
||||
** Module: Expression \file expr.h
|
||||
** Description: This module implements the Expression abstraction.
|
||||
** Several types of expressions are supported: identifiers,
|
||||
** literals, operations (arithmetic, logical, array indexing,
|
||||
@@ -62,6 +60,7 @@
|
||||
/* packages used */
|
||||
/*****************/
|
||||
|
||||
#include <scl_export.h>
|
||||
#include <math.h>
|
||||
#include "expbasic.h" /* get basic definitions */
|
||||
|
||||
@@ -85,7 +84,7 @@ typedef enum {
|
||||
OP_NOT, OP_NOT_EQUAL, OP_OR,
|
||||
OP_PLUS, OP_REAL_DIV, OP_SUBCOMPONENT,
|
||||
OP_TIMES, OP_XOR, OP_UNKNOWN,
|
||||
OP_LAST /* must be last - used only to size tables */
|
||||
OP_LAST /**< must be last - used only to size tables */
|
||||
} Op_Code;
|
||||
|
||||
typedef struct Qualified_Attr Qualified_Attr;
|
||||
@@ -117,7 +116,7 @@ typedef Literal Aggregate_Literal, Integer_Literal,
|
||||
/* expression types */
|
||||
|
||||
struct Qualified_Attr {
|
||||
struct Expression_ * complex; /* complex entity instance */
|
||||
struct Expression_ * complex; /**< complex entity instance */
|
||||
Symbol * entity;
|
||||
Symbol * attribute;
|
||||
};
|
||||
@@ -131,22 +130,20 @@ struct Op_Subexpression {
|
||||
|
||||
struct Query_ {
|
||||
Variable local;
|
||||
Expression aggregate; /* set from which to test */
|
||||
Expression expression; /* logical expression */
|
||||
Expression aggregate; /**< set from which to test */
|
||||
Expression expression; /**< logical expression */
|
||||
struct Scope_ * scope;
|
||||
};
|
||||
|
||||
struct Funcall {
|
||||
struct Scope_ * function; /* can also be an entity because entities */
|
||||
/* can be called as functions */
|
||||
struct Scope_ * function; /**< can also be an entity because entities can be called as functions */
|
||||
Linked_List list;
|
||||
};
|
||||
|
||||
union expr_union {
|
||||
int integer;
|
||||
float real;
|
||||
/* char *string; find string name in symbol in Expression */
|
||||
char * attribute; /* inverse .... for 'attr' */
|
||||
char * attribute; /**< inverse .... for 'attr' */
|
||||
char * binary;
|
||||
int logical;
|
||||
bool boolean;
|
||||
@@ -156,35 +153,31 @@ union expr_union {
|
||||
/* if etype == aggregate, list of expressions */
|
||||
/* if etype == funcall, 1st element of list is funcall or entity */
|
||||
/* remaining elements are parameters */
|
||||
Linked_List list; /* aggregates (bags, lists, sets, arrays) */
|
||||
/* or lists for oneof expressions */
|
||||
Expression expression; /* derived value in derive attrs, or*/
|
||||
/* initializer in local vars, or */
|
||||
/* enumeration tags */
|
||||
/* or oneof value */
|
||||
struct Scope_ * entity; /* used by subtype exp, group expr */
|
||||
/* and self expr, some funcall's and any */
|
||||
/* expr that results in an entity */
|
||||
Variable variable; /* attribute reference */
|
||||
Linked_List list; /**< aggregates (bags, lists, sets, arrays) or lists for oneof expressions */
|
||||
Expression expression; /**< derived value in derive attrs, or
|
||||
* initializer in local vars, or
|
||||
* enumeration tags
|
||||
* or oneof value */
|
||||
struct Scope_ * entity; /**< used by subtype exp, group expr
|
||||
* and self expr, some funcall's and any
|
||||
* expr that results in an entity */
|
||||
Variable variable; /**< attribute reference */
|
||||
};
|
||||
|
||||
/** The difference between 'type' and 'return_type' is illustrated
|
||||
* by "func(a)". Here, 'type' is Type_Function while 'return_type'
|
||||
* might be Type_Integer (assuming func returns an integer). */
|
||||
struct Expression_ {
|
||||
Symbol symbol; /* contains things like funcall names */
|
||||
/* string names, binary values, */
|
||||
/* enumeration names */
|
||||
Symbol symbol; /**< contains things like funcall names, string names, binary values, enumeration names */
|
||||
Type type;
|
||||
Type return_type; /* type of value returned by expression */
|
||||
/* The difference between 'type' and 'return_type' is */
|
||||
/* illustrated by "func(a)". Here, 'type' is Type_Function */
|
||||
/* while 'return_type' might be Type_Integer (assuming func */
|
||||
/* returns an integer). */
|
||||
Type return_type; /**< type of value returned by expression */
|
||||
struct Op_Subexpression e;
|
||||
union expr_union u;
|
||||
};
|
||||
|
||||
/* indexed by the op enumeration values */
|
||||
/** indexed by the op enumeration values */
|
||||
struct EXPop_entry {
|
||||
char * token; /* literal token, e.g., "<>" */
|
||||
char * token; /**< literal token, e.g., "<>" */
|
||||
Type( *resolve ) PROTO( ( Expression, struct Scope_ * ) );
|
||||
};
|
||||
|
||||
@@ -198,23 +191,23 @@ struct EXPop_entry {
|
||||
#include "decstart.h"
|
||||
#endif /*EXPRESSION_C*/
|
||||
|
||||
GLOBAL struct EXPop_entry EXPop_table[OP_LAST];
|
||||
GLOBAL SCL_EXPRESS_EXPORT struct EXPop_entry EXPop_table[OP_LAST];
|
||||
|
||||
GLOBAL Expression LITERAL_E INITIALLY( EXPRESSION_NULL );
|
||||
GLOBAL Expression LITERAL_INFINITY INITIALLY( EXPRESSION_NULL );
|
||||
GLOBAL Expression LITERAL_PI INITIALLY( EXPRESSION_NULL );
|
||||
GLOBAL Expression LITERAL_ZERO INITIALLY( EXPRESSION_NULL );
|
||||
GLOBAL Expression LITERAL_ONE;
|
||||
GLOBAL SCL_EXPRESS_EXPORT Expression LITERAL_E INITIALLY( EXPRESSION_NULL );
|
||||
GLOBAL SCL_EXPRESS_EXPORT Expression LITERAL_INFINITY INITIALLY( EXPRESSION_NULL );
|
||||
GLOBAL SCL_EXPRESS_EXPORT Expression LITERAL_PI INITIALLY( EXPRESSION_NULL );
|
||||
GLOBAL SCL_EXPRESS_EXPORT Expression LITERAL_ZERO INITIALLY( EXPRESSION_NULL );
|
||||
GLOBAL SCL_EXPRESS_EXPORT Expression LITERAL_ONE;
|
||||
|
||||
GLOBAL Error ERROR_bad_qualification INITIALLY( ERROR_none );
|
||||
GLOBAL Error ERROR_integer_expression_expected INITIALLY( ERROR_none );
|
||||
GLOBAL Error ERROR_implicit_downcast INITIALLY( ERROR_none );
|
||||
GLOBAL Error ERROR_ambig_implicit_downcast INITIALLY( ERROR_none );
|
||||
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_bad_qualification INITIALLY( ERROR_none );
|
||||
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_integer_expression_expected INITIALLY( ERROR_none );
|
||||
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_implicit_downcast INITIALLY( ERROR_none );
|
||||
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_ambig_implicit_downcast INITIALLY( ERROR_none );
|
||||
|
||||
GLOBAL struct freelist_head EXP_fl;
|
||||
GLOBAL struct freelist_head OP_fl;
|
||||
GLOBAL struct freelist_head QUERY_fl;
|
||||
GLOBAL struct freelist_head QUAL_ATTR_fl;
|
||||
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head EXP_fl;
|
||||
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head OP_fl;
|
||||
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head QUERY_fl;
|
||||
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head QUAL_ATTR_fl;
|
||||
|
||||
#include "de_end.h"
|
||||
|
||||
@@ -244,7 +237,7 @@ GLOBAL struct freelist_head QUAL_ATTR_fl;
|
||||
#define FCALLget_parameters(e) ((e)->u.funcall.list)
|
||||
#define FCALLput_function(expr,func) ((e)->u.funcall.function = (func))
|
||||
#define FCALLget_function(e) ((e)->u.funcall.function)
|
||||
/* assumes the function is not an entity-function! */
|
||||
/** assumes the function is not an entity-function! */
|
||||
#define FCALLget_algorithm(e) ((e)->u.funcall.function->u.function->body)
|
||||
|
||||
#define INT_LITget_value(e) ((e)->u.integer)
|
||||
@@ -269,16 +262,17 @@ GLOBAL struct freelist_head QUAL_ATTR_fl;
|
||||
/* function prototypes */
|
||||
/***********************/
|
||||
|
||||
extern Expression EXPcreate PROTO( ( Type ) );
|
||||
extern Expression EXPcreate_simple PROTO( ( Type ) );
|
||||
extern Expression EXPcreate_from_symbol PROTO( ( Type, Symbol * ) );
|
||||
extern Expression UN_EXPcreate PROTO( ( Op_Code, Expression ) );
|
||||
extern Expression BIN_EXPcreate PROTO( ( Op_Code, Expression, Expression ) );
|
||||
extern Expression TERN_EXPcreate PROTO( ( Op_Code, Expression, Expression, Expression ) );
|
||||
extern Expression QUERYcreate PROTO( ( Symbol *, Expression ) );
|
||||
extern void EXPinitialize PROTO( ( void ) );
|
||||
extern Type EXPtype PROTO( ( Expression, struct Scope_ * ) );
|
||||
extern int EXPget_integer_value PROTO( ( Expression ) );
|
||||
extern SCL_EXPRESS_EXPORT Expression EXPcreate PROTO( ( Type ) );
|
||||
extern SCL_EXPRESS_EXPORT Expression EXPcreate_simple PROTO( ( Type ) );
|
||||
extern SCL_EXPRESS_EXPORT Expression EXPcreate_from_symbol PROTO( ( Type, Symbol * ) );
|
||||
extern SCL_EXPRESS_EXPORT Expression UN_EXPcreate PROTO( ( Op_Code, Expression ) );
|
||||
extern SCL_EXPRESS_EXPORT Expression BIN_EXPcreate PROTO( ( Op_Code, Expression, Expression ) );
|
||||
extern SCL_EXPRESS_EXPORT Expression TERN_EXPcreate PROTO( ( Op_Code, Expression, Expression, Expression ) );
|
||||
extern SCL_EXPRESS_EXPORT Expression QUERYcreate PROTO( ( Symbol *, Expression ) );
|
||||
extern SCL_EXPRESS_EXPORT void EXPinitialize PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT void EXPcleanup PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT Type EXPtype PROTO( ( Expression, struct Scope_ * ) );
|
||||
extern SCL_EXPRESS_EXPORT int EXPget_integer_value PROTO( ( Expression ) );
|
||||
|
||||
/********************/
|
||||
/* inline functions */
|
||||
|
||||
+158
-161
@@ -1,8 +1,6 @@
|
||||
#ifndef EXPRESS_H
|
||||
#define EXPRESS_H
|
||||
|
||||
/* $Id: express.h,v 1.13 1997/01/21 19:16:42 dar Exp $ */
|
||||
|
||||
/*
|
||||
* Express package manager.
|
||||
*
|
||||
@@ -83,7 +81,7 @@ typedef struct Scope_ * Express;
|
||||
struct Express_ {
|
||||
FILE * file;
|
||||
char * filename;
|
||||
char * basename; /* name of file but without directory or .exp suffix */
|
||||
char * basename; /**< name of file but without directory or .exp suffix */
|
||||
};
|
||||
|
||||
/********************/
|
||||
@@ -98,150 +96,158 @@ struct Express_ {
|
||||
# define INITIALLY(value)
|
||||
#endif /*EXPRESS_C*/
|
||||
|
||||
GLOBAL Linked_List EXPRESS_path;
|
||||
GLOBAL int EXPRESSpass;
|
||||
#ifdef YYDEBUG
|
||||
extern SCL_EXPRESS_EXPORT int yydebug;
|
||||
extern SCL_EXPRESS_EXPORT int yydbg_upper_limit;
|
||||
extern SCL_EXPRESS_EXPORT int yydbg_lower_limit;
|
||||
extern SCL_EXPRESS_EXPORT int yydbg_verbose;
|
||||
#endif
|
||||
|
||||
GLOBAL void ( *EXPRESSinit_args ) PROTO( ( int, char ** ) ) INITIALLY( 0 );
|
||||
GLOBAL void ( *EXPRESSinit_parse ) PROTO( ( void ) ) INITIALLY( 0 );
|
||||
GLOBAL int ( *EXPRESSfail ) PROTO( ( Express ) ) INITIALLY( 0 );
|
||||
GLOBAL int ( *EXPRESSsucceed ) PROTO( ( Express ) ) INITIALLY( 0 );
|
||||
GLOBAL void ( *EXPRESSbackend ) PROTO( ( Express ) ) INITIALLY( 0 );
|
||||
GLOBAL char * EXPRESSprogram_name;
|
||||
extern char EXPRESSgetopt_options[]; /* initialized elsewhere */
|
||||
GLOBAL int ( *EXPRESSgetopt ) PROTO( ( int, char * ) ) INITIALLY( 0 );
|
||||
GLOBAL bool EXPRESSignore_duplicate_schemas INITIALLY( false );
|
||||
GLOBAL SCL_EXPRESS_EXPORT Linked_List EXPRESS_path;
|
||||
GLOBAL SCL_EXPRESS_EXPORT int EXPRESSpass;
|
||||
|
||||
GLOBAL Dictionary EXPRESSbuiltins; /* procedures/functions */
|
||||
GLOBAL SCL_EXPRESS_EXPORT void ( *EXPRESSinit_args ) PROTO( ( int, char ** ) ) INITIALLY( 0 );
|
||||
GLOBAL SCL_EXPRESS_EXPORT void ( *EXPRESSinit_parse ) PROTO( ( void ) ) INITIALLY( 0 );
|
||||
GLOBAL SCL_EXPRESS_EXPORT int ( *EXPRESSfail ) PROTO( ( Express ) ) INITIALLY( 0 );
|
||||
GLOBAL SCL_EXPRESS_EXPORT int ( *EXPRESSsucceed ) PROTO( ( Express ) ) INITIALLY( 0 );
|
||||
GLOBAL SCL_EXPRESS_EXPORT void ( *EXPRESSbackend ) PROTO( ( Express ) ) INITIALLY( 0 );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * EXPRESSprogram_name;
|
||||
extern char EXPRESSgetopt_options[256]; /**< initialized elsewhere */
|
||||
GLOBAL SCL_EXPRESS_EXPORT int ( *EXPRESSgetopt ) PROTO( ( int, char * ) ) INITIALLY( 0 );
|
||||
GLOBAL SCL_EXPRESS_EXPORT bool EXPRESSignore_duplicate_schemas INITIALLY( false );
|
||||
|
||||
GLOBAL Error ERROR_bail_out INITIALLY( ERROR_none );
|
||||
GLOBAL Error ERROR_syntax INITIALLY( ERROR_none );
|
||||
GLOBAL Error ERROR_unlabelled_param_type INITIALLY( ERROR_none );
|
||||
GLOBAL Error ERROR_file_unreadable;
|
||||
GLOBAL Error ERROR_file_unwriteable;
|
||||
GLOBAL SCL_EXPRESS_EXPORT Dictionary EXPRESSbuiltins; /**< procedures/functions */
|
||||
|
||||
GLOBAL struct Scope_ * FUNC_NVL;
|
||||
GLOBAL struct Scope_ * FUNC_USEDIN;
|
||||
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_bail_out INITIALLY( ERROR_none );
|
||||
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_syntax INITIALLY( ERROR_none );
|
||||
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_unlabelled_param_type INITIALLY( ERROR_none );
|
||||
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_file_unreadable;
|
||||
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_file_unwriteable;
|
||||
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_warn_unsupported_lang_feat;
|
||||
|
||||
GLOBAL char * KW_ABS INITIALLY( "ABS" );
|
||||
GLOBAL char * KW_ABSTRACT INITIALLY( "ABSTRACT" );
|
||||
GLOBAL char * KW_ACOS INITIALLY( "ACOS" );
|
||||
GLOBAL char * KW_AGGREGATE INITIALLY( "AGGREGATE" );
|
||||
GLOBAL char * KW_ALIAS INITIALLY( "ALIAS" );
|
||||
GLOBAL char * KW_AND INITIALLY( "AND" );
|
||||
GLOBAL char * KW_ANDOR INITIALLY( "ANDOR" );
|
||||
GLOBAL char * KW_ARRAY INITIALLY( "ARRAY" );
|
||||
GLOBAL char * KW_AS INITIALLY( "AS" );
|
||||
GLOBAL char * KW_ASIN INITIALLY( "ASIN" );
|
||||
GLOBAL char * KW_ATAN INITIALLY( "ATAN" );
|
||||
GLOBAL char * KW_BAG INITIALLY( "BAG" );
|
||||
GLOBAL char * KW_BEGIN INITIALLY( "BEGIN" );
|
||||
GLOBAL char * KW_BINARY INITIALLY( "BINARY" );
|
||||
GLOBAL char * KW_BLENGTH INITIALLY( "BLENGTH" );
|
||||
GLOBAL char * KW_BOOLEAN INITIALLY( "BOOLEAN" );
|
||||
GLOBAL char * KW_BY INITIALLY( "BY" );
|
||||
GLOBAL char * KW_CASE INITIALLY( "CASE" );
|
||||
GLOBAL char * KW_CONST_E INITIALLY( "CONST_E" );
|
||||
GLOBAL char * KW_CONSTANT INITIALLY( "CONSTANT" );
|
||||
GLOBAL char * KW_CONTEXT INITIALLY( "CONTEXT" );
|
||||
GLOBAL char * KW_COS INITIALLY( "COS" );
|
||||
GLOBAL char * KW_DERIVE INITIALLY( "DERIVE" );
|
||||
GLOBAL char * KW_DIV INITIALLY( "DIV" );
|
||||
GLOBAL char * KW_ELSE INITIALLY( "ELSE" );
|
||||
GLOBAL char * KW_END INITIALLY( "END" );
|
||||
GLOBAL char * KW_END_ALIAS INITIALLY( "END_ALIAS" );
|
||||
GLOBAL char * KW_END_CASE INITIALLY( "END_CASE" );
|
||||
GLOBAL char * KW_END_CONSTANT INITIALLY( "END_CONSTANT" );
|
||||
GLOBAL char * KW_END_CONTEXT INITIALLY( "END_CONTEXT" );
|
||||
GLOBAL char * KW_END_ENTITY INITIALLY( "END_ENTITY" );
|
||||
GLOBAL char * KW_END_FUNCTION INITIALLY( "END_FUNCTION" );
|
||||
GLOBAL char * KW_END_IF INITIALLY( "END_IF" );
|
||||
GLOBAL char * KW_END_LOCAL INITIALLY( "END_LOCAL" );
|
||||
GLOBAL char * KW_END_MODEL INITIALLY( "END_MODEL" );
|
||||
GLOBAL char * KW_END_PROCEDURE INITIALLY( "END_PROCEDURE" );
|
||||
GLOBAL char * KW_END_REPEAT INITIALLY( "END_REPEAT" );
|
||||
GLOBAL char * KW_END_RULE INITIALLY( "END_RULE" );
|
||||
GLOBAL char * KW_END_SCHEMA INITIALLY( "END_SCHEMA" );
|
||||
GLOBAL char * KW_END_TYPE INITIALLY( "END_TYPE" );
|
||||
GLOBAL char * KW_ENTITY INITIALLY( "ENTITY" );
|
||||
GLOBAL char * KW_ENUMERATION INITIALLY( "ENUMERATION" );
|
||||
GLOBAL char * KW_ESCAPE INITIALLY( "ESCAPE" );
|
||||
GLOBAL char * KW_EXISTS INITIALLY( "EXISTS" );
|
||||
GLOBAL char * KW_EXP INITIALLY( "EXP" );
|
||||
GLOBAL char * KW_FALSE INITIALLY( "FALSE" );
|
||||
GLOBAL char * KW_FIXED INITIALLY( "FIXED" );
|
||||
GLOBAL char * KW_FOR INITIALLY( "FOR" );
|
||||
GLOBAL char * KW_FORMAT INITIALLY( "FORMAT" );
|
||||
GLOBAL char * KW_FROM INITIALLY( "FROM" );
|
||||
GLOBAL char * KW_FUNCTION INITIALLY( "FUNCTION" );
|
||||
GLOBAL char * KW_GENERIC INITIALLY( "GENERIC" );
|
||||
GLOBAL char * KW_HIBOUND INITIALLY( "HIBOUND" );
|
||||
GLOBAL char * KW_HIINDEX INITIALLY( "HIINDEX" );
|
||||
GLOBAL char * KW_IF INITIALLY( "IF" );
|
||||
GLOBAL char * KW_IN INITIALLY( "IN" );
|
||||
GLOBAL char * KW_INCLUDE INITIALLY( "INCLUDE" );
|
||||
GLOBAL char * KW_INSERT INITIALLY( "INSERT" );
|
||||
GLOBAL char * KW_INTEGER INITIALLY( "INTEGER" );
|
||||
GLOBAL char * KW_INVERSE INITIALLY( "INVERSE" );
|
||||
GLOBAL char * KW_LENGTH INITIALLY( "LENGTH" );
|
||||
GLOBAL char * KW_LIKE INITIALLY( "LIKE" );
|
||||
GLOBAL char * KW_LIST INITIALLY( "LIST" );
|
||||
GLOBAL char * KW_LOBOUND INITIALLY( "LOBOUND" );
|
||||
GLOBAL char * KW_LOCAL INITIALLY( "LOCAL" );
|
||||
GLOBAL char * KW_LOG INITIALLY( "LOG" );
|
||||
GLOBAL char * KW_LOG10 INITIALLY( "LOG10" );
|
||||
GLOBAL char * KW_LOG2 INITIALLY( "LOG2" );
|
||||
GLOBAL char * KW_LOGICAL INITIALLY( "LOGICAL" );
|
||||
GLOBAL char * KW_LOINDEX INITIALLY( "LOINDEX" );
|
||||
GLOBAL char * KW_MOD INITIALLY( "MOD" );
|
||||
GLOBAL char * KW_MODEL INITIALLY( "MODEL" );
|
||||
GLOBAL char * KW_NOT INITIALLY( "NOT" );
|
||||
GLOBAL char * KW_NUMBER INITIALLY( "NUMBER" );
|
||||
GLOBAL char * KW_NVL INITIALLY( "NVL" );
|
||||
GLOBAL char * KW_ODD INITIALLY( "ODD" );
|
||||
GLOBAL char * KW_OF INITIALLY( "OF" );
|
||||
GLOBAL char * KW_ONEOF INITIALLY( "ONEOF" );
|
||||
GLOBAL char * KW_OPTIONAL INITIALLY( "OPTIONAL" );
|
||||
GLOBAL char * KW_OR INITIALLY( "OR" );
|
||||
GLOBAL char * KW_OTHERWISE INITIALLY( "OTHERWISE" );
|
||||
GLOBAL char * KW_PI INITIALLY( "PI" );
|
||||
GLOBAL char * KW_PROCEDURE INITIALLY( "PROCEDURE" );
|
||||
GLOBAL char * KW_QUERY INITIALLY( "QUERY" );
|
||||
GLOBAL char * KW_REAL INITIALLY( "REAL" );
|
||||
GLOBAL char * KW_REFERENCE INITIALLY( "REFERENCE" );
|
||||
GLOBAL char * KW_REMOVE INITIALLY( "REMOVE" );
|
||||
GLOBAL char * KW_REPEAT INITIALLY( "REPEAT" );
|
||||
GLOBAL char * KW_RETURN INITIALLY( "RETURN" );
|
||||
GLOBAL char * KW_ROLESOF INITIALLY( "ROLESOF" );
|
||||
GLOBAL char * KW_RULE INITIALLY( "RULE" );
|
||||
GLOBAL char * KW_SCHEMA INITIALLY( "SCHEMA" );
|
||||
GLOBAL char * KW_SELECT INITIALLY( "SELECT" );
|
||||
GLOBAL char * KW_SELF INITIALLY( "SELF" );
|
||||
GLOBAL char * KW_SET INITIALLY( "SET" );
|
||||
GLOBAL char * KW_SIN INITIALLY( "SIN" );
|
||||
GLOBAL char * KW_SIZEOF INITIALLY( "SIZEOF" );
|
||||
GLOBAL char * KW_SKIP INITIALLY( "SKIP" );
|
||||
GLOBAL char * KW_SQRT INITIALLY( "SQRT" );
|
||||
GLOBAL char * KW_STRING INITIALLY( "STRING" );
|
||||
GLOBAL char * KW_SUBTYPE INITIALLY( "SUBTYPE" );
|
||||
GLOBAL char * KW_SUPERTYPE INITIALLY( "SUPERTYPE" );
|
||||
GLOBAL char * KW_TAN INITIALLY( "TAN" );
|
||||
GLOBAL char * KW_THEN INITIALLY( "THEN" );
|
||||
GLOBAL char * KW_TO INITIALLY( "TO" );
|
||||
GLOBAL char * KW_TRUE INITIALLY( "TRUE" );
|
||||
GLOBAL char * KW_TYPE INITIALLY( "TYPE" );
|
||||
GLOBAL char * KW_TYPEOF INITIALLY( "TYPEOF" );
|
||||
GLOBAL char * KW_UNIQUE INITIALLY( "UNIQUE" );
|
||||
GLOBAL char * KW_UNKNOWN INITIALLY( "UNKNOWN" );
|
||||
GLOBAL char * KW_UNTIL INITIALLY( "UNTIL" );
|
||||
GLOBAL char * KW_USE INITIALLY( "USE" );
|
||||
GLOBAL char * KW_USEDIN INITIALLY( "USEDIN" );
|
||||
GLOBAL char * KW_VALUE INITIALLY( "VALUE" );
|
||||
GLOBAL char * KW_VALUE_IN INITIALLY( "VALUE_IN" );
|
||||
GLOBAL char * KW_VALUE_UNIQUE INITIALLY( "VALUE_UNIQUE" );
|
||||
GLOBAL char * KW_VAR INITIALLY( "VAR" );
|
||||
GLOBAL char * KW_WHERE INITIALLY( "WHERE" );
|
||||
GLOBAL char * KW_WHILE INITIALLY( "WHILE" );
|
||||
GLOBAL char * KW_XOR INITIALLY( "XOR" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT struct Scope_ * FUNC_NVL;
|
||||
GLOBAL SCL_EXPRESS_EXPORT struct Scope_ * FUNC_USEDIN;
|
||||
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_ABS INITIALLY( "ABS" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_ABSTRACT INITIALLY( "ABSTRACT" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_ACOS INITIALLY( "ACOS" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_AGGREGATE INITIALLY( "AGGREGATE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_ALIAS INITIALLY( "ALIAS" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_AND INITIALLY( "AND" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_ANDOR INITIALLY( "ANDOR" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_ARRAY INITIALLY( "ARRAY" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_AS INITIALLY( "AS" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_ASIN INITIALLY( "ASIN" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_ATAN INITIALLY( "ATAN" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_BAG INITIALLY( "BAG" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_BEGIN INITIALLY( "BEGIN" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_BINARY INITIALLY( "BINARY" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_BLENGTH INITIALLY( "BLENGTH" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_BOOLEAN INITIALLY( "BOOLEAN" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_BY INITIALLY( "BY" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_CASE INITIALLY( "CASE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_CONST_E INITIALLY( "CONST_E" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_CONSTANT INITIALLY( "CONSTANT" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_CONTEXT INITIALLY( "CONTEXT" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_COS INITIALLY( "COS" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_DERIVE INITIALLY( "DERIVE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_DIV INITIALLY( "DIV" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_ELSE INITIALLY( "ELSE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_END INITIALLY( "END" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_ALIAS INITIALLY( "END_ALIAS" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_CASE INITIALLY( "END_CASE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_CONSTANT INITIALLY( "END_CONSTANT" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_CONTEXT INITIALLY( "END_CONTEXT" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_ENTITY INITIALLY( "END_ENTITY" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_FUNCTION INITIALLY( "END_FUNCTION" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_IF INITIALLY( "END_IF" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_LOCAL INITIALLY( "END_LOCAL" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_MODEL INITIALLY( "END_MODEL" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_PROCEDURE INITIALLY( "END_PROCEDURE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_REPEAT INITIALLY( "END_REPEAT" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_RULE INITIALLY( "END_RULE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_SCHEMA INITIALLY( "END_SCHEMA" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_TYPE INITIALLY( "END_TYPE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_ENTITY INITIALLY( "ENTITY" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_ENUMERATION INITIALLY( "ENUMERATION" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_ESCAPE INITIALLY( "ESCAPE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_EXISTS INITIALLY( "EXISTS" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_EXP INITIALLY( "EXP" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_FALSE INITIALLY( "FALSE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_FIXED INITIALLY( "FIXED" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_FOR INITIALLY( "FOR" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_FORMAT INITIALLY( "FORMAT" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_FROM INITIALLY( "FROM" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_FUNCTION INITIALLY( "FUNCTION" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_GENERIC INITIALLY( "GENERIC" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_HIBOUND INITIALLY( "HIBOUND" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_HIINDEX INITIALLY( "HIINDEX" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_IF INITIALLY( "IF" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_IN INITIALLY( "IN" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_INCLUDE INITIALLY( "INCLUDE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_INSERT INITIALLY( "INSERT" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_INTEGER INITIALLY( "INTEGER" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_INVERSE INITIALLY( "INVERSE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_LENGTH INITIALLY( "LENGTH" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_LIKE INITIALLY( "LIKE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_LIST INITIALLY( "LIST" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_LOBOUND INITIALLY( "LOBOUND" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_LOCAL INITIALLY( "LOCAL" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_LOG INITIALLY( "LOG" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_LOG10 INITIALLY( "LOG10" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_LOG2 INITIALLY( "LOG2" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_LOGICAL INITIALLY( "LOGICAL" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_LOINDEX INITIALLY( "LOINDEX" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_MOD INITIALLY( "MOD" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_MODEL INITIALLY( "MODEL" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_NOT INITIALLY( "NOT" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_NUMBER INITIALLY( "NUMBER" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_NVL INITIALLY( "NVL" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_ODD INITIALLY( "ODD" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_OF INITIALLY( "OF" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_ONEOF INITIALLY( "ONEOF" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_OPTIONAL INITIALLY( "OPTIONAL" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_OR INITIALLY( "OR" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_OTHERWISE INITIALLY( "OTHERWISE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_PI INITIALLY( "PI" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_PROCEDURE INITIALLY( "PROCEDURE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_QUERY INITIALLY( "QUERY" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_REAL INITIALLY( "REAL" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_REFERENCE INITIALLY( "REFERENCE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_REMOVE INITIALLY( "REMOVE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_REPEAT INITIALLY( "REPEAT" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_RETURN INITIALLY( "RETURN" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_ROLESOF INITIALLY( "ROLESOF" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_RULE INITIALLY( "RULE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_SCHEMA INITIALLY( "SCHEMA" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_SELECT INITIALLY( "SELECT" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_SELF INITIALLY( "SELF" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_SET INITIALLY( "SET" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_SIN INITIALLY( "SIN" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_SIZEOF INITIALLY( "SIZEOF" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_SKIP INITIALLY( "SKIP" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_SQRT INITIALLY( "SQRT" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_STRING INITIALLY( "STRING" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_SUBTYPE INITIALLY( "SUBTYPE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_SUPERTYPE INITIALLY( "SUPERTYPE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_TAN INITIALLY( "TAN" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_THEN INITIALLY( "THEN" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_TO INITIALLY( "TO" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_TRUE INITIALLY( "TRUE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_TYPE INITIALLY( "TYPE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_TYPEOF INITIALLY( "TYPEOF" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_UNIQUE INITIALLY( "UNIQUE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_UNKNOWN INITIALLY( "UNKNOWN" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_UNTIL INITIALLY( "UNTIL" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_USE INITIALLY( "USE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_USEDIN INITIALLY( "USEDIN" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_VALUE INITIALLY( "VALUE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_VALUE_IN INITIALLY( "VALUE_IN" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_VALUE_UNIQUE INITIALLY( "VALUE_UNIQUE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_VAR INITIALLY( "VAR" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_WHERE INITIALLY( "WHERE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_WHILE INITIALLY( "WHILE" );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * KW_XOR INITIALLY( "XOR" );
|
||||
|
||||
#undef GLOBAL
|
||||
#undef INITIALLY
|
||||
@@ -255,29 +261,20 @@ GLOBAL char * KW_XOR INITIALLY( "XOR" );
|
||||
#define EXPRESSput_basename(e,n) ((e)->u.express->basename = (n))
|
||||
#define EXPRESSput_filename(e,n) ((e)->u.express->filename = (n))
|
||||
|
||||
/********************/
|
||||
/* Inline functions */
|
||||
/********************/
|
||||
|
||||
#if supports_inline_functions || defined(EXPRESS_C)
|
||||
|
||||
#endif /*supports_inline_functions || defined(EXPRESS_C)*/
|
||||
|
||||
/***********************/
|
||||
/* function prototypes */
|
||||
/***********************/
|
||||
|
||||
extern Express EXPRESScreate PROTO( ( void ) );
|
||||
extern void EXPRESSparse PROTO( ( Express, FILE *, char * ) );
|
||||
extern void EXPRESSinitialize PROTO( ( void ) );
|
||||
extern void EXPRESSresolve PROTO( ( Express ) );
|
||||
extern char * EXPRESSversion PROTO( ( void ) );
|
||||
extern int EXPRESS_fail PROTO( ( Express ) );
|
||||
extern int EXPRESS_succeed PROTO( ( Express ) );
|
||||
extern SCL_EXPRESS_EXPORT Express EXPRESScreate PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT void EXPRESSdestroy PROTO( ( Express ) );
|
||||
extern SCL_EXPRESS_EXPORT void EXPRESSparse PROTO( ( Express, FILE *, char * ) );
|
||||
extern SCL_EXPRESS_EXPORT void EXPRESSinitialize PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT void EXPRESScleanup PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT void EXPRESSresolve PROTO( ( Express ) );
|
||||
extern SCL_EXPRESS_EXPORT char * EXPRESSversion PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT int EXPRESS_fail PROTO( ( Express ) );
|
||||
extern SCL_EXPRESS_EXPORT int EXPRESS_succeed PROTO( ( Express ) );
|
||||
extern void EXPRESSinit_init PROTO( ( void ) );
|
||||
#if 0
|
||||
extern void EXPRESSdump_model PROTO( ( Express ) );
|
||||
#endif /*0*/
|
||||
extern void build_complex( Express );
|
||||
extern SCL_EXPRESS_EXPORT void build_complex( Express );
|
||||
|
||||
#endif /*EXPRESS_H*/
|
||||
|
||||
+32
-38
@@ -1,9 +1,8 @@
|
||||
#ifndef HASH_H
|
||||
#define HASH_H
|
||||
|
||||
/* $Id: hash.h,v 1.6 1997/10/22 16:36:49 sauderd Exp $ */
|
||||
|
||||
/************************************************************************
|
||||
/** **********************************************************************
|
||||
* \file hash.h
|
||||
** Hash_Table: Hash_Table
|
||||
** Description:
|
||||
**
|
||||
@@ -90,9 +89,9 @@
|
||||
#define HASH_NULL (Hash_Table)NULL
|
||||
|
||||
#define SEGMENT_SIZE 256
|
||||
#define SEGMENT_SIZE_SHIFT 8 /* log2(SEGMENT_SIZE) */
|
||||
#define SEGMENT_SIZE_SHIFT 8 /**< log2(SEGMENT_SIZE) */
|
||||
#define DIRECTORY_SIZE 256
|
||||
#define DIRECTORY_SIZE_SHIFT 8 /* log2(DIRECTORY_SIZE) */
|
||||
#define DIRECTORY_SIZE_SHIFT 8 /**< log2(DIRECTORY_SIZE) */
|
||||
#define PRIME1 37
|
||||
#define PRIME2 1048583
|
||||
#define MAX_LOAD_FACTOR 5
|
||||
@@ -101,6 +100,7 @@
|
||||
/* packages used */
|
||||
/*****************/
|
||||
|
||||
#include <scl_export.h>
|
||||
#ifdef HASH_C
|
||||
#include <assert.h>
|
||||
#endif /*HASH_C*/
|
||||
@@ -123,42 +123,39 @@ typedef struct Element_ {
|
||||
char * key;
|
||||
char * data;
|
||||
struct Element_ * next;
|
||||
Symbol * symbol;/* for debugging hash conflicts */
|
||||
char type; /* user-supplied type */
|
||||
Symbol * symbol; /**< for debugging hash conflicts */
|
||||
char type; /**< user-supplied type */
|
||||
} * Element;
|
||||
|
||||
typedef Element * Segment;
|
||||
|
||||
typedef struct Hash_Table_ {
|
||||
#if 0
|
||||
int in_use; /* If someone is traversing the hash table */
|
||||
int in_use; /**< If someone is traversing the hash table */
|
||||
#endif
|
||||
unsigned int p; /* Next bucket to be split */
|
||||
unsigned int maxp; /* upper bound on p during expansion */
|
||||
long KeyCount; /* current # keys */
|
||||
unsigned int SegmentCount; /* current # segments */
|
||||
unsigned int p; /**< Next bucket to be split */
|
||||
unsigned int maxp; /**< upper bound on p during expansion */
|
||||
long KeyCount; /**< current # keys */
|
||||
unsigned int SegmentCount; /**< current # segments */
|
||||
unsigned int MinLoadFactor;
|
||||
unsigned int MaxLoadFactor;
|
||||
Segment Directory[DIRECTORY_SIZE];
|
||||
} * Hash_Table;
|
||||
|
||||
typedef struct {
|
||||
int i; /* segment index (i think) */
|
||||
int j; /* key index in segment (ditto) */
|
||||
Element p; /* usually the next element to be returned */
|
||||
unsigned int i; /**< segment index (i think) */
|
||||
unsigned int j; /**< key index in segment (ditto) */
|
||||
Element p; /**< usually the next element to be returned */
|
||||
Hash_Table table;
|
||||
char type;
|
||||
Element e; /* originally thought of as a place for */
|
||||
/* the caller of HASHlist to temporarily stash the return value */
|
||||
/* to allow the caller (i.e., DICTdo) to be macroized, but now */
|
||||
/* conveniently used by HASHlist, which both stores the ultimate */
|
||||
/* value here as well as returns it via the return value of HASHlist */
|
||||
Element e; /**< originally thought of as a place for
|
||||
* the caller of HASHlist to temporarily stash the return value
|
||||
* to allow the caller (i.e., DICTdo) to be macroized, but now
|
||||
* conveniently used by HASHlist, which both stores the ultimate
|
||||
* value here as well as returns it via the return value of HASHlist
|
||||
*/
|
||||
} HashEntry;
|
||||
|
||||
/****************/
|
||||
/* modules used */
|
||||
/****************/
|
||||
|
||||
/********************/
|
||||
/* global variables */
|
||||
/********************/
|
||||
@@ -171,8 +168,8 @@ typedef struct {
|
||||
# define INITIALLY(value)
|
||||
#endif /*HASH_C*/
|
||||
|
||||
GLOBAL struct freelist_head HASH_Table_fl;
|
||||
GLOBAL struct freelist_head HASH_Element_fl;
|
||||
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head HASH_Table_fl;
|
||||
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head HASH_Element_fl;
|
||||
|
||||
#undef GLOBAL
|
||||
#undef INITIALLY
|
||||
@@ -185,7 +182,7 @@ GLOBAL struct freelist_head HASH_Element_fl;
|
||||
** Fast arithmetic, relying on powers of 2
|
||||
*/
|
||||
|
||||
/*
|
||||
/**
|
||||
The centerline compiler was having problems with MUL and DIV. Where DIV
|
||||
was called like this DIV(NewAddress, SEGMENT_SIZE) it is now being called like
|
||||
DIV(NewAddress, SEGMENT_SIZE_SHIFT). The compiler was mentioning some kind of
|
||||
@@ -211,16 +208,13 @@ This change only seems to have affected hash.h and hash.c
|
||||
/* function prototypes */
|
||||
/***********************/
|
||||
|
||||
extern void HASHinitialize PROTO( ( void ) );
|
||||
extern Hash_Table HASHcreate PROTO( ( unsigned ) );
|
||||
extern Hash_Table HASHcopy PROTO( ( Hash_Table ) );
|
||||
extern void HASHdestroy PROTO( ( Hash_Table ) );
|
||||
extern Element HASHsearch PROTO( ( Hash_Table, Element, Action ) );
|
||||
extern void HASHlistinit PROTO( ( Hash_Table, HashEntry * ) );
|
||||
extern void HASHlistinit_by_type PROTO( ( Hash_Table, HashEntry *, char ) );
|
||||
extern Element HASHlist PROTO( ( HashEntry * ) );
|
||||
#if 0
|
||||
extern void HASHlistend PROTO( ( HashEntry * ) );
|
||||
#endif
|
||||
extern SCL_EXPRESS_EXPORT void HASHinitialize PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT Hash_Table HASHcreate PROTO( ( unsigned ) );
|
||||
extern SCL_EXPRESS_EXPORT Hash_Table HASHcopy PROTO( ( Hash_Table ) );
|
||||
extern SCL_EXPRESS_EXPORT void HASHdestroy PROTO( ( Hash_Table ) );
|
||||
extern SCL_EXPRESS_EXPORT Element HASHsearch PROTO( ( Hash_Table, Element, Action ) );
|
||||
extern SCL_EXPRESS_EXPORT void HASHlistinit PROTO( ( Hash_Table, HashEntry * ) );
|
||||
extern SCL_EXPRESS_EXPORT void HASHlistinit_by_type PROTO( ( Hash_Table, HashEntry *, char ) );
|
||||
extern SCL_EXPRESS_EXPORT Element HASHlist PROTO( ( HashEntry * ) );
|
||||
|
||||
#endif /*HASH_H*/
|
||||
|
||||
+35
-32
@@ -1,8 +1,6 @@
|
||||
#ifndef LEX_ACTIONS_H
|
||||
#define LEX_ACTIONS_H
|
||||
|
||||
/* $Id: lexact.h,v 1.5 1995/04/05 13:55:40 clark dec96 $ */
|
||||
|
||||
/*
|
||||
* This software was developed by U.S. Government employees as part of
|
||||
* their official duties and is not subject to copyright.
|
||||
@@ -40,6 +38,7 @@
|
||||
/* packages used */
|
||||
/*****************/
|
||||
|
||||
#include <scl_export.h>
|
||||
#include <ctype.h>
|
||||
#include "basic.h"
|
||||
#include "error.h"
|
||||
@@ -77,19 +76,19 @@ typedef struct Scan_Buffer {
|
||||
# define INITIALLY(value)
|
||||
#endif /* LEX_ACTIONS_C */
|
||||
|
||||
GLOBAL Scan_Buffer SCAN_buffers[SCAN_NESTING_DEPTH];
|
||||
GLOBAL int SCAN_current_buffer INITIALLY( 0 );
|
||||
GLOBAL char * SCANcurrent;
|
||||
GLOBAL SCL_EXPRESS_EXPORT Scan_Buffer SCAN_buffers[SCAN_NESTING_DEPTH];
|
||||
GLOBAL SCL_EXPRESS_EXPORT int SCAN_current_buffer INITIALLY( 0 );
|
||||
GLOBAL SCL_EXPRESS_EXPORT char * SCANcurrent;
|
||||
|
||||
GLOBAL Error ERROR_include_file INITIALLY( ERROR_none );
|
||||
GLOBAL Error ERROR_unmatched_close_comment INITIALLY( ERROR_none );
|
||||
GLOBAL Error ERROR_unmatched_open_comment INITIALLY( ERROR_none );
|
||||
GLOBAL Error ERROR_unterminated_string INITIALLY( ERROR_none );
|
||||
GLOBAL Error ERROR_encoded_string_bad_digit INITIALLY( ERROR_none );
|
||||
GLOBAL Error ERROR_encoded_string_bad_count INITIALLY( ERROR_none );
|
||||
GLOBAL Error ERROR_bad_identifier INITIALLY( ERROR_none );
|
||||
GLOBAL Error ERROR_unexpected_character INITIALLY( ERROR_none );
|
||||
GLOBAL Error ERROR_nonascii_char;
|
||||
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_include_file INITIALLY( ERROR_none );
|
||||
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_unmatched_close_comment INITIALLY( ERROR_none );
|
||||
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_unmatched_open_comment INITIALLY( ERROR_none );
|
||||
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_unterminated_string INITIALLY( ERROR_none );
|
||||
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_encoded_string_bad_digit INITIALLY( ERROR_none );
|
||||
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_encoded_string_bad_count INITIALLY( ERROR_none );
|
||||
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_bad_identifier INITIALLY( ERROR_none );
|
||||
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_unexpected_character INITIALLY( ERROR_none );
|
||||
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_nonascii_char;
|
||||
|
||||
|
||||
#undef GLOBAL
|
||||
@@ -112,27 +111,27 @@ GLOBAL Error ERROR_nonascii_char;
|
||||
/* function prototypes */
|
||||
/***********************/
|
||||
|
||||
extern int yylex PROTO( ( void ) ); /* the scanner */
|
||||
extern SCL_EXPRESS_EXPORT int yylex PROTO( ( void ) ); /* the scanner */
|
||||
|
||||
extern void SCANinitialize PROTO( ( void ) );
|
||||
extern int SCANprocess_real_literal PROTO( ( void ) );
|
||||
extern int SCANprocess_integer_literal PROTO( ( void ) );
|
||||
extern int SCANprocess_binary_literal PROTO( ( void ) );
|
||||
extern int SCANprocess_logical_literal PROTO( ( char * ) );
|
||||
extern int SCANprocess_identifier_or_keyword PROTO( ( void ) );
|
||||
extern int SCANprocess_string PROTO( ( void ) );
|
||||
extern int SCANprocess_encoded_string PROTO( ( void ) );
|
||||
extern int SCANprocess_semicolon PROTO( ( int ) );
|
||||
extern void SCANsave_comment PROTO( ( void ) );
|
||||
extern bool SCANread PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT void SCANinitialize PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT int SCANprocess_real_literal PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT int SCANprocess_integer_literal PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT int SCANprocess_binary_literal PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT int SCANprocess_logical_literal PROTO( ( char * ) );
|
||||
extern SCL_EXPRESS_EXPORT int SCANprocess_identifier_or_keyword PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT int SCANprocess_string PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT int SCANprocess_encoded_string PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT int SCANprocess_semicolon PROTO( ( int ) );
|
||||
extern SCL_EXPRESS_EXPORT void SCANsave_comment PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT bool SCANread PROTO( ( void ) );
|
||||
#if macros_bit_the_dust
|
||||
extern void SCANdefine_macro PROTO( ( char *, char * ) );
|
||||
extern SCL_EXPRESS_EXPORT void SCANdefine_macro PROTO( ( char *, char * ) );
|
||||
#endif
|
||||
extern void SCANinclude_file PROTO( ( char * ) );
|
||||
void SCANlowerize PROTO( ( char * ) );
|
||||
void SCANupperize PROTO( ( char * ) );
|
||||
extern char * SCANstrdup PROTO( ( char * ) );
|
||||
extern long SCANtell PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT void SCANinclude_file PROTO( ( char * ) );
|
||||
SCL_EXPRESS_EXPORT void SCANlowerize PROTO( ( char * ) );
|
||||
SCL_EXPRESS_EXPORT void SCANupperize PROTO( ( char * ) );
|
||||
extern SCL_EXPRESS_EXPORT char * SCANstrdup PROTO( ( char * ) );
|
||||
extern SCL_EXPRESS_EXPORT long SCANtell PROTO( ( void ) );
|
||||
|
||||
/*******************************/
|
||||
/* inline function definitions */
|
||||
@@ -162,7 +161,11 @@ SCANnextchar( char * buffer ) {
|
||||
SCANbuffer.numRead--;
|
||||
#endif
|
||||
buffer[0] = *( SCANcurrent++ );
|
||||
#ifdef __MSVC__
|
||||
if( !__isascii( buffer[0] ) ) {
|
||||
#else
|
||||
if( !isascii( buffer[0] ) ) {
|
||||
#endif
|
||||
ERRORreport_with_line( ERROR_nonascii_char, yylineno,
|
||||
0xff & buffer[0] );
|
||||
buffer[0] = ' '; /* substitute space */
|
||||
|
||||
+43
-39
@@ -1,8 +1,6 @@
|
||||
#ifndef LINKED_LIST_H
|
||||
#define LINKED_LIST_H
|
||||
|
||||
/* $Id: linklist.h,v 1.3 1997/01/21 19:15:23 dar Exp $ */
|
||||
|
||||
/*
|
||||
* This work was supported by the United States Government, and is
|
||||
* not subject to copyright.
|
||||
@@ -38,6 +36,7 @@
|
||||
/* packages used */
|
||||
/*****************/
|
||||
|
||||
#include <scl_export.h>
|
||||
#include "basic.h"
|
||||
#include "memory.h"
|
||||
|
||||
@@ -47,10 +46,6 @@
|
||||
|
||||
typedef struct Linked_List_ * Linked_List;
|
||||
|
||||
#ifdef __STDC__
|
||||
#else /* old C */
|
||||
#endif /*__STDC__*/
|
||||
|
||||
/****************/
|
||||
/* modules used */
|
||||
/****************/
|
||||
@@ -81,10 +76,10 @@ struct Linked_List_ {
|
||||
#include "decstart.h"
|
||||
#endif /*LINKED_LIST_C*/
|
||||
|
||||
GLOBAL Error ERROR_empty_list INITIALLY( ERROR_none );
|
||||
GLOBAL struct freelist_head LINK_fl;
|
||||
GLOBAL struct freelist_head LIST_fl;
|
||||
GLOBAL Linked_List LINK__l; /* for LISTcreate_with macro - ugh */
|
||||
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_empty_list INITIALLY( ERROR_none );
|
||||
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head LINK_fl;
|
||||
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head LIST_fl;
|
||||
GLOBAL SCL_EXPRESS_EXPORT Linked_List LINK__l; /* for LISTcreate_with macro - ugh */
|
||||
|
||||
#include "de_end.h"
|
||||
|
||||
@@ -97,37 +92,38 @@ GLOBAL Linked_List LINK__l; /* for LISTcreate_with macro - ugh */
|
||||
#define LIST_new() (struct Linked_List_ *)MEM_new(&LIST_fl)
|
||||
#define LIST_destroy(x) MEM_destroy(&LIST_fl,(Freelist *)(Generic)x)
|
||||
|
||||
/* following could be optimized */
|
||||
/** following could be optimized */
|
||||
#define LISTcreate_with(x) (LINK__l = LISTcreate()),\
|
||||
LISTadd(LINK__l,x),\
|
||||
LINK_l)
|
||||
|
||||
/* accessing links */
|
||||
/** accessing links */
|
||||
#define LINKdata(link) (link)->data
|
||||
#define LINKnext(link) (link)->next
|
||||
#define LINKprev(link) (link)->prev
|
||||
|
||||
/* iteration */
|
||||
#define LISTdo(list, elt, type) \
|
||||
{struct Linked_List_ * __l = (list); \
|
||||
type elt; \
|
||||
Link __p; \
|
||||
if (__l) { \
|
||||
/** iteration */
|
||||
#define LISTdo(list, elt, type) \
|
||||
{struct Linked_List_ * __l = (list); \
|
||||
type elt; \
|
||||
Link __p; \
|
||||
if (__l) { \
|
||||
for (__p = __l->mark; (__p = __p->next) != __l->mark; ) { \
|
||||
(elt) = (type)((__p)->data);
|
||||
|
||||
#define LISTdo_links(list, link) \
|
||||
{Linked_List __in = (list); \
|
||||
Link link; \
|
||||
if (__in != LIST_NULL) { \
|
||||
for ((link) = __in->mark; ((link) = (link)->next) != __in->mark; ) {
|
||||
{Linked_List __i = (list); \
|
||||
Link link; \
|
||||
if (__i != LIST_NULL) { \
|
||||
for ((link) = __i->mark; ((link) = (link)->next) != __i->mark; ) {
|
||||
|
||||
#define LISTod }}}
|
||||
|
||||
/* accessing */
|
||||
/** accessing */
|
||||
#define LISTpeek_first(list) \
|
||||
(((struct Linked_List_*)list)->mark->next->data)
|
||||
|
||||
/* function aliases */
|
||||
/** function aliases */
|
||||
#define LISTadd(list, item) LISTadd_last(list, item)
|
||||
#define LISTadd_all(list, items) \
|
||||
LISTdo(items, e, Generic) \
|
||||
@@ -138,26 +134,28 @@ GLOBAL Linked_List LINK__l; /* for LISTcreate_with macro - ugh */
|
||||
/* function prototypes */
|
||||
/***********************/
|
||||
|
||||
extern void LISTinitialize PROTO( ( void ) );
|
||||
extern Linked_List LISTcreate PROTO( ( void ) );
|
||||
/*extern Linked_List LISTcreate_with PROTO((Generic));*/
|
||||
extern Linked_List LISTcopy PROTO( ( Linked_List ) );
|
||||
extern Generic LISTadd_first PROTO( ( Linked_List, Generic ) );
|
||||
extern Generic LISTadd_last PROTO( ( Linked_List, Generic ) );
|
||||
extern Generic LISTadd_after PROTO( ( Linked_List, Link, Generic ) );
|
||||
extern Generic LISTadd_before PROTO( ( Linked_List, Link, Generic ) );
|
||||
extern Generic LISTremove_first PROTO( ( Linked_List ) );
|
||||
extern Generic LISTremove PROTO( ( Linked_List, Link ) );
|
||||
extern Generic LISTget_first PROTO( ( Linked_List ) );
|
||||
extern Generic LISTget_second PROTO( ( Linked_List ) );
|
||||
extern Generic LISTget_nth PROTO( ( Linked_List, int ) );
|
||||
extern void LISTfree PROTO( ( Linked_List ) );
|
||||
extern int LISTget_length PROTO( ( Linked_List ) );
|
||||
extern SCL_EXPRESS_EXPORT void LISTinitialize PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT void LISTcleanup PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT Linked_List LISTcreate PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT Linked_List LISTcopy PROTO( ( Linked_List ) );
|
||||
extern SCL_EXPRESS_EXPORT Generic LISTadd_first PROTO( ( Linked_List, Generic ) );
|
||||
extern SCL_EXPRESS_EXPORT Generic LISTadd_last PROTO( ( Linked_List, Generic ) );
|
||||
extern SCL_EXPRESS_EXPORT Generic LISTadd_after PROTO( ( Linked_List, Link, Generic ) );
|
||||
extern SCL_EXPRESS_EXPORT Generic LISTadd_before PROTO( ( Linked_List, Link, Generic ) );
|
||||
extern SCL_EXPRESS_EXPORT Generic LISTremove_first PROTO( ( Linked_List ) );
|
||||
extern SCL_EXPRESS_EXPORT Generic LISTremove PROTO( ( Linked_List, Link ) );
|
||||
extern SCL_EXPRESS_EXPORT Generic LISTget_first PROTO( ( Linked_List ) );
|
||||
extern SCL_EXPRESS_EXPORT Generic LISTget_second PROTO( ( Linked_List ) );
|
||||
extern SCL_EXPRESS_EXPORT Generic LISTget_nth PROTO( ( Linked_List, int ) );
|
||||
extern SCL_EXPRESS_EXPORT void LISTfree PROTO( ( Linked_List ) );
|
||||
extern SCL_EXPRESS_EXPORT int LISTget_length PROTO( ( Linked_List ) );
|
||||
|
||||
/*******************************/
|
||||
/* inline function definitions */
|
||||
/*******************************/
|
||||
|
||||
#if !defined(__BORLAND__)
|
||||
|
||||
#if supports_inline_functions || defined(LINKED_LIST_C)
|
||||
|
||||
static_inline
|
||||
@@ -174,4 +172,10 @@ LISTempty( Linked_List list ) {
|
||||
|
||||
#endif /* supports_inline_functions || defined(LINKED_LIST_C) */
|
||||
|
||||
#else
|
||||
|
||||
extern SCL_EXPRESS_EXPORT bool LISTempty( Linked_List list );
|
||||
|
||||
#endif
|
||||
|
||||
#endif /*LINKED_LIST_H*/
|
||||
|
||||
+18
-19
@@ -1,8 +1,6 @@
|
||||
#ifndef MEMORY_H
|
||||
#define MEMORY_H
|
||||
|
||||
/* $Id: memory.h,v 1.5 1997/01/21 19:17:11 dar Exp $ */
|
||||
|
||||
/*
|
||||
* This work was supported by the United States Government, and is
|
||||
* not subject to copyright.
|
||||
@@ -30,29 +28,30 @@
|
||||
/* packages used */
|
||||
/*****************/
|
||||
|
||||
/* mem.h - defs for fixed size block memory allocator */
|
||||
#include <scl_export.h>
|
||||
|
||||
/** \file memory.h - defs for fixed size block memory allocator */
|
||||
|
||||
typedef long Align;
|
||||
|
||||
union freelist {
|
||||
union freelist * next; /* next block on freelist */
|
||||
char memory; /* user data */
|
||||
Align aligner; /* force alignment of blocks */
|
||||
union freelist * next; /**< next block on freelist */
|
||||
char memory; /**< user data */
|
||||
Align aligner; /**< force alignment of blocks */
|
||||
};
|
||||
|
||||
typedef union freelist Freelist;
|
||||
|
||||
struct freelist_head {
|
||||
int size_elt; /* size of a single elt */
|
||||
int size_elt; /**< size of a single elt */
|
||||
#ifndef NOSTAT
|
||||
int alloc; /* # of allocations */
|
||||
int alloc; /**< # of allocations */
|
||||
int dealloc;
|
||||
int create; /* number of calls to create a new freelist */
|
||||
Generic max; /* end of freelist */
|
||||
int create; /**< number of calls to create a new freelist */
|
||||
Generic max; /**< end of freelist */
|
||||
#endif
|
||||
int size; /* size of a single elt incl. next ptr */
|
||||
int bytes; /* if we run out, allocate memory by this
|
||||
many bytes */
|
||||
int size; /**< size of a single elt incl. next ptr */
|
||||
int bytes; /**< if we run out, allocate memory by this many bytes */
|
||||
Freelist * freelist;
|
||||
#if SPACE_PROFILE
|
||||
int count;
|
||||
@@ -76,17 +75,17 @@ char * nnew();
|
||||
|
||||
extern int yylineno;
|
||||
|
||||
/* CALLOC grabs and initializes to all 0s space for the indicated */
|
||||
/* number of instances of the indicated type */
|
||||
/** CALLOC grabs and initializes to all 0s space for the indicated
|
||||
* number of instances of the indicated type */
|
||||
#define CALLOC(ptr, num, type) \
|
||||
if (((ptr) = (type*)calloc((num), (unsigned)sizeof(type)))==NULL) { \
|
||||
fprintf(stderr,"fedex: out of space");\
|
||||
} else {}
|
||||
|
||||
void _MEMinitialize PROTO( ( void ) );
|
||||
void MEMinitialize PROTO( ( struct freelist_head *, int, int, int ) );
|
||||
void MEM_destroy PROTO( ( struct freelist_head *, Freelist * ) );
|
||||
Generic MEM_new PROTO( ( struct freelist_head * ) );
|
||||
SCL_EXPRESS_EXPORT void _MEMinitialize PROTO( ( void ) );
|
||||
SCL_EXPRESS_EXPORT void MEMinitialize PROTO( ( struct freelist_head *, int, int, int ) );
|
||||
SCL_EXPRESS_EXPORT void MEM_destroy PROTO( ( struct freelist_head *, Freelist * ) );
|
||||
SCL_EXPRESS_EXPORT Generic MEM_new PROTO( ( struct freelist_head * ) );
|
||||
|
||||
#include "de_end.h"
|
||||
|
||||
|
||||
+14
-29
@@ -1,10 +1,8 @@
|
||||
#ifndef OBJECT_H
|
||||
#define OBJECT_H
|
||||
|
||||
/* $Id: object.h,v 1.9 1997/01/21 19:17:11 dar Exp $ */
|
||||
|
||||
/************************************************************************
|
||||
** Module: Object
|
||||
/** **********************************************************************
|
||||
** Module: Object \file object.h
|
||||
** Description: This module implements the Object abstraction.
|
||||
** Constants:
|
||||
** OBJECT_NULL - the null class
|
||||
@@ -48,15 +46,16 @@
|
||||
/* constants */
|
||||
/*************/
|
||||
|
||||
/* each object has an index - current the index is a mnemonic character */
|
||||
/* hence the array is rather sparse, but the extra slop is only a hundred */
|
||||
/* or so bytes, so it's nothing to sweat about */
|
||||
/** each object has an index - current the index is a mnemonic character
|
||||
* hence the array is rather sparse, but the extra slop is only a hundred
|
||||
* or so bytes, so it's nothing to sweat about */
|
||||
#define MAX_OBJECT_TYPES 127 /* really could be a LOT less */
|
||||
|
||||
/*****************/
|
||||
/* packages used */
|
||||
/*****************/
|
||||
|
||||
#include <scl_export.h>
|
||||
#include "basic.h" /* get basic definitions */
|
||||
#include "symbol.h"
|
||||
|
||||
@@ -70,9 +69,8 @@
|
||||
|
||||
struct Object {
|
||||
struct Symbol_ * ( *get_symbol )();
|
||||
char * type; /* should complete the phrase "X is ..." */
|
||||
/* i.e., "an entity", "a type", "of unknown type" */
|
||||
int bits; /* a bitwise selector of a type, i.e. OBJ_XX_BITS */
|
||||
char * type; /**< should complete the phrase "X is ..." - i.e., "an entity", "a type", "of unknown type" */
|
||||
int bits; /**< a bitwise selector of a type, i.e. OBJ_XX_BITS */
|
||||
};
|
||||
|
||||
/****************/
|
||||
@@ -89,7 +87,7 @@ struct Object {
|
||||
#include "decstart.h"
|
||||
#endif /*OBJECT_C */
|
||||
|
||||
GLOBAL struct Object * OBJ;
|
||||
GLOBAL SCL_EXPRESS_EXPORT struct Object * OBJ;
|
||||
|
||||
#include "de_end.h"
|
||||
|
||||
@@ -103,28 +101,15 @@ GLOBAL struct Object * OBJ;
|
||||
#define OBJtype_is_oneof(_type_,class) (OBJ[(int)_type_].bits & (class))
|
||||
#define OBJget_name(obj,type) (OBJget_symbol(obj,type)->name)
|
||||
|
||||
/* for backwards compatibility */
|
||||
#define OBJequal(x,y) ((x) == (y))
|
||||
#define OBJfree(x)
|
||||
#define OBJreference(x) (x)
|
||||
#define OBJget_data(obj,type,err) (obj)
|
||||
/* removed #define statements for obsolete fn macros OBJequal OBJfree OBJreference OBJget_data */
|
||||
|
||||
/***********************/
|
||||
/* function prototypes */
|
||||
/***********************/
|
||||
|
||||
extern void OBJinitialize PROTO( ( void ) );
|
||||
extern void OBJcreate PROTO( ( char, struct Symbol_ * ( * )( Generic ), char *, int ) );
|
||||
extern Symbol * UNK_get_symbol PROTO( ( Generic x ) );
|
||||
#if 0
|
||||
extern void OBJcreate( char, struct Symbol * ( * )( Generic ), char *, int );
|
||||
#endif
|
||||
|
||||
/********************/
|
||||
/* inline functions */
|
||||
/********************/
|
||||
|
||||
#if supports_inline_functions || defined(OBJECT_C)
|
||||
#endif /* supports_inline_functions || defined(OBJECT_C) */
|
||||
extern SCL_EXPRESS_EXPORT void OBJinitialize PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT void OBJcleanup PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT void OBJcreate PROTO( ( char, struct Symbol_ * ( * )( Generic ), char *, int ) );
|
||||
extern SCL_EXPRESS_EXPORT Symbol * UNK_get_symbol PROTO( ( Generic x ) );
|
||||
|
||||
#endif /*OBJECT_H*/
|
||||
|
||||
+20
-22
@@ -1,8 +1,6 @@
|
||||
#ifndef RESOLVE_H
|
||||
#define RESOLVE_H
|
||||
|
||||
/* $Id: resolve.h,v 1.6 1994/11/10 19:20:03 clark dec96 $ */
|
||||
|
||||
/*
|
||||
* This software was developed by U.S. Government employees as part of
|
||||
* their official duties and is not subject to copyright.
|
||||
@@ -30,6 +28,7 @@
|
||||
* Initial revision
|
||||
*/
|
||||
|
||||
#include <scl_export.h>
|
||||
#include "expbasic.h" /* get basic definitions */
|
||||
#include "type.h"
|
||||
#include "variable.h"
|
||||
@@ -54,17 +53,17 @@
|
||||
# define INITIALLY(value)
|
||||
#endif /*RESOLVE_C*/
|
||||
|
||||
GLOBAL int print_objects_while_running INITIALLY( 0 );
|
||||
GLOBAL SCL_EXPRESS_EXPORT int print_objects_while_running INITIALLY( 0 );
|
||||
|
||||
GLOBAL Error ERROR_undefined_attribute INITIALLY( ERROR_none );
|
||||
GLOBAL Error ERROR_undefined_type INITIALLY( ERROR_none );
|
||||
GLOBAL Error ERROR_undefined_schema INITIALLY( ERROR_none );
|
||||
GLOBAL Error ERROR_unknown_attr_in_entity INITIALLY( ERROR_none );
|
||||
GLOBAL Error ERROR_unknown_subtype INITIALLY( ERROR_none );
|
||||
GLOBAL Error ERROR_unknown_supertype INITIALLY( ERROR_none );
|
||||
GLOBAL Error ERROR_circular_reference INITIALLY( ERROR_none );
|
||||
GLOBAL Error ERROR_ambiguous_attribute INITIALLY( ERROR_none );
|
||||
GLOBAL Error ERROR_ambiguous_group INITIALLY( ERROR_none );
|
||||
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_undefined_attribute INITIALLY( ERROR_none );
|
||||
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_undefined_type INITIALLY( ERROR_none );
|
||||
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_undefined_schema INITIALLY( ERROR_none );
|
||||
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_unknown_attr_in_entity INITIALLY( ERROR_none );
|
||||
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_unknown_subtype INITIALLY( ERROR_none );
|
||||
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_unknown_supertype INITIALLY( ERROR_none );
|
||||
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_circular_reference INITIALLY( ERROR_none );
|
||||
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_ambiguous_attribute INITIALLY( ERROR_none );
|
||||
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_ambiguous_group INITIALLY( ERROR_none );
|
||||
|
||||
#undef GLOBAL
|
||||
#undef INITIALLY
|
||||
@@ -73,7 +72,6 @@ GLOBAL Error ERROR_ambiguous_group INITIALLY( ERROR_none );
|
||||
|
||||
/* cheaper doing the check here, then inside the function call. Return */
|
||||
/* immediately for RESOLVED, FAILED_TO_RESOLVE, and RESOLVE_IN_PROGRESS */
|
||||
/*#define TYPEresolve(t,s) if (is_resolvable((*(t)))) TYPE_resolve((t),(s))*/
|
||||
#define TYPEresolve(t,s) if (is_resolvable((*(t)))) TYPE_resolve((t))
|
||||
#define VARresolve_types(v,s) if (is_resolvable((v)->name)) VAR_resolve_types((v),(s))
|
||||
#define VARresolve_expressions(v,s) if (is_resolvable((v)->name)) VAR_resolve_expressions((v),(s))
|
||||
@@ -83,14 +81,14 @@ GLOBAL Error ERROR_ambiguous_group INITIALLY( ERROR_none );
|
||||
/* function prototypes */
|
||||
/***********************/
|
||||
|
||||
extern void RESOLVEinitialize PROTO( ( void ) );
|
||||
extern void SCOPEresolve_expressions_statements PROTO( ( Scope ) );
|
||||
extern void SCOPEresolve_subsupers PROTO( ( Scope ) );
|
||||
extern void SCOPEresolve_types PROTO( ( Scope ) );
|
||||
/*extern void TYPE_resolve PROTO((Type *,Scope));*/
|
||||
extern void TYPE_resolve PROTO( ( Type * ) );
|
||||
extern void EXP_resolve PROTO( ( Expression, Scope, Type ) );
|
||||
extern void ALGresolve PROTO( ( Scope ) );
|
||||
extern void SCHEMAresolve PROTO( ( Scope ) );
|
||||
extern SCL_EXPRESS_EXPORT void RESOLVEinitialize PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT void RESOLVEcleanup PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT void SCOPEresolve_expressions_statements PROTO( ( Scope ) );
|
||||
extern SCL_EXPRESS_EXPORT void SCOPEresolve_subsupers PROTO( ( Scope ) );
|
||||
extern SCL_EXPRESS_EXPORT void SCOPEresolve_types PROTO( ( Scope ) );
|
||||
extern SCL_EXPRESS_EXPORT void TYPE_resolve PROTO( ( Type * ) );
|
||||
extern SCL_EXPRESS_EXPORT void EXP_resolve PROTO( ( Expression, Scope, Type ) );
|
||||
extern SCL_EXPRESS_EXPORT void ALGresolve PROTO( ( Scope ) );
|
||||
extern SCL_EXPRESS_EXPORT void SCHEMAresolve PROTO( ( Scope ) );
|
||||
|
||||
#endif /*RESOLVE_H*/
|
||||
|
||||
+34
-52
@@ -1,10 +1,8 @@
|
||||
#ifndef SCHEMA_H
|
||||
#define SCHEMA_H
|
||||
|
||||
/* $Id: schema.h,v 1.11 1997/02/25 19:49:01 dar Exp $ */
|
||||
|
||||
/************************************************************************
|
||||
** Module: Schema
|
||||
/** **********************************************************************
|
||||
** Module: Schema \file schema.h
|
||||
** Description: This module implements the Schema abstraction, which
|
||||
** basically amounts to a named symbol table.
|
||||
** Constants:
|
||||
@@ -48,23 +46,15 @@
|
||||
* prettied up interface to print_objects_when_running
|
||||
*/
|
||||
|
||||
/*************/
|
||||
/* constants */
|
||||
/*************/
|
||||
|
||||
/*****************/
|
||||
/* packages used */
|
||||
/*****************/
|
||||
|
||||
#include <scl_export.h>
|
||||
#include "expbasic.h" /* get basic definitions */
|
||||
#include "symbol.h"
|
||||
#include "scope.h"
|
||||
|
||||
/************/
|
||||
/* typedefs */
|
||||
/************/
|
||||
|
||||
/*typedef struct Scope *Schema;*/
|
||||
|
||||
/****************/
|
||||
/* modules used */
|
||||
@@ -86,30 +76,28 @@ typedef struct Rename {
|
||||
Schema schema;
|
||||
struct Symbol_ * old;
|
||||
struct Symbol_ * nnew;
|
||||
Generic object; /* once object has been looked up */
|
||||
char type; /* drat, need to remember this */
|
||||
/* once renames have been resolved to avoid */
|
||||
/* looking them up in the dictionary again */
|
||||
Generic object; /**< once object has been looked up */
|
||||
char type; /**< drat, need to remember this once renames have been
|
||||
* resolved to avoid looking them up in the dictionary again */
|
||||
enum rename_type rename_type;
|
||||
int userdata; /* generic for user */
|
||||
int userdata; /**< generic for user */
|
||||
} Rename;
|
||||
|
||||
struct Schema_ {
|
||||
Linked_List rules;
|
||||
#if 0
|
||||
struct Express_ * express;
|
||||
#endif
|
||||
Linked_List reflist;
|
||||
Linked_List uselist;
|
||||
/* dictionarys into which are entered renames for each specific */
|
||||
/* object specified in a rename clause (even if it uses the same */
|
||||
/* name */
|
||||
/** \var refdict, usedict
|
||||
* dictionarys into which are entered renames for each specific
|
||||
* object specified in a rename clause (even if it uses the same
|
||||
* name */
|
||||
Dictionary refdict;
|
||||
Dictionary usedict;
|
||||
/* lists of schemas that are fully ref/use'd */
|
||||
/* entries can be 0 if schemas weren't found during RENAMEresolve */
|
||||
Linked_List use_schemas;
|
||||
Linked_List ref_schemas;
|
||||
|
||||
Linked_List use_schemas; /**< lists of schemas that are fully use'd
|
||||
* entries can be 0 if schemas weren't found during RENAMEresolve */
|
||||
Linked_List ref_schemas; /**< lists of schemas that are fully ref'd
|
||||
* entries can be 0 if schemas weren't found during RENAMEresolve */
|
||||
};
|
||||
|
||||
/********************/
|
||||
@@ -124,11 +112,11 @@ struct Schema_ {
|
||||
# define INITIALLY(value)
|
||||
#endif /* SCHEMA_C */
|
||||
|
||||
GLOBAL struct freelist_head REN_fl;
|
||||
GLOBAL struct freelist_head SCOPE_fl;
|
||||
GLOBAL struct freelist_head SCHEMA_fl;
|
||||
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head REN_fl;
|
||||
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head SCOPE_fl;
|
||||
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head SCHEMA_fl;
|
||||
|
||||
GLOBAL int __SCOPE_search_id INITIALLY( 0 );
|
||||
GLOBAL SCL_EXPRESS_EXPORT int __SCOPE_search_id INITIALLY( 0 );
|
||||
|
||||
#undef GLOBAL
|
||||
#undef INITIALLY
|
||||
@@ -156,26 +144,20 @@ GLOBAL int __SCOPE_search_id INITIALLY( 0 );
|
||||
/* function prototypes */
|
||||
/***********************/
|
||||
|
||||
extern Variable VARfind PROTO( ( Scope, char *, int ) );
|
||||
extern Schema SCHEMAcreate PROTO( ( void ) );
|
||||
extern void SCHEMAinitialize PROTO( ( void ) );
|
||||
extern void SCHEMAadd_use PROTO( ( Schema, Symbol *, Symbol *, Symbol * ) );
|
||||
extern void SCHEMAadd_reference PROTO( ( Schema, Symbol *, Symbol *, Symbol * ) );
|
||||
extern void SCHEMAdefine_use PROTO( ( Schema, Rename * ) );
|
||||
extern void SCHEMAdefine_reference PROTO( ( Schema, Rename * ) );
|
||||
extern Generic SCHEMAfind PROTO( ( Schema, char * name, int search_refs ) );
|
||||
extern Scope SCOPEcreate PROTO( ( char ) );
|
||||
extern Scope SCOPEcreate_tiny PROTO( ( char ) );
|
||||
extern Scope SCOPEcreate_nostab PROTO( ( char ) );
|
||||
extern Linked_List SCHEMAget_entities_use PROTO( ( Scope ) );
|
||||
extern Linked_List SCHEMAget_entities_ref PROTO( ( Scope ) );
|
||||
|
||||
/********************/
|
||||
/* inline functions */
|
||||
/********************/
|
||||
|
||||
#if supports_inline_functions || defined(SCHEMA_C)
|
||||
#endif /* supports_inline_functions || defined(SCHEMA_C) */
|
||||
extern SCL_EXPRESS_EXPORT Variable VARfind PROTO( ( Scope, char *, int ) );
|
||||
extern SCL_EXPRESS_EXPORT Schema SCHEMAcreate PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT void SCHEMAinitialize PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT void SCHEMAadd_use PROTO( ( Schema, Symbol *, Symbol *, Symbol * ) );
|
||||
extern SCL_EXPRESS_EXPORT void SCHEMAadd_reference PROTO( ( Schema, Symbol *, Symbol *, Symbol * ) );
|
||||
extern SCL_EXPRESS_EXPORT void SCHEMAdefine_use PROTO( ( Schema, Rename * ) );
|
||||
extern SCL_EXPRESS_EXPORT void SCHEMAdefine_reference PROTO( ( Schema, Rename * ) );
|
||||
extern SCL_EXPRESS_EXPORT Generic SCHEMAfind PROTO( ( Schema, char * name, int search_refs ) );
|
||||
extern SCL_EXPRESS_EXPORT Scope SCOPEcreate PROTO( ( char ) );
|
||||
extern SCL_EXPRESS_EXPORT Scope SCOPEcreate_tiny PROTO( ( char ) );
|
||||
extern SCL_EXPRESS_EXPORT Scope SCOPEcreate_nostab PROTO( ( char ) );
|
||||
extern SCL_EXPRESS_EXPORT void SCOPEdestroy PROTO( ( Scope ) );
|
||||
extern SCL_EXPRESS_EXPORT Linked_List SCHEMAget_entities_use PROTO( ( Scope ) );
|
||||
extern SCL_EXPRESS_EXPORT Linked_List SCHEMAget_entities_ref PROTO( ( Scope ) );
|
||||
|
||||
#endif /* SCHEMA_H */
|
||||
|
||||
|
||||
+27
-42
@@ -1,10 +1,8 @@
|
||||
#ifndef SCOPE_H
|
||||
#define SCOPE_H
|
||||
|
||||
/* $Id: scope.h,v 1.10 1997/01/21 19:17:11 dar Exp $ */
|
||||
|
||||
/************************************************************************
|
||||
** Module: Scope
|
||||
/** **********************************************************************
|
||||
** Module: Scope \file scope.h
|
||||
** Description: This module implements a hierarchical (i.e., scoped)
|
||||
** symbol table. The symbol table can store definitions of entities,
|
||||
** types, algorithms, and variables, as well as containing a list
|
||||
@@ -47,16 +45,11 @@
|
||||
|
||||
#define SCOPE_NULL (Scope)0
|
||||
|
||||
/************/
|
||||
/* typedefs */
|
||||
/************/
|
||||
|
||||
/*typedef struct Scope *Scope;*/
|
||||
|
||||
/****************/
|
||||
/* modules used */
|
||||
/****************/
|
||||
|
||||
#include <scl_export.h>
|
||||
#include "type.h"
|
||||
#include "variable.h"
|
||||
#include "entity.h"
|
||||
@@ -85,14 +78,13 @@
|
||||
#define SCOPE_FIND_ANYTHING OBJ_ANYTHING_BITS
|
||||
|
||||
struct Scope_ {
|
||||
Symbol symbol;
|
||||
char type; /* see above */
|
||||
ClientData clientData; /* user may use this for any purpose */
|
||||
int search_id; /* key to avoid searching this scope twice */
|
||||
Dictionary symbol_table;
|
||||
Symbol symbol;
|
||||
char type; /* see above */
|
||||
ClientData clientData; /**< user may use this for any purpose */
|
||||
int search_id; /**< key to avoid searching this scope twice */
|
||||
Dictionary symbol_table,enum_table;
|
||||
struct Scope_ * superscope;
|
||||
union {
|
||||
/* struct Constant *constant;*/
|
||||
struct Procedure_ * proc;
|
||||
struct Function_ * func;
|
||||
struct Rule_ * rule;
|
||||
@@ -101,10 +93,10 @@ struct Scope_ {
|
||||
struct Express_ * express;
|
||||
struct Increment_ * incr;
|
||||
struct TypeHead_ * type;
|
||||
/* no, query owns a scope rather than scope owning a query */
|
||||
/* struct Query *query;*/
|
||||
/* no, query owns a scope rather than scope owning a query
|
||||
* struct Query *query; */
|
||||
} u;
|
||||
Linked_List where; /* optional where clause */
|
||||
Linked_List where; /**< optional where clause */
|
||||
};
|
||||
|
||||
/********************/
|
||||
@@ -128,9 +120,6 @@ struct Scope_ {
|
||||
#define SCOPEget_symbol(scope) (&(scope)->symbol)
|
||||
#define SCOPEput_name(scope,name) ((scope)->symbol.name = name)
|
||||
#define SCOPEget_name(scope) ((scope)->symbol.name)
|
||||
/* get_superscope's' for backward compat */
|
||||
#define SCOPEget_superscope(scope) ((scope)->superscope)
|
||||
#define SCOPEget_superscope(scope) ((scope)->superscope)
|
||||
#define SCOPEget_resolved(scope) ((scope)->symbol.resolved)
|
||||
|
||||
#define SCOPEget_clientData(s) ((s)->clientData)
|
||||
@@ -143,31 +132,27 @@ struct Scope_ {
|
||||
#define SCOPEdo_entities(s,t,de) DICTdo_type_init(s->symbol_table,&de,OBJ_ENTITY); { \
|
||||
Entity t; \
|
||||
while (0 != (t = (Entity)DICTdo(&de))) {
|
||||
#define SCOPEdo_functions(s,t,de) DICTdo_type_init(s->symbol_table,&de,OBJ_FUNCTION); { \
|
||||
Entity t; \
|
||||
while (0 != (t = (Entity)DICTdo(&de))) {
|
||||
#define SCOPEdo_rules(s,t,de) DICTdo_type_init(s->symbol_table,&de,OBJ_RULE); { \
|
||||
Entity t; \
|
||||
while (0 != (t = (Entity)DICTdo(&de))) {
|
||||
|
||||
#define SCOPEod }}
|
||||
|
||||
/***********************/
|
||||
/* function prototypes */
|
||||
/***********************/
|
||||
|
||||
extern struct Symbol_ * SCOPE_get_symbol PROTO( ( Generic ) );
|
||||
/*extern struct Scope * SCOPEget_nearest_enclosing_entity PROTO((Scope));*/
|
||||
extern void SCOPE_get_entities PROTO( ( Scope, Linked_List ) );
|
||||
extern Linked_List SCOPEget_entities PROTO( ( Scope ) );
|
||||
extern Linked_List SCOPEget_entities_superclass_order PROTO( ( Scope ) );
|
||||
extern Generic SCOPEfind PROTO( ( Scope, char *, int ) );
|
||||
extern SCL_EXPRESS_EXPORT struct Symbol_ * SCOPE_get_symbol PROTO( ( Generic ) );
|
||||
extern SCL_EXPRESS_EXPORT void SCOPE_get_entities PROTO( ( Scope, Linked_List ) );
|
||||
extern SCL_EXPRESS_EXPORT Linked_List SCOPEget_entities PROTO( ( Scope ) );
|
||||
extern SCL_EXPRESS_EXPORT Linked_List SCOPEget_entities_superclass_order PROTO( ( Scope ) );
|
||||
extern SCL_EXPRESS_EXPORT Generic SCOPEfind PROTO( ( Scope, char *, int ) );
|
||||
extern SCL_EXPRESS_EXPORT void SCOPE_get_functions PROTO( ( Scope, Linked_List ) );
|
||||
extern SCL_EXPRESS_EXPORT Linked_List SCOPEget_functions PROTO( ( Scope ) );
|
||||
extern SCL_EXPRESS_EXPORT void SCOPE_get_rules PROTO( ( Scope, Linked_List ) );
|
||||
extern SCL_EXPRESS_EXPORT Linked_List SCOPEget_rules PROTO( ( Scope ) );
|
||||
|
||||
#if 0
|
||||
extern Linked_List SCOPEget_types PROTO( ( Scope ) );
|
||||
extern Linked_List SCOPEget_variables PROTO( ( Scope ) );
|
||||
extern Linked_List SCOPEget_algorithms PROTO( ( Scope ) );
|
||||
extern Linked_List SCOPEget_constants PROTO( ( Scope ) );
|
||||
#endif
|
||||
|
||||
/********************/
|
||||
/* inline functions */
|
||||
/********************/
|
||||
|
||||
#if supports_inline_functions || defined(SCOPE_C)
|
||||
|
||||
#endif /* supports_inline_functions || defined(SCOPE_C) */
|
||||
#endif /* SCOPE_H */
|
||||
|
||||
+35
-44
@@ -1,10 +1,8 @@
|
||||
#ifndef STATEMENT_H
|
||||
#define STATEMENT_H
|
||||
|
||||
/* $Id: stmt.h,v 1.3 1997/01/21 19:17:11 dar Exp $ */
|
||||
|
||||
/************************************************************************
|
||||
** Module: Statement
|
||||
/** **********************************************************************
|
||||
** Module: Statement \file stmt.h
|
||||
** Description: This module implements the Statement abstraction. A
|
||||
** statement is, in effect, a typeless Expression. Due to the
|
||||
** existence of complex language constructs, however, it often is
|
||||
@@ -50,6 +48,7 @@
|
||||
/* packages used */
|
||||
/*****************/
|
||||
|
||||
#include <scl_export.h>
|
||||
#include "expbasic.h" /* get basic definitions */
|
||||
#include "scope.h"
|
||||
|
||||
@@ -94,9 +93,8 @@ typedef struct Scope_ * Increment;
|
||||
/* these should probably all be expression types */
|
||||
|
||||
struct Statement_ {
|
||||
Symbol symbol; /* can hold pcall or alias name */
|
||||
/* but otherwise is not used for anything */
|
||||
int type; /* one of STMT_XXX above */
|
||||
Symbol symbol; /**< can hold pcall or alias name but otherwise is not used for anything */
|
||||
int type; /**< one of STMT_XXX above */
|
||||
/* hey, is there nothing in common beside symbol and private data?? */
|
||||
union u_statement {
|
||||
struct Alias_ * alias;
|
||||
@@ -114,7 +112,7 @@ struct Statement_ {
|
||||
struct Alias_ {
|
||||
struct Scope_ * scope;
|
||||
struct Variable_ * variable;
|
||||
Linked_List statements; /* list of statements */
|
||||
Linked_List statements; /**< list of statements */
|
||||
};
|
||||
|
||||
struct Assignment_ {
|
||||
@@ -133,18 +131,18 @@ struct Compound_Statement_ {
|
||||
|
||||
struct Conditional_ {
|
||||
Expression test;
|
||||
Linked_List code; /* list of statements */
|
||||
Linked_List otherwise; /* list of statements */
|
||||
Linked_List code; /**< list of statements */
|
||||
Linked_List otherwise; /**< list of statements */
|
||||
};
|
||||
|
||||
struct Loop_ {
|
||||
struct Scope_ * scope; /* scope for increment control */
|
||||
struct Scope_ * scope; /**< scope for increment control */
|
||||
Expression while_expr;
|
||||
Expression until_expr;
|
||||
Linked_List statements; /* list of statements */
|
||||
Linked_List statements; /**< list of statements */
|
||||
};
|
||||
|
||||
/* this is an element in the optional Loop scope */
|
||||
/** this is an element in the optional Loop scope */
|
||||
struct Increment_ {
|
||||
Expression init;
|
||||
Expression end;
|
||||
@@ -153,7 +151,7 @@ struct Increment_ {
|
||||
|
||||
struct Procedure_Call_ {
|
||||
struct Scope_ * procedure;
|
||||
Linked_List parameters; /* list of expressions */
|
||||
Linked_List parameters; /**< list of expressions */
|
||||
};
|
||||
|
||||
struct Return_Statement_ {
|
||||
@@ -172,20 +170,20 @@ struct Return_Statement_ {
|
||||
#include "decstart.h"
|
||||
#endif /*STATEMENT_C*/
|
||||
|
||||
GLOBAL struct freelist_head STMT_fl;
|
||||
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head STMT_fl;
|
||||
|
||||
GLOBAL struct freelist_head ALIAS_fl;
|
||||
GLOBAL struct freelist_head ASSIGN_fl;
|
||||
GLOBAL struct freelist_head CASE_fl;
|
||||
GLOBAL struct freelist_head COMP_STMT_fl;
|
||||
GLOBAL struct freelist_head COND_fl;
|
||||
GLOBAL struct freelist_head LOOP_fl;
|
||||
GLOBAL struct freelist_head PCALL_fl;
|
||||
GLOBAL struct freelist_head RET_fl;
|
||||
GLOBAL struct freelist_head INCR_fl;
|
||||
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head ALIAS_fl;
|
||||
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head ASSIGN_fl;
|
||||
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head CASE_fl;
|
||||
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head COMP_STMT_fl;
|
||||
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head COND_fl;
|
||||
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head LOOP_fl;
|
||||
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head PCALL_fl;
|
||||
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head RET_fl;
|
||||
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head INCR_fl;
|
||||
|
||||
GLOBAL Statement STATEMENT_ESCAPE INITIALLY( STATEMENT_NULL );
|
||||
GLOBAL Statement STATEMENT_SKIP INITIALLY( STATEMENT_NULL );
|
||||
GLOBAL SCL_EXPRESS_EXPORT Statement STATEMENT_ESCAPE INITIALLY( STATEMENT_NULL );
|
||||
GLOBAL SCL_EXPRESS_EXPORT Statement STATEMENT_SKIP INITIALLY( STATEMENT_NULL );
|
||||
|
||||
#include "de_end.h"
|
||||
|
||||
@@ -235,24 +233,17 @@ GLOBAL Statement STATEMENT_SKIP INITIALLY( STATEMENT_NULL );
|
||||
/* function prototypes */
|
||||
/***********************/
|
||||
|
||||
extern Statement STMTcreate PROTO( ( int ) );
|
||||
extern Statement ALIAScreate PROTO( ( struct Scope_ *, Variable, Linked_List ) );
|
||||
extern Statement CASEcreate PROTO( ( Expression , Linked_List ) );
|
||||
extern Statement ASSIGNcreate PROTO( ( Expression , Expression ) );
|
||||
extern Statement COMP_STMTcreate PROTO( ( Linked_List ) );
|
||||
extern Statement CONDcreate PROTO( ( Expression, Linked_List, Linked_List ) );
|
||||
extern Statement LOOPcreate PROTO( ( struct Scope_ *, Expression, Expression, Linked_List ) );
|
||||
extern Statement PCALLcreate PROTO( ( Linked_List ) );
|
||||
extern Statement RETcreate PROTO( ( Expression ) );
|
||||
extern void STMTinitialize PROTO( ( void ) );
|
||||
extern struct Scope_ * INCR_CTLcreate PROTO( ( Symbol *, Expression start,
|
||||
extern SCL_EXPRESS_EXPORT Statement STMTcreate PROTO( ( int ) );
|
||||
extern SCL_EXPRESS_EXPORT Statement ALIAScreate PROTO( ( struct Scope_ *, Variable, Linked_List ) );
|
||||
extern SCL_EXPRESS_EXPORT Statement CASEcreate PROTO( ( Expression , Linked_List ) );
|
||||
extern SCL_EXPRESS_EXPORT Statement ASSIGNcreate PROTO( ( Expression , Expression ) );
|
||||
extern SCL_EXPRESS_EXPORT Statement COMP_STMTcreate PROTO( ( Linked_List ) );
|
||||
extern SCL_EXPRESS_EXPORT Statement CONDcreate PROTO( ( Expression, Linked_List, Linked_List ) );
|
||||
extern SCL_EXPRESS_EXPORT Statement LOOPcreate PROTO( ( struct Scope_ *, Expression, Expression, Linked_List ) );
|
||||
extern SCL_EXPRESS_EXPORT Statement PCALLcreate PROTO( ( Linked_List ) );
|
||||
extern SCL_EXPRESS_EXPORT Statement RETcreate PROTO( ( Expression ) );
|
||||
extern SCL_EXPRESS_EXPORT void STMTinitialize PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT struct Scope_ * INCR_CTLcreate PROTO( ( Symbol *, Expression start,
|
||||
Expression end, Expression increment ) );
|
||||
|
||||
/********************/
|
||||
/* inline functions */
|
||||
/********************/
|
||||
|
||||
#if supports_inline_functions || defined(STATEMENT_C)
|
||||
#endif /* supports_inline_functions || defined(STATEMENT_C) */
|
||||
|
||||
#endif /*STATEMENT_H*/
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
#ifndef SYMBOL_H
|
||||
#define SYMBOL_H
|
||||
|
||||
/* $Id: symbol.h,v 1.8 1997/01/21 19:17:11 dar Exp $ */
|
||||
|
||||
/************************************************************************
|
||||
** Module: Symbol
|
||||
/** **********************************************************************
|
||||
** Module: Symbol \file symbol.h
|
||||
** Description: This module implements the Symbol abstraction.
|
||||
** Constants:
|
||||
** SYMBOL_NULL - the null Symbol
|
||||
@@ -45,9 +43,7 @@
|
||||
/* packages used */
|
||||
/*****************/
|
||||
|
||||
#ifdef SYMBOL_C
|
||||
#endif /* SYMBOL_C */
|
||||
|
||||
#include <scl_export.h>
|
||||
#include "basic.h" /* get basic definitions */
|
||||
#include "memory.h"
|
||||
|
||||
@@ -82,7 +78,7 @@ struct Symbol_ {
|
||||
#include "decstart.h"
|
||||
#endif /* SYMBOL_C */
|
||||
|
||||
GLOBAL struct freelist_head SYMBOL_fl;
|
||||
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head SYMBOL_fl;
|
||||
|
||||
#include "de_end.h"
|
||||
|
||||
@@ -95,21 +91,13 @@ GLOBAL struct freelist_head SYMBOL_fl;
|
||||
|
||||
#define SYMBOLset(obj) obj->symbol.line = yylineno; \
|
||||
obj->symbol.filename = current_filename
|
||||
/* for backwards compatibility only, no one should ever need this */
|
||||
#define SYMBOLget_name(sym) ((sym)->name)
|
||||
|
||||
/***********************/
|
||||
/* function prototypes */
|
||||
/***********************/
|
||||
|
||||
extern void SYMBOLinitialize PROTO( ( void ) );
|
||||
Symbol * SYMBOLcreate PROTO( ( char *, int, char * ) );
|
||||
extern SCL_EXPRESS_EXPORT void SYMBOLinitialize( void );
|
||||
SCL_EXPRESS_EXPORT Symbol * SYMBOLcreate( char * name, int line, char * filename );
|
||||
|
||||
/********************/
|
||||
/* inline functions */
|
||||
/********************/
|
||||
|
||||
#if supports_inline_functions || defined(SYMBOL_C)
|
||||
#endif /* supports_inline_functions || defined(SYMBOL_C) */
|
||||
|
||||
#endif /* SYMBOL_H */
|
||||
|
||||
+80
-142
@@ -1,10 +1,8 @@
|
||||
#ifndef TYPE_H
|
||||
#define TYPE_H
|
||||
|
||||
/* $Id: type.h,v 1.14 1997/09/19 18:25:10 dar Exp $ */
|
||||
|
||||
/************************************************************************
|
||||
** Module: Type
|
||||
/** **********************************************************************
|
||||
** Module: Type \file type.h
|
||||
** Description: This module implements the type abstraction. It is
|
||||
** rather unpleasant, since this abstraction is quite well suited
|
||||
** to an object-oriented environment with inheritance.
|
||||
@@ -55,16 +53,16 @@
|
||||
/*************/
|
||||
|
||||
#define TYPE_NULL (Type)0
|
||||
/* since we can't evaluate true size of many aggregates, prepare */
|
||||
/* to grow them by chunks of this size */
|
||||
|
||||
/** since we can't evaluate true size of many aggregates,
|
||||
* prepare to grow them by chunks of this size */
|
||||
#define AGGR_CHUNK_SIZE 30
|
||||
|
||||
/* these are all orthogonal types */
|
||||
/** these are all orthogonal types */
|
||||
enum type_enum {
|
||||
unknown_ = 0, /* 0 catches uninit. errors */
|
||||
special_, /* placeholder, given meaning by it's owner, */
|
||||
/* such as Type_Dont_Care, Type_Bad, Type_User_Def */
|
||||
runtime_, /* cannot be further determined until runtime */
|
||||
unknown_ = 0, /**< 0 catches uninit. errors */
|
||||
special_, /**< placeholder, given meaning by it's owner, such as Type_Dont_Care, Type_Bad, Type_User_Def */
|
||||
runtime_, /**< cannot be further determined until runtime */
|
||||
integer_,
|
||||
real_,
|
||||
string_,
|
||||
@@ -77,32 +75,29 @@ enum type_enum {
|
||||
generic_,
|
||||
|
||||
/* aggregates */
|
||||
aggregate_, /* as a formal */
|
||||
aggregate_, /**< as a formal */
|
||||
array_,
|
||||
bag_,
|
||||
set_,
|
||||
list_,
|
||||
last_aggregate_,/* not real, just for easier computation */
|
||||
last_aggregate_,/**< not real, just for easier computation */
|
||||
|
||||
oneof_,
|
||||
|
||||
/* while they are really used for different */
|
||||
/* purposes, it might be worth considering */
|
||||
/* collapsing entity_ and entity_list_ */
|
||||
entity_, /* single entity */
|
||||
entity_list_, /* linked list of entities */
|
||||
/** while they are really used for different purposes, it might be worth considering collapsing entity_ and entity_list_ */
|
||||
entity_, /**< single entity */
|
||||
entity_list_, /**< linked list of entities */
|
||||
enumeration_,
|
||||
select_,
|
||||
reference_, /* something only defined by a base type, i.e., a */
|
||||
/* type reference */
|
||||
reference_, /**< something only defined by a base type, i.e., a type reference */
|
||||
query_,
|
||||
op_, /* something with an operand */
|
||||
inverse_, /* is? an inverse */
|
||||
op_, /**< something with an operand */
|
||||
inverse_, /**< is? an inverse */
|
||||
|
||||
identifier_, /* simple identifier in an expression */
|
||||
attribute_, /* attribute reference (i.e., expr->u.variable) */
|
||||
derived_,/*?*/
|
||||
funcall_, /* a function call and actual parameters */
|
||||
identifier_, /**< simple identifier in an expression */
|
||||
attribute_, /**< attribute reference (i.e., expr->u.variable) */
|
||||
derived_, /**< ?*/
|
||||
funcall_, /**< a function call and actual parameters */
|
||||
|
||||
self_
|
||||
};
|
||||
@@ -111,53 +106,25 @@ enum type_enum {
|
||||
/* packages used */
|
||||
/*****************/
|
||||
|
||||
#include <scl_export.h>
|
||||
#include "expbasic.h" /* get basic definitions */
|
||||
#include "symbol.h"
|
||||
#include "object.h"
|
||||
/*#include "scope.h"*/
|
||||
|
||||
/************/
|
||||
/* typedefs */
|
||||
/************/
|
||||
|
||||
/*typedef struct Scope *Type;*/
|
||||
typedef struct TypeHead_ * TypeHead;
|
||||
typedef struct TypeBody_ * TypeBody;
|
||||
typedef enum type_enum TypeType;
|
||||
|
||||
/* following are all for backwards compatibility - not otherwise necessary */
|
||||
typedef Type Aggregate_Type, Composed_Type, Sized_Type, Type_Reference;
|
||||
typedef Aggregate_Type Array_Type, List_Type, Bag_Type;
|
||||
typedef Bag_Type Set_Type;
|
||||
typedef Composed_Type Entity_Type, Enumeration_Type, Select_Type;
|
||||
typedef Sized_Type Integer_Type, Real_Type, String_Type, Binary_Type;
|
||||
|
||||
/* provide a replacement for Class */
|
||||
typedef enum type_enum Class_Of_Type;
|
||||
typedef enum type_enum Class;
|
||||
#define OBJget_class(typ) ((typ)->u.type->body->type)
|
||||
#define CLASSinherits_from TYPEinherits_from
|
||||
|
||||
/* backwards compatibility */
|
||||
#define Class_Integer_Type integer_
|
||||
#define Class_Number_Type number_
|
||||
#define Class_Real_Type real_
|
||||
#define Class_Entity_Type entity_
|
||||
#define Class_Entity_List_Type entity_list_
|
||||
#define Class_Enumeration_Type enumeration_
|
||||
#define Class_Boolean_Type boolean_
|
||||
#define Class_Logical_Type logical_
|
||||
#define Class_Binary_Type binary_
|
||||
#define Class_String_Type string_
|
||||
#define Class_Array_Type array_
|
||||
#define Class_List_Type list_
|
||||
#define Class_Set_Type set_
|
||||
#define Class_Bag_Type bag_
|
||||
#define Class_Generic_Type generic_
|
||||
#define Class_Select_Type select_
|
||||
#define Class_Reference_Type reference_
|
||||
#define Class_Aggregate_Type aggregate_
|
||||
|
||||
/****************/
|
||||
/* modules used */
|
||||
/****************/
|
||||
@@ -172,9 +139,8 @@ typedef enum type_enum Class;
|
||||
/***************************/
|
||||
|
||||
struct TypeHead_ {
|
||||
Type head; /* if we are a defined type */
|
||||
/* this is who we point to */
|
||||
struct TypeBody_ * body; /* true type, ignoring defined types */
|
||||
Type head; /**< if we are a defined type this is who we point to */
|
||||
struct TypeBody_ * body; /**< true type, ignoring defined types */
|
||||
#if 0
|
||||
/* if we are concerned about memory (over time) uncomment this and */
|
||||
/* other references to refcount in parser and TYPEresolve. It is */
|
||||
@@ -185,30 +151,25 @@ struct TypeHead_ {
|
||||
|
||||
struct TypeBody_ {
|
||||
#if 1
|
||||
struct TypeHead_ * head; /* for debugging only */
|
||||
struct TypeHead_ * head; /**< for debugging only */
|
||||
#endif
|
||||
enum type_enum type; /* bits describing this type, int, real, etc */
|
||||
enum type_enum type; /**< bits describing this type, int, real, etc */
|
||||
struct {
|
||||
unsigned unique : 1;
|
||||
unsigned optional : 1;
|
||||
unsigned fixed : 1;
|
||||
unsigned shared : 1; /* type is shared */
|
||||
unsigned repeat : 1; /* expression is a repeat count*/
|
||||
unsigned encoded : 1; /* encoded string */
|
||||
unsigned shared : 1; /**< type is shared */
|
||||
unsigned repeat : 1; /**< expression is a repeat count*/
|
||||
unsigned encoded : 1; /**< encoded string */
|
||||
} flags;
|
||||
Type base; /* underlying base type if any */
|
||||
/* can also contain true type if this type */
|
||||
/* is a type reference */
|
||||
Type tag; /* optional tag */
|
||||
Type base; /**< underlying base type if any can also contain true type if this type is a type reference */
|
||||
Type tag; /**< optional tag */
|
||||
/* a lot of the stuff below can be unionized */
|
||||
Expression precision;
|
||||
Linked_List list; /* used by select_types */
|
||||
/* and composed types, such as for a */
|
||||
/* list of entities in an instance */
|
||||
/* Dictionary enumeration; *//* only used by enumerations */
|
||||
Linked_List list; /**< used by select_types and composed types, such as for a list of entities in an instance */
|
||||
Expression upper;
|
||||
Expression lower;
|
||||
struct Scope_ * entity; /* only used by entity types */
|
||||
struct Scope_ * entity; /**< only used by entity types */
|
||||
};
|
||||
|
||||
/********************/
|
||||
@@ -223,41 +184,41 @@ struct TypeBody_ {
|
||||
|
||||
/* Very commonly-used read-only types */
|
||||
/* non-constant versions probably aren't necessary? */
|
||||
GLOBAL Type Type_Bad;
|
||||
GLOBAL Type Type_Unknown;
|
||||
GLOBAL Type Type_Dont_Care;
|
||||
GLOBAL Type Type_Runtime; /* indicates that this object can't be */
|
||||
/* calculated now but must be deferred */
|
||||
/* til (the mythical) runtime */
|
||||
GLOBAL Type Type_Binary;
|
||||
GLOBAL Type Type_Boolean;
|
||||
GLOBAL Type Type_Enumeration;
|
||||
GLOBAL Type Type_Expression;
|
||||
GLOBAL Type Type_Aggregate;
|
||||
GLOBAL Type Type_Integer;
|
||||
GLOBAL Type Type_Integer;
|
||||
GLOBAL Type Type_Number;
|
||||
GLOBAL Type Type_Real;
|
||||
GLOBAL Type Type_String;
|
||||
GLOBAL Type Type_String_Encoded;
|
||||
GLOBAL Type Type_Logical;
|
||||
GLOBAL Type Type_Set;
|
||||
GLOBAL Type Type_Attribute;
|
||||
GLOBAL Type Type_Entity;
|
||||
GLOBAL Type Type_Funcall;
|
||||
GLOBAL Type Type_Generic;
|
||||
GLOBAL Type Type_Identifier;
|
||||
GLOBAL Type Type_Oneof;
|
||||
GLOBAL Type Type_Query;
|
||||
GLOBAL Type Type_Self;
|
||||
GLOBAL Type Type_Set_Of_String;
|
||||
GLOBAL Type Type_Set_Of_Generic;
|
||||
GLOBAL Type Type_Bag_Of_Generic;
|
||||
GLOBAL SCL_EXPRESS_EXPORT Type Type_Bad;
|
||||
GLOBAL SCL_EXPRESS_EXPORT Type Type_Unknown;
|
||||
GLOBAL SCL_EXPRESS_EXPORT Type Type_Dont_Care;
|
||||
GLOBAL SCL_EXPRESS_EXPORT Type Type_Runtime; /**< indicates that this object can't be
|
||||
calculated now but must be deferred
|
||||
until (the mythical) runtime */
|
||||
GLOBAL SCL_EXPRESS_EXPORT Type Type_Binary;
|
||||
GLOBAL SCL_EXPRESS_EXPORT Type Type_Boolean;
|
||||
GLOBAL SCL_EXPRESS_EXPORT Type Type_Enumeration;
|
||||
GLOBAL SCL_EXPRESS_EXPORT Type Type_Expression;
|
||||
GLOBAL SCL_EXPRESS_EXPORT Type Type_Aggregate;
|
||||
GLOBAL SCL_EXPRESS_EXPORT Type Type_Integer;
|
||||
GLOBAL SCL_EXPRESS_EXPORT Type Type_Integer;
|
||||
GLOBAL SCL_EXPRESS_EXPORT Type Type_Number;
|
||||
GLOBAL SCL_EXPRESS_EXPORT Type Type_Real;
|
||||
GLOBAL SCL_EXPRESS_EXPORT Type Type_String;
|
||||
GLOBAL SCL_EXPRESS_EXPORT Type Type_String_Encoded;
|
||||
GLOBAL SCL_EXPRESS_EXPORT Type Type_Logical;
|
||||
GLOBAL SCL_EXPRESS_EXPORT Type Type_Set;
|
||||
GLOBAL SCL_EXPRESS_EXPORT Type Type_Attribute;
|
||||
GLOBAL SCL_EXPRESS_EXPORT Type Type_Entity;
|
||||
GLOBAL SCL_EXPRESS_EXPORT Type Type_Funcall;
|
||||
GLOBAL SCL_EXPRESS_EXPORT Type Type_Generic;
|
||||
GLOBAL SCL_EXPRESS_EXPORT Type Type_Identifier;
|
||||
GLOBAL SCL_EXPRESS_EXPORT Type Type_Oneof;
|
||||
GLOBAL SCL_EXPRESS_EXPORT Type Type_Query;
|
||||
GLOBAL SCL_EXPRESS_EXPORT Type Type_Self;
|
||||
GLOBAL SCL_EXPRESS_EXPORT Type Type_Set_Of_String;
|
||||
GLOBAL SCL_EXPRESS_EXPORT Type Type_Set_Of_Generic;
|
||||
GLOBAL SCL_EXPRESS_EXPORT Type Type_Bag_Of_Generic;
|
||||
|
||||
GLOBAL struct freelist_head TYPEHEAD_fl;
|
||||
GLOBAL struct freelist_head TYPEBODY_fl;
|
||||
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head TYPEHEAD_fl;
|
||||
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head TYPEBODY_fl;
|
||||
|
||||
GLOBAL Error ERROR_corrupted_type INITIALLY( ERROR_none );
|
||||
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_corrupted_type INITIALLY( ERROR_none );
|
||||
|
||||
#include "de_end.h"
|
||||
|
||||
@@ -274,12 +235,13 @@ GLOBAL Error ERROR_corrupted_type INITIALLY( ERROR_none );
|
||||
#define TYPEis_identifier(t) ((t)->u.type->body->type == identifier_)
|
||||
#define TYPEis_logical(t) ((t)->u.type->body->type == logical_)
|
||||
#define TYPEis_boolean(t) ((t)->u.type->body->type == boolean_)
|
||||
#define TYPEis_real(t) ((t)->u.type->body->type == real_)
|
||||
#define TYPEis_integer(t) ((t)->u.type->body->type == integer_)
|
||||
#define TYPEis_string(t) ((t)->u.type->body->type == string_)
|
||||
#define TYPEis_expression(t) ((t)->u.type->body->type == op_)
|
||||
#define TYPEis_oneof(t) ((t)->u.type->body->type == oneof_)
|
||||
#define TYPEis_entity(t) ((t)->u.type->body->type == entity_)
|
||||
#define TYPEis_enumeration(t) ((t)->u.type->body->type == enumeration_)
|
||||
/*#define TYPEis_aggregate(t) ((t)->u.type->body->type >= aggregate_ && (t)->u.type->body->type < last_aggregate_)*/
|
||||
#define TYPEis_aggregate(t) ((t)->u.type->body->base)
|
||||
#define TYPEis_aggregate_raw(t) ((t)->u.type->body->type == aggregate_)
|
||||
#define TYPEis_array(t) ((t)->u.type->body->type == array_)
|
||||
@@ -315,7 +277,6 @@ GLOBAL Error ERROR_corrupted_type INITIALLY( ERROR_none );
|
||||
#define COMP_TYPEput_items(t,lis) ((t)->u.type->body->list = (lis))
|
||||
#define COMP_TYPEadd_items(t,lis) LISTadd_all((t)->u.type->body->list, (lis));
|
||||
|
||||
/*#define ENUM_TYPEput_items(type,list) COMP_TYPEput_items(type, list)*/
|
||||
#define ENUM_TYPEget_items(t) ((t)->symbol_table)
|
||||
#define TYPEget_optional(t) ((t)->u.type->body->flags.optional)
|
||||
#define TYPEget_unique(t) ((t)->u.type->body->flags.unique)
|
||||
@@ -328,9 +289,6 @@ GLOBAL Error ERROR_corrupted_type INITIALLY( ERROR_none );
|
||||
|
||||
#define TYPEget_enum_tags(t) ((t)->symbol_table)
|
||||
|
||||
/* for backwards compatibility */
|
||||
#define AGGR_TYPEget_base_type TYPEget_base_type
|
||||
|
||||
#define TYPEget_clientData(t) ((t)->clientData)
|
||||
#define TYPEput_clientData(t,d) ((t)->clientData = (d))
|
||||
|
||||
@@ -338,40 +296,20 @@ GLOBAL Error ERROR_corrupted_type INITIALLY( ERROR_none );
|
||||
/* function prototypes */
|
||||
/***********************/
|
||||
|
||||
extern Type TYPEcreate_partial PROTO( ( struct Symbol_ *, Scope ) );
|
||||
extern SCL_EXPRESS_EXPORT Type TYPEcreate_partial PROTO( ( struct Symbol_ *, Scope ) );
|
||||
|
||||
extern Type TYPEcreate PROTO( ( enum type_enum ) );
|
||||
extern Type TYPEcreate_from_body_anonymously PROTO( ( TypeBody ) );
|
||||
extern Type TYPEcreate_name PROTO( ( struct Symbol_ * ) );
|
||||
extern Type TYPEcreate_nostab PROTO( ( struct Symbol_ *, Scope, char ) );
|
||||
/*extern Type TYPEcreate_typedef PROTO((Type, TypeBody,
|
||||
Scope,struct Symbol *));*/
|
||||
extern TypeBody TYPEBODYcreate PROTO( ( enum type_enum ) );
|
||||
/*extern Type TYPEcopy_shallow PROTO((Type));*/
|
||||
extern void TYPEinitialize PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT Type TYPEcreate PROTO( ( enum type_enum ) );
|
||||
extern SCL_EXPRESS_EXPORT Type TYPEcreate_from_body_anonymously PROTO( ( TypeBody ) );
|
||||
extern SCL_EXPRESS_EXPORT Type TYPEcreate_name PROTO( ( struct Symbol_ * ) );
|
||||
extern SCL_EXPRESS_EXPORT Type TYPEcreate_nostab PROTO( ( struct Symbol_ *, Scope, char ) );
|
||||
extern SCL_EXPRESS_EXPORT TypeBody TYPEBODYcreate PROTO( ( enum type_enum ) );
|
||||
extern SCL_EXPRESS_EXPORT void TYPEinitialize PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT void TYPEcleanup PROTO( ( void ) );
|
||||
|
||||
#if 0
|
||||
extern Dictionary TYPEget_enum_tags PROTO( ( Type ) );
|
||||
#endif
|
||||
extern bool TYPEinherits_from PROTO( ( Type, enum type_enum ) );
|
||||
extern Type TYPEget_nonaggregate_base_type PROTO( ( Type ) );
|
||||
extern SCL_EXPRESS_EXPORT bool TYPEinherits_from PROTO( ( Type, enum type_enum ) );
|
||||
extern SCL_EXPRESS_EXPORT Type TYPEget_nonaggregate_base_type PROTO( ( Type ) );
|
||||
|
||||
extern Type TYPEcreate_user_defined_type PROTO( ( Type, Scope, struct Symbol_ * ) );
|
||||
extern Type TYPEcreate_user_defined_tag PROTO( ( Type, Scope, struct Symbol_ * ) );
|
||||
|
||||
#if 0
|
||||
extern int TYPEget_size PROTO( ( Type ) );
|
||||
extern bool TYPEcompatible PROTO( ( Type, Type ) );
|
||||
extern Expression SZD_TYPEget_precision PROTO( ( Sized_Type ) );
|
||||
extern bool SZD_TYPEget_varying PROTO( ( Sized_Type ) );
|
||||
extern Expression TYPE_REFget_full_name PROTO( ( Type_Reference * ) );
|
||||
#endif /*0*/
|
||||
|
||||
/********************/
|
||||
/* inline functions */
|
||||
/********************/
|
||||
|
||||
#if supports_inline_functions || defined(TYPE_C)
|
||||
#endif /* supports_inline_functions || defined(TYPE_C) */
|
||||
extern SCL_EXPRESS_EXPORT Type TYPEcreate_user_defined_type PROTO( ( Type, Scope, struct Symbol_ * ) );
|
||||
extern SCL_EXPRESS_EXPORT Type TYPEcreate_user_defined_tag PROTO( ( Type, Scope, struct Symbol_ * ) );
|
||||
|
||||
#endif /* TYPE_H */
|
||||
|
||||
+18
-50
@@ -1,10 +1,8 @@
|
||||
#ifndef VARIABLE_H
|
||||
#define VARIABLE_H
|
||||
|
||||
/* $Id: variable.h,v 1.10 1997/01/21 19:17:11 dar Exp $ */
|
||||
|
||||
/************************************************************************
|
||||
** Module: Variable
|
||||
/** **********************************************************************
|
||||
** Module: Variable \file variable.h
|
||||
** Description: This module implements the Variable abstraction. A
|
||||
** Variable consists of a name, a type, a reference class, and
|
||||
** some flags, e.g. 'optional', 'variable'. It is used to represent
|
||||
@@ -78,26 +76,23 @@ typedef struct Variable_ * Variable;
|
||||
/***************************/
|
||||
|
||||
struct Variable_ {
|
||||
/* Symbol is inside of 'name' below */
|
||||
Expression name;
|
||||
Type type;
|
||||
Expression initializer; /* or 'derived' */
|
||||
int offset;
|
||||
Expression name; /**< Symbol is inside of 'name' below */
|
||||
Type type;
|
||||
Expression initializer; /**< or 'derived' */
|
||||
int offset;
|
||||
|
||||
struct {
|
||||
int optional : 1; /* OPTIONAL keyword */
|
||||
int var : 1; /* VAR keyword */
|
||||
int constant : 1; /* from CONSTANT...END_CONSTANT */
|
||||
int unique : 1; /* appears in UNIQUE list */
|
||||
int parameter : 1; /* is a formal parameter */
|
||||
int attribute : 1; /* is an attribute (rule parameters */
|
||||
/* are marked this way, too) */
|
||||
int optional : 1; /**< OPTIONAL keyword */
|
||||
int var : 1; /**< VAR keyword */
|
||||
int constant : 1; /**< from CONSTANT...END_CONSTANT */
|
||||
int unique : 1; /**< appears in UNIQUE list */
|
||||
int parameter : 1; /**< is a formal parameter */
|
||||
int attribute : 1; /**< is an attribute (rule parameters are marked this way, too) */
|
||||
} flags;
|
||||
|
||||
#define query_symbol inverse_symbol
|
||||
Symbol * inverse_symbol; /* entity symbol */
|
||||
Variable inverse_attribute; /* attribute related by */
|
||||
/* inverse relationship */
|
||||
Symbol * inverse_symbol; /**< entity symbol */
|
||||
Variable inverse_attribute; /**< attribute related by inverse relationship */
|
||||
};
|
||||
|
||||
/********************/
|
||||
@@ -110,7 +105,7 @@ struct Variable_ {
|
||||
#include "decstart.h"
|
||||
#endif /* VARIABLE_C */
|
||||
|
||||
GLOBAL struct freelist_head VAR_fl;
|
||||
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head VAR_fl;
|
||||
|
||||
#include "de_end.h"
|
||||
|
||||
@@ -133,40 +128,13 @@ GLOBAL struct freelist_head VAR_fl;
|
||||
|
||||
#define VARis_derived(v) ((v)->initializer != 0)
|
||||
#define VARget_inverse(v) ((v)->inverse_attribute)
|
||||
/* for backwards compatibility */
|
||||
#define VARget_derived VARis_derived
|
||||
|
||||
/***********************/
|
||||
/* function prototypes */
|
||||
/***********************/
|
||||
|
||||
extern Variable VARcreate PROTO( ( Expression, Type ) );
|
||||
extern void VARinitialize PROTO( ( void ) );
|
||||
extern char * VARget_simple_name PROTO( ( Variable ) );
|
||||
|
||||
#if 0
|
||||
extern void VARput_type PROTO( ( Variable *, Type ) );
|
||||
extern void VARput_initializer PROTO( ( Variable *, Expression ) );
|
||||
extern void VARput_derived PROTO( ( Variable *, Boolean ) );
|
||||
extern void VARput_optional PROTO( ( Variable *, Boolean ) );
|
||||
extern void VARput_variable PROTO( ( Variable *, Boolean ) );
|
||||
extern void VARput_reference PROTO( ( Variable *, Expression ) );
|
||||
/*Mextern void VARput_offset PROTO((Variable *, int));*/
|
||||
extern void VARput_inverse PROTO( ( Variable *, Symbol * ) );
|
||||
/*M extern Type VARget_type PROTO((Variable *));*/
|
||||
/*Mextern Boolean VARget_derived PROTO((Variable *));*/
|
||||
extern Boolean VARget_optional PROTO( ( Variable * ) );
|
||||
extern Boolean VARget_variable PROTO( ( Variable * ) );
|
||||
extern Expression VARget_reference PROTO( ( Variable * ) );
|
||||
/*Mextern int VARget_offset PROTO((Variable *));*/
|
||||
#endif /*0*/
|
||||
|
||||
/********************/
|
||||
/* inline functions */
|
||||
/********************/
|
||||
|
||||
#if supports_inline_functions || defined(VARIABLE_C)
|
||||
|
||||
#endif /* supports_inline_functions || defined(VARIABLE_C) */
|
||||
extern SCL_EXPRESS_EXPORT Variable VARcreate PROTO( ( Expression, Type ) );
|
||||
extern SCL_EXPRESS_EXPORT void VARinitialize PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT char * VARget_simple_name PROTO( ( Variable ) );
|
||||
|
||||
#endif /* VARIABLE_H */
|
||||
|
||||
@@ -1,13 +1,29 @@
|
||||
#ifndef SCL_CF_H
|
||||
#define SCL_CF_H
|
||||
|
||||
/**** Define statements for CMake ****/
|
||||
#cmakedefine HAVE_NDIR_H 1
|
||||
#cmakedefine HAVE_STDARG_H 1
|
||||
#cmakedefine HAVE_SYS_STAT_H 1
|
||||
#cmakedefine HAVE_SYS_PARAM_H 1
|
||||
#cmakedefine HAVE_SYSENT_H 1
|
||||
#cmakedefine HAVE_UNISTD_H 1
|
||||
#cmakedefine HAVE_DIRENT_H 1
|
||||
#cmakedefine HAVE_STDBOOL_H 1
|
||||
#cmakedefine HAVE_PROCESS_H 1
|
||||
#cmakedefine HAVE_IO_H 1
|
||||
|
||||
#cmakedefine YYTEXT_POINTER 1
|
||||
#cmakedefine SCL_TRACE_FPRINTF 1
|
||||
#cmakedefine SCL_MEMMGR_ENABLE_CHECKS 1
|
||||
|
||||
#cmakedefine HAVE_ABS 1
|
||||
#cmakedefine HAVE_MEMCPY 1
|
||||
#cmakedefine HAVE_MEMMOVE 1
|
||||
#cmakedefine HAVE_GETOPT 1
|
||||
|
||||
#cmakedefine HAVE_SSIZE_T 1
|
||||
|
||||
//cmake updates this at build time
|
||||
#define SCL_COMMIT_ID "@GIT_COMMIT_ID@"
|
||||
#cmakedefine HAVE_STD_THREAD 1
|
||||
|
||||
#endif /* SCL_CF_H */
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
#ifndef SCL_EXPORT_H
|
||||
#define SCL_EXPORT_H
|
||||
|
||||
/* Import/Export flags for base. */
|
||||
#ifndef SCL_BASE_EXPORT
|
||||
# if defined(SCL_BASE_DLL_EXPORTS) && defined(SCL_BASE_DLL_IMPORTS)
|
||||
# error "Only SCL_BASE_DLL_EXPORTS or SCL_BASE_DLL_IMPORTS can be defined, not both."
|
||||
# elif defined(SCL_BASE_DLL_EXPORTS)
|
||||
# define SCL_BASE_EXPORT __declspec(dllexport)
|
||||
# elif defined(SCL_BASE_DLL_IMPORTS)
|
||||
# define SCL_BASE_EXPORT __declspec(dllimport)
|
||||
# else
|
||||
# define SCL_BASE_EXPORT
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Import/Export flags for express. */
|
||||
#ifndef SCL_EXPRESS_EXPORT
|
||||
# if defined(SCL_EXPRESS_DLL_EXPORTS) && defined(SCL_EXPRESS_DLL_IMPORTS)
|
||||
# error "Only SCL_EXPRESS_DLL_EXPORTS or SCL_EXPRESS_DLL_IMPORTS can be defined, not both."
|
||||
# elif defined(SCL_EXPRESS_DLL_EXPORTS)
|
||||
# define SCL_EXPRESS_EXPORT __declspec(dllexport)
|
||||
# elif defined(SCL_EXPRESS_DLL_IMPORTS)
|
||||
# define SCL_EXPRESS_EXPORT __declspec(dllimport)
|
||||
# else
|
||||
# define SCL_EXPRESS_EXPORT
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Import/Export flags for exppp. */
|
||||
#ifndef SCL_EXPPP_EXPORT
|
||||
# if defined(SCL_EXPPP_DLL_EXPORTS) && defined(SCL_EXPPP_DLL_IMPORTS)
|
||||
# error "Only SCL_EXPPP_DLL_EXPORTS or SCL_EXPPP_DLL_IMPORTS can be defined, not both."
|
||||
# elif defined(SCL_EXPPP_DLL_EXPORTS)
|
||||
# define SCL_EXPPP_EXPORT __declspec(dllexport)
|
||||
# elif defined(SCL_EXPPP_DLL_IMPORTS)
|
||||
# define SCL_EXPPP_EXPORT __declspec(dllimport)
|
||||
# else
|
||||
# define SCL_EXPPP_EXPORT
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Import/Export flags for utils. */
|
||||
#ifndef SCL_UTILS_EXPORT
|
||||
# if defined(SCL_UTILS_DLL_EXPORTS) && defined(SCL_UTILS_DLL_IMPORTS)
|
||||
# error "Only SCL_UTILS_DLL_EXPORTS or SCL_UTILS_DLL_IMPORTS can be defined, not both."
|
||||
# elif defined(SCL_UTILS_DLL_EXPORTS)
|
||||
# define SCL_UTILS_EXPORT __declspec(dllexport)
|
||||
# elif defined(SCL_UTILS_DLL_IMPORTS)
|
||||
# define SCL_UTILS_EXPORT __declspec(dllimport)
|
||||
# else
|
||||
# define SCL_UTILS_EXPORT
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Import/Export flags for dai. */
|
||||
#ifndef SCL_DAI_EXPORT
|
||||
# if defined(SCL_DAI_DLL_EXPORTS) && defined(SCL_DAI_DLL_IMPORTS)
|
||||
# error "Only SCL_DAI_DLL_EXPORTS or SCL_DAI_DLL_IMPORTS can be defined, not both."
|
||||
# elif defined(SCL_DAI_DLL_EXPORTS)
|
||||
# define SCL_DAI_EXPORT __declspec(dllexport)
|
||||
# elif defined(SCL_DAI_DLL_IMPORTS)
|
||||
# define SCL_DAI_EXPORT __declspec(dllimport)
|
||||
# else
|
||||
# define SCL_DAI_EXPORT
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Import/Export flags for core. */
|
||||
#ifndef SCL_CORE_EXPORT
|
||||
# if defined(SCL_CORE_DLL_EXPORTS) && defined(SCL_CORE_DLL_IMPORTS)
|
||||
# error "Only SCL_CORE_DLL_EXPORTS or SCL_CORE_DLL_IMPORTS can be defined, not both."
|
||||
# elif defined(SCL_CORE_DLL_EXPORTS)
|
||||
# define SCL_CORE_EXPORT __declspec(dllexport)
|
||||
# elif defined(SCL_CORE_DLL_IMPORTS)
|
||||
# define SCL_CORE_EXPORT __declspec(dllimport)
|
||||
# else
|
||||
# define SCL_CORE_EXPORT
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Import/Export flags for editor. */
|
||||
#ifndef SCL_EDITOR_EXPORT
|
||||
# if defined(SCL_EDITOR_DLL_EXPORTS) && defined(SCL_EDITOR_DLL_IMPORTS)
|
||||
# error "Only SCL_EDITOR_DLL_EXPORTS or SCL_EDITOR_DLL_IMPORTS can be defined, not both."
|
||||
# elif defined(SCL_EDITOR_DLL_EXPORTS)
|
||||
# define SCL_EDITOR_EXPORT __declspec(dllexport)
|
||||
# elif defined(SCL_EDITOR_DLL_IMPORTS)
|
||||
# define SCL_EDITOR_EXPORT __declspec(dllimport)
|
||||
# else
|
||||
# define SCL_EDITOR_EXPORT
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif /* SCL_EXPORT_H */
|
||||
@@ -0,0 +1,54 @@
|
||||
#ifndef STDBOOL_H_
|
||||
#define STDBOOL_H_
|
||||
|
||||
/**
|
||||
* stdbool.h - ISO C99 Boolean type
|
||||
* Author - Bill Chatfield
|
||||
* E-mail - bill underscore chatfield at yahoo dot com
|
||||
* Copyright - You are free to use for any purpose except illegal acts
|
||||
* Warrenty - None: don't blame me if it breaks something
|
||||
*
|
||||
* In ISO C99, stdbool.h is a standard header and _Bool is a keyword, but
|
||||
* some compilers don't offer these yet. This header file is an
|
||||
* implementation of the standard ISO C99 stdbool.h header file. It checks
|
||||
* for various compiler versions and defines things that are missing in
|
||||
* those versions.
|
||||
*
|
||||
* The GNU and Watcom compilers include a stdbool.h, but the Borland
|
||||
* C/C++ 5.5.1 compiler and the Microsoft compilers do not.
|
||||
*
|
||||
* See http://predef.sourceforge.net/precomp.html for compile macros.
|
||||
*/
|
||||
|
||||
#ifndef __cplusplus
|
||||
|
||||
/**
|
||||
* Borland C++ 5.5.1 does not define _Bool.
|
||||
*/
|
||||
#if defined(__BORLANDC__) && __BORLANDC__ < 0x630
|
||||
typedef int _Bool;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Microsoft C/C++ version 14.00.50727.762, which comes with Visual C++ 2005,
|
||||
* and version 15.00.30729.01, which comes with Visual C++ 2008, do not
|
||||
* define _Bool.
|
||||
*/
|
||||
#if defined(_MSC_VER)
|
||||
typedef int _Bool;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Define the Boolean macros only if they are not already defined.
|
||||
*/
|
||||
#ifndef __bool_true_false_are_defined
|
||||
#define bool _Bool
|
||||
#define Boolean _Bool
|
||||
#define false 0
|
||||
#define true 1
|
||||
#define __bool_true_false_are_defined 1
|
||||
#endif
|
||||
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /*STDBOOL_H_*/
|
||||
@@ -1,245 +0,0 @@
|
||||
#ifndef SCLPREFIXES_H
|
||||
#define SCLPREFIXES_H
|
||||
|
||||
/* **********************
|
||||
|
||||
The macro SCLP23_NAME is used in header files and for constructor/destructor
|
||||
class function names in corresponding .cc files.
|
||||
|
||||
The macro SCLP23 is used everywhere else.
|
||||
|
||||
********************* */
|
||||
|
||||
// *note* Currently the IDL generated code is not in a namespace.
|
||||
//#undef NO_P26_NAMESPACE
|
||||
//#define NO_P26_NAMESPACE 1
|
||||
|
||||
// P stands for Part (yeah, it's just to make it short & unique - hopefully)
|
||||
// as in Part 23 or Part 26.
|
||||
|
||||
#ifdef PART26 // SCL's Part 23 is providing the implementation for the Part 26
|
||||
// Orbix-generated software interface.
|
||||
|
||||
// The namespace is specified to be SDAI by Part 26 and Part 23
|
||||
// Since Part 23 and Part 26 defined objects are suppose to have the same
|
||||
// names and are supposed to be defined in a namespace called SDAI, define
|
||||
// the namespaces names for Part 23 and 26 to be different (to avoid conflict)
|
||||
|
||||
// This is the namespace for SCL's Part 23 SDAI.
|
||||
#define P23_NAMESPACE P23
|
||||
// Whenever you have something like P23_NAMESPACE##_name the preprocessor
|
||||
// does the concatenation first then substitutes things. Thus you get
|
||||
// P23_NAMESPACE_name instead of <whatever P23_NAMESPACE is>_name. If you
|
||||
// call P23_NAMESPACE_F() like P23_NAMESPACE_F(_name) you get
|
||||
// whatever P23_NAMESPACE is>_name like you want. The user never has to
|
||||
// use this macro. It is used in the definition of macros the user uses like
|
||||
// SCLP23() and SCLP23_NAME().
|
||||
#define P23_NAMESPACE_F(x) P23##x
|
||||
|
||||
// This was used by the ITI code. It holds the same meaning as P23_NAMESPACE
|
||||
#define IMP_NAMESPACE P23_NAMESPACE
|
||||
#define IMP_NAMESPACE_F(x) P23_NAMESPACE_F(x)
|
||||
// as defined by original ITI code
|
||||
// #define IMP_NAMESPACE P26_SDAI
|
||||
|
||||
// This is the namespace used by the IDL generated code implementing Part 26.
|
||||
//
|
||||
// define NO_P26_NAMESPACE if you are not going to define an encapsulating
|
||||
// module in the idl. If you define a module named SDAI then you will have to
|
||||
// refer to the class for interface PID (e.g.) as SDAI::PID and you will have
|
||||
// to refer to the macros as DEF_TIE_SDAI_PID() and TIE_SDAI_PID() instead of
|
||||
// DEF_TIE_PID() and TIE_PID(). DEF_TIE_IDL_MODULE() and TIE_IDL_MODULE()
|
||||
// handle this problem in the code.
|
||||
// You should define P26_NAMESPACE the same as the name you use for the idl
|
||||
// module. Without a module you should define NO_P26_NAMESPACE
|
||||
//
|
||||
// DEF_TIE_IDL_MODULE handles the DEF_TIE macro depending on whether a module
|
||||
// name was used in the idl. e.g. for class/interface named PID
|
||||
//#define SDAI_DEF_TIE_PID(X) DEF_TIE_IDL_MODULE(PID,X)
|
||||
// replaces either of these two stmts in your code depending on whether a
|
||||
// module name SDAI was used.
|
||||
//#define SDAI_DEF_TIE_PID(X) DEF_TIE_PID(X)
|
||||
//#define SDAI_DEF_TIE_PID(X) DEF_TIE_SDAI_PID(X)
|
||||
//
|
||||
// TIE_IDL_MODULE handles the TIE macro depending on whether a module
|
||||
// name was used in the idl. e.g. for class/interface named PID
|
||||
//#define _SDAI_TIE_PID_(X) TIE_IDL_MODULE(PID,X)
|
||||
// replaces either of these two stmts in your code depending on whether a
|
||||
// module name SDAI was used.
|
||||
//#define _SDAI_TIE_PID_(X) TIE_PID(X)
|
||||
//#define _SDAI_TIE_PID_(X) TIE_SDAI_PID(X)
|
||||
|
||||
#ifdef NO_P26_NAMESPACE
|
||||
#define P26_NAMESPACE
|
||||
#define P26_NAMESPACE_F(x) x
|
||||
#define DEF_TIE_IDL_MODULE(x,y) DEF_TIE_##x(y)
|
||||
#define TIE_IDL_MODULE(x,y) TIE_##x(y)
|
||||
#else
|
||||
// edit "SDAI" here to match the name of your module
|
||||
#define P26_NAMESPACE SDAI
|
||||
#define P26_NAMESPACE_F(x) SDAI##x
|
||||
#define DEF_TIE_IDL_MODULE(x,y) DEF_TIE_SDAI_##x(y)
|
||||
#define TIE_IDL_MODULE(x,y) TIE_SDAI_##x(y)
|
||||
#endif
|
||||
|
||||
// This would be the namespace for your application schema.
|
||||
// This is for the ITI-developed code. It really shouldn't go here - DAS
|
||||
#define APP_NAMESPACE P26_Simple_geometry
|
||||
|
||||
#else // SCL's Part 23 is not providing the implementation for the Part 26
|
||||
// Orbix-generated software interface.
|
||||
|
||||
// This is the namespace for SCL's Part 23 SDAI.
|
||||
#define P23_NAMESPACE SDAI
|
||||
#define P23_NAMESPACE_F(x) SDAI##x
|
||||
|
||||
// This was used by the ITI code. It holds the same meaning as P23_NAMESPACE
|
||||
#define IMP_NAMESPACE P23_NAMESPACE
|
||||
#define IMP_NAMESPACE_F(x) P23_NAMESPACE_F(x)
|
||||
// as defined by original ITI code
|
||||
// #define IMP_NAMESPACE SDAI
|
||||
|
||||
// This is the namespace used by the IDL generated code implementing Part 26.
|
||||
// **Note this should never be used if PART26 is not defined.
|
||||
#define P26_NAMESPACE
|
||||
#define P26_NAMESPACE_F(x) x
|
||||
|
||||
// This would be the namespace for your application schema.
|
||||
// This is for the ITI-developed code. It really shouldn't go here - DAS
|
||||
#define APP_NAMESPACE Simple_geometry
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#define CC_NO_NESTED_CLASSES 1
|
||||
#ifdef CC_NO_NESTED_CLASSES
|
||||
|
||||
///////////////////////
|
||||
// Use this macro to enclose objects generated from IDL interface types.
|
||||
// i.e. Part 26 based generated types.
|
||||
// Use this with types that will ONLY ever be Part 26 types. For types
|
||||
// that can switch use PART22() macro.
|
||||
// Used with the IDL compiler generated C++ - DAS
|
||||
#define SCLP26(X) P26_NAMESPACE_F(_##X)
|
||||
|
||||
// Used by ITI code to enclose objects generated from IDL interface types.
|
||||
// This is used for function arguments and return types that need to be
|
||||
// either the Part 26 version or the Part 23 version depending on whether
|
||||
// the Part 23 interface is being used standalone or to implement Orbix
|
||||
// implementation objects using the TIE approach. - DAS
|
||||
// This one is defined to use the Part 26 defined type for use with Orbix.
|
||||
#define SCLP22_NAME(X) P26_NAMESPACE_F(_##X)
|
||||
#define SCLP22(X) P26_NAMESPACE_F(_##X)
|
||||
// as defined by ITI
|
||||
// #define SCLP22(X) SDAI_##X
|
||||
|
||||
// Use this macro to enclose references to CORBA types.
|
||||
// Used with the Orbix base C++ types/classes #included via CORBA.h.
|
||||
// i.e. not used with types/interfaces generated from a users IDL schema.
|
||||
// DAS
|
||||
#define CORBA_REF(X) CORBA_##X
|
||||
|
||||
// I don't understand why this is necessary - DAS
|
||||
// Use this macro to enclose references to CORBA Object and Object_ptr
|
||||
#define SCLP22_BASE(X) CORBA_##X
|
||||
|
||||
|
||||
// SCLP23_NAME is used in header files and for constructor/destructor
|
||||
// class function names in corresponding .cc files.
|
||||
// Use this macro to enclose declarations of implementation types.
|
||||
#define SCLP23_NAME(x) P23_NAMESPACE_F(_##x)
|
||||
|
||||
// SCLP23 is used everywhere else.
|
||||
// Use this macro to enclose uses of Part 23 based (implementation) types.
|
||||
#define SCLP23(x) P23_NAMESPACE_F(_##x)
|
||||
|
||||
// Use this macro to enclose references to implementation types
|
||||
// whose names have already been qualified
|
||||
// I don't understand this macros use - DAS
|
||||
#define SCLP23_SPACE(x) x
|
||||
|
||||
// INTEGRATION appmacros here...
|
||||
#define SCLP22_SIMPLE_GEOMETRY(X) SDAI_Simple_geometry_##X
|
||||
#define SCLP23_SIMPLE_GEOMETRY_NAME(x) APP_NAMESPACE##_##x
|
||||
#define SCLP23_SIMPLE_GEOMETRY(x) APP_NAMESPACE##_##x
|
||||
///////////////////////////////////
|
||||
|
||||
#else // nested classes are allowed by the compiler
|
||||
/////////////////////////////////////
|
||||
|
||||
///////////////////////
|
||||
// Use this macro to enclose objects generated from IDL interface types.
|
||||
// i.e. Part 26 based generated types.
|
||||
// Used with the IDL compiler generated C++ - DAS
|
||||
#ifdef NO_P26_NAMESPACE
|
||||
#define SCLP26(X) X
|
||||
#else
|
||||
#define SCLP26(X) P26_NAMESPACE_F(::##X)
|
||||
#endif
|
||||
|
||||
// Used by ITI code to enclose objects generated from IDL interface types.
|
||||
// This is used for function arguments and return types that need to be
|
||||
// either the Part 26 version or the Part 23 version depending on whether
|
||||
// the Part 23 interface is being used standalone or to implement Orbix
|
||||
// implementation objects using the TIE approach. - DAS
|
||||
// This one is defined to use the Part 26 defined type for use with Orbix.
|
||||
#ifdef NO_P26_NAMESPACE
|
||||
#define SCLP22_NAME(X) X
|
||||
#define SCLP22(X) X
|
||||
#else
|
||||
#define SCLP22_NAME(X) P26_NAMESPACE_F(::##X)
|
||||
#define SCLP22(X) P26_NAMESPACE_F(::##X)
|
||||
#endif
|
||||
// as defined by ITI
|
||||
// #define SCLP22(X) SDAI::##X
|
||||
|
||||
// Use this macro to enclose references to CORBA types.
|
||||
// Used with the Orbix base C++ types/classes #included via CORBA.h.
|
||||
// i.e. not used with types/interfaces generated from a users IDL schema.
|
||||
// DAS
|
||||
#define CORBA_REF(X) CORBA::##X
|
||||
|
||||
// I don't understand why this is necessary - DAS
|
||||
// Use this macro to enclose references to CORBA Object and Object_ptr
|
||||
#define SCLP22_BASE(X) CORBA::##X
|
||||
|
||||
// SCLP23_NAME is used in header files and for constructor/destructor
|
||||
// class function names in corresponding .cc files.
|
||||
// Use this macro to enclose declarations of implementation types.
|
||||
#ifdef PART26
|
||||
#define SCLP23_NAME(x) P23_NAMESPACE_F(_imp##x)
|
||||
// #define SCLP23_NAME(x) imp##x
|
||||
#else
|
||||
#define SCLP23_NAME(x) x
|
||||
#endif
|
||||
|
||||
// SCLP23 is used everywhere else.
|
||||
// Use this macro to enclose uses of Part 23 based (implementation) types.
|
||||
#ifdef PART26
|
||||
#define SCLP23(x) P23_NAMESPACE_F(_imp##x)
|
||||
// #define SCLP23(x) P23_NAMESPACE_F(::##imp##x)
|
||||
#else
|
||||
#define SCLP23(x) P23_NAMESPACE_F(::##x)
|
||||
#endif
|
||||
// as defined by ITI
|
||||
// #define SCLP23(x) IMP_NAMESPACE_F(::imp##x)
|
||||
|
||||
// Use this macro to enclose references to implementation types
|
||||
// whose names have already been qualified
|
||||
// I don't understand this macros use - DAS
|
||||
#ifdef PART26
|
||||
#define SCLP23_SPACE(x) P23_NAMESPACE_F(_imp##x)
|
||||
// #define SCLP23_SPACE(x) P23_NAMESPACE_F(::##imp##x)
|
||||
#else
|
||||
#define SCLP23_SPACE(x) IMP_NAMESPACE_F(::x)
|
||||
#endif
|
||||
|
||||
// INTEGRATION appmacros here...
|
||||
#define SCLP22_SIMPLE_GEOMETRY(X) SDAI::Simple_geometry::##X
|
||||
#define SCLP23_SIMPLE_GEOMETRY_NAME(x) imp##x
|
||||
#define SCLP23_SIMPLE_GEOMETRY(x) APP_NAMESPACE::imp##x
|
||||
/////////////////////////////////////
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,31 @@
|
||||
// XGetopt.h Version 1.2
|
||||
//
|
||||
// Author: Hans Dietrich
|
||||
// hdietrich2@hotmail.com
|
||||
//
|
||||
// This software is released into the public domain.
|
||||
// You are free to use it in any way you like.
|
||||
//
|
||||
// This software is provided "as is" with no expressed
|
||||
// or implied warranty. I accept no liability for any
|
||||
// damage or loss of business that this software may cause.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef XGETOPT_H
|
||||
#define XGETOPT_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern int optind, opterr;
|
||||
extern char * optarg;
|
||||
|
||||
int getopt( int argc, char * argv[], char * optstring );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //XGETOPT_H
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
# astyle --options=misc/astyle.cfg path/to/file
|
||||
|
||||
#run astyle on all files: from the scl root dir, use
|
||||
# astyle --options=misc/astyle.cfg --recursive "src/*.c" "src/*.cc" "include/*.h"
|
||||
# astyle --options=misc/astyle.cfg --recursive "src/*.c" "src/*.cc" "include/*.h" "src/*.h"
|
||||
# in the above line, the double quotes *are* necessary
|
||||
|
||||
# DO NOT run astyle on flex/bison input such as expparse.y and expscan.l!
|
||||
|
||||
@@ -0,0 +1,229 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE language SYSTEM "language.dtd">
|
||||
<!--
|
||||
EXPRESS syntax definition based on sql-mysql.xml by Shane Wright (me@shanewright.co.uk)
|
||||
|
||||
This is for Kate, the KDE editor. Rename to express.xml and place in the syntax directory (on Debian, this is /usr/share/kde4/apps/katepart/syntax )
|
||||
-->
|
||||
<language name="EXPRESS" version="0.1" kateversion="2.5" section="Database" extensions="*.exp;*.EXP;*.p11" mimetype="text/x-express" casesensitive="0" author="Mark Pictor (mpictor@gmail.com)" license="">
|
||||
<highlighting>
|
||||
<list name="keywords">
|
||||
<item> of </item>
|
||||
<item> or </item>
|
||||
<item> to </item>
|
||||
<item> where </item>
|
||||
<item> subtype </item>
|
||||
<item> supertype </item>
|
||||
<item> abstract </item>
|
||||
<item> oneof </item>
|
||||
<item> not </item>
|
||||
<item> in </item>
|
||||
<item> and </item>
|
||||
<item> return </item>
|
||||
<item> then </item>
|
||||
<item> derive </item>
|
||||
<item> optional </item>
|
||||
<!-- put SCHEMA and END_SCHEMA here so code folding will fold
|
||||
everything in a schema, and not collapse the schema itself -->
|
||||
<item> schema </item>
|
||||
<item> end_schema </item>
|
||||
</list>
|
||||
<list name="kw_begin"> <!-- kw's that can begin a foldable region -->
|
||||
<item> type </item>
|
||||
<item> entity </item>
|
||||
<item> function </item>
|
||||
<item> rule </item>
|
||||
<item> constant </item>
|
||||
<item> if </item>
|
||||
<item> local </item>
|
||||
<item> repeat </item>
|
||||
<item> begin </item>
|
||||
<item> case </item>
|
||||
</list>
|
||||
<list name="kw_end"> <!-- kw's that can end a foldable region -->
|
||||
<item> end </item>
|
||||
<item> end_type </item>
|
||||
<item> end_entity </item>
|
||||
<item> end_function </item>
|
||||
<item> end_rule </item>
|
||||
<item> end_constant </item>
|
||||
<item> end_if </item>
|
||||
<item> end_local </item>
|
||||
<item> end_repeat </item>
|
||||
<item> end_case </item>
|
||||
</list>
|
||||
<list name="kw_end_begin"> <!-- end one foldable region, begin another -->
|
||||
<item> else </item>
|
||||
</list>
|
||||
<list name="interface_specification"> <!-- USE FROM, REFERENCE FROM -->
|
||||
<item> use </item>
|
||||
<item> reference </item>
|
||||
</list>
|
||||
|
||||
<list name="operators">
|
||||
<item> : </item>
|
||||
<item> , </item>
|
||||
<item> || </item>
|
||||
<item> . </item>
|
||||
<item> = </item>
|
||||
<item> ** </item>
|
||||
<item> | </item>
|
||||
<item> <* </item>
|
||||
<item> >= </item>
|
||||
<item> > </item>
|
||||
<item> :=: </item>
|
||||
<item> :<>: </item>
|
||||
<item> [ </item>
|
||||
<item> { </item>
|
||||
<item> ( </item>
|
||||
<item> <= </item>
|
||||
<item> < </item>
|
||||
<item> - </item>
|
||||
<item> <> </item>
|
||||
<item> + </item>
|
||||
<item> / </item>
|
||||
<item> ] </item>
|
||||
<item> } </item>
|
||||
<item> ) </item>
|
||||
<item> * </item>
|
||||
<item> \\ </item>
|
||||
</list>
|
||||
<list name="functions">
|
||||
<item> ABS </item>
|
||||
<item> ACOS </item>
|
||||
<item> ASIN </item>
|
||||
<item> ATAN </item>
|
||||
<item> BLENGTH </item>
|
||||
<item> COS </item>
|
||||
<item> EXISTS </item>
|
||||
<item> EXP </item>
|
||||
<item> FORMAT </item>
|
||||
<item> HIBOUND </item>
|
||||
<item> HIINDEX </item>
|
||||
<item> LENGTH </item>
|
||||
<item> LOBOUND </item>
|
||||
<item> LOINDEX </item>
|
||||
<item> LOG </item>
|
||||
<item> LOG2 </item>
|
||||
<item> LOG10 </item>
|
||||
<item> NVL </item>
|
||||
<item> ODD </item>
|
||||
<item> ROLESOF </item>
|
||||
<item> SIN </item>
|
||||
<item> SIZEOF </item>
|
||||
<item> SQRT </item>
|
||||
<item> TAN </item>
|
||||
<item> TYPEOF </item>
|
||||
<item> USEDIN </item>
|
||||
<item> VALUE </item>
|
||||
<item> VALUE_IN </item>
|
||||
<item> VALUE_UNIQUE </item>
|
||||
<item> QUERY </item>
|
||||
</list>
|
||||
<list name="constants">
|
||||
<item> CONST_E </item>
|
||||
<item> PI </item>
|
||||
<item> SELF </item>
|
||||
<!-- <item> ? </item> -->
|
||||
</list>
|
||||
<list name="types">
|
||||
<item> binary </item>
|
||||
<item> boolean </item>
|
||||
<item> integer </item>
|
||||
<item> logical </item>
|
||||
<item> number </item>
|
||||
<item> real </item>
|
||||
<item> string </item>
|
||||
<item> enumeration </item>
|
||||
<item> select </item>
|
||||
<item> array </item>
|
||||
<item> list </item>
|
||||
<item> bag </item>
|
||||
<item> set </item>
|
||||
<item> generic </item>
|
||||
</list>
|
||||
<contexts>
|
||||
<context name="Normal" attribute="Normal Text" lineEndContext="#stay">
|
||||
<DetectSpaces />
|
||||
<!-- Make code folding work for SCHEMA/END_SCHEMA, TYPE/END_TYPE, etc -->
|
||||
<!-- <RegExpr attribute="Block" context="#stay" String="(?:^|[^\w'])(?:SCHEMA|TYPE|ENTITY|FUNCTION|RULE|CONSTANT|IF|LOCAL|REPEAT|BEGIN)" insensitive="false" beginRegion="Blk" firstNonSpace="false" /> -->
|
||||
<!-- <RegExpr attribute="Block" context="#stay" String="END_(?:SCHEMA|TYPE|ENTITY|FUNCTION|RULE|CONSTANT|IF|LOCAL|REPEAT)" insensitive="false" endRegion="Blk" firstNonSpace="false" /> -->
|
||||
<!-- <RegExpr attribute="Block" context="#stay" String="END(?:[^_]|$)" endRegion="Blk" firstNonSpace="false" /> -->
|
||||
<!-- <RegExpr attribute="Block" context="#stay" String="(?:^|[^\w])ELSE(?:$|[^\w])" endRegion="Blk" beginRegion="Blk" firstNonSpace="false" /> -->
|
||||
|
||||
<!-- using the lists -->
|
||||
<keyword attribute="Keyword" context="#stay" String="keywords"/>
|
||||
<keyword attribute="Keyword" context="#stay" String="kw_begin" beginRegion="Blk" firstNonSpace="false"/>
|
||||
<keyword attribute="Keyword" context="#stay" String="kw_end_begin" endRegion="Blk" beginRegion="Blk" firstNonSpace="false" />
|
||||
<keyword attribute="Keyword" context="#stay" String="kw_end" endRegion="Blk" firstNonSpace="false"/>
|
||||
|
||||
<keyword attribute="Operator" context="#stay" String="operators"/>
|
||||
<keyword attribute="Function" context="#stay" String="functions"/>
|
||||
<keyword attribute="Constants" context="#stay" String="constants"/>
|
||||
<keyword attribute="Data Type" context="#stay" String="types"/>
|
||||
|
||||
<keyword attribute="Interface Specification" context="Interface Specification" String="interface_specification" firstNonSpace="true" />
|
||||
|
||||
<DetectIdentifier />
|
||||
<!-- extra data types -->
|
||||
<!-- numbers -->
|
||||
<HlCHex attribute="Hex" context="#stay"/>
|
||||
<Float attribute="Float" context="#stay"/>
|
||||
<Int attribute="Decimal" context="#stay"/>
|
||||
<!-- strings -->
|
||||
<DetectChar attribute="String" context="String" char="'"/>
|
||||
<DetectChar attribute="String" context="String2" char="""/>
|
||||
<!-- comments -->
|
||||
<Detect2Chars attribute="Comment" context="SingleLineComment" char="-" char1="-"/>
|
||||
<Detect2Chars attribute="Comment" context="MultiLineComment" char="(" char1="*" beginRegion="Comment"/>
|
||||
|
||||
<DetectChar attribute="Constants" context="#stay" char="?"/>
|
||||
</context>
|
||||
<!-- 'string' -->
|
||||
<context name="String" attribute="String" lineEndContext="#stay">
|
||||
<LineContinue attribute="String" context="#pop"/>
|
||||
<DetectChar attribute="String" context="#pop" char="'"/>
|
||||
</context>
|
||||
<!-- "string", extra context needed to enable "str'ing" and 'str"ing' -->
|
||||
<context name="String2" attribute="String" lineEndContext="#stay">
|
||||
<LineContinue attribute="String" context="#pop"/>
|
||||
<HlCStringChar attribute="String Char" context="#stay"/>
|
||||
<DetectChar attribute="String" context="#pop" char="""/>
|
||||
</context>
|
||||
<!-- comments -->
|
||||
<context name="SingleLineComment" attribute="Comment" lineEndContext="#pop"/>
|
||||
<context name="MultiLineComment" attribute="Comment" lineEndContext="#stay">
|
||||
<Detect2Chars attribute="Comment" context="#pop" char="*" char1=")" endRegion="Comment" />
|
||||
</context>
|
||||
<context name="Interface Specification" attribute="Interface Specification" >
|
||||
<!-- lineEndContext="#pop" -->
|
||||
<DetectChar attribute="Interface Specification" context="#pop" char=";"/>
|
||||
</context>
|
||||
</contexts>
|
||||
<itemDatas>
|
||||
<itemData name="Normal Text" defStyleNum="dsNormal" spellChecking="false"/>
|
||||
<itemData name="Keyword" defStyleNum="dsKeyword" spellChecking="false"/>
|
||||
<itemData name="Block" defStyleNum="dsKeyword" spellChecking="false"/>
|
||||
<itemData name="Operator" defStyleNum="dsNormal" spellChecking="false"/>
|
||||
<itemData name="Function" defStyleNum="dsFunction" spellChecking="false"/>
|
||||
<itemData name="Constants" defStyleNum="dsOthers" spellChecking="false"/>
|
||||
<itemData name="Data Type" defStyleNum="dsDataType" spellChecking="false"/>
|
||||
<itemData name="Decimal" defStyleNum="dsDecVal" spellChecking="false"/>
|
||||
<itemData name="Float" defStyleNum="dsFloat" spellChecking="false"/>
|
||||
<itemData name="Hex" defStyleNum="dsBaseN" spellChecking="false"/>
|
||||
<itemData name="String" defStyleNum="dsString"/>
|
||||
<itemData name="String Char" defStyleNum="dsChar" spellChecking="false"/>
|
||||
<itemData name="Comment" defStyleNum="dsComment"/>
|
||||
<itemData name="Interface Specification" defStyleNum="dsOthers" spellChecking="false"/>
|
||||
</itemDatas>
|
||||
</highlighting>
|
||||
<general>
|
||||
<comments>
|
||||
<comment name="singleLine" start="--"/>
|
||||
<comment name="multiLine" start="(*" end="*)"/>
|
||||
</comments>
|
||||
<keywords casesensitive="0" additionalDeliminator="'" />
|
||||
<!-- weakDeliminator="+-*/|=!<>~^:." -->
|
||||
</general>
|
||||
</language>
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
<NotepadPlus>
|
||||
<UserLang name="Express Schema" ext="exp">
|
||||
<Settings>
|
||||
<Global caseIgnored="yes" />
|
||||
<TreatAsSymbol comment="no" commentLine="no" />
|
||||
<Prefix words1="no" words2="no" words3="no" words4="no" />
|
||||
</Settings>
|
||||
<KeywordLists>
|
||||
<Keywords name="Delimiters">000000</Keywords>
|
||||
<Keywords name="Folder+">type entity function rule constant if local repeat begin case else</Keywords>
|
||||
<Keywords name="Folder-">end_type end_entity end_function end_rule end_constant end_if end_local end_repeat end end_base else</Keywords>
|
||||
<Keywords name="Operators">" , . / : ; [ \ ] { | } < = ></Keywords>
|
||||
<Keywords name="Comment"> 1(* 2*) 0--</Keywords>
|
||||
<Keywords name="Words1">of or to where subtype supertype abstract oneof not in and return then derive optional schema end_schema</Keywords>
|
||||
<Keywords name="Words2">abs acos asin atan blength cos exists exp format hibound hiindex length lobound loindex log log2 log10 nvl odd rolesof sin sizeof sqrt tan typeof usedin value value_in value_unique query</Keywords>
|
||||
<Keywords name="Words3">const_e pi self</Keywords>
|
||||
<Keywords name="Words4">binary boolean integer logical number real string enumeration select array list bag set generic</Keywords>
|
||||
</KeywordLists>
|
||||
<Styles>
|
||||
<WordsStyle name="DEFAULT" styleID="11" fgColor="000000" bgColor="FFFFFF" fontStyle="0" />
|
||||
<WordsStyle name="FOLDEROPEN" styleID="12" fgColor="800000" bgColor="FFFFFF" fontStyle="0" />
|
||||
<WordsStyle name="FOLDERCLOSE" styleID="13" fgColor="800000" bgColor="FFFFFF" fontStyle="0" />
|
||||
<WordsStyle name="KEYWORD1" styleID="5" fgColor="800000" bgColor="FFFFFF" fontStyle="0" />
|
||||
<WordsStyle name="KEYWORD2" styleID="6" fgColor="800000" bgColor="FFFFFF" fontStyle="0" />
|
||||
<WordsStyle name="KEYWORD3" styleID="7" fgColor="FF8000" bgColor="FFFFFF" fontStyle="0" />
|
||||
<WordsStyle name="KEYWORD4" styleID="8" fgColor="0000FF" bgColor="FFFFFF" fontStyle="0" />
|
||||
<WordsStyle name="COMMENT" styleID="1" fgColor="008000" bgColor="FFFFFF" fontStyle="0" />
|
||||
<WordsStyle name="COMMENT LINE" styleID="2" fgColor="008000" bgColor="FFFFFF" fontStyle="0" />
|
||||
<WordsStyle name="NUMBER" styleID="4" fgColor="000000" bgColor="FFFFFF" fontStyle="0" />
|
||||
<WordsStyle name="OPERATOR" styleID="10" fgColor="FF0000" bgColor="FFFFFF" fontStyle="0" />
|
||||
<WordsStyle name="DELIMINER1" styleID="14" fgColor="000000" bgColor="FFFFFF" fontStyle="0" />
|
||||
<WordsStyle name="DELIMINER2" styleID="15" fgColor="000000" bgColor="FFFFFF" fontStyle="0" />
|
||||
<WordsStyle name="DELIMINER3" styleID="16" fgColor="000000" bgColor="FFFFFF" fontStyle="0" />
|
||||
</Styles>
|
||||
</UserLang>
|
||||
</NotepadPlus>
|
||||
@@ -9,7 +9,7 @@ result_dir="."
|
||||
mk="make -j4"
|
||||
|
||||
#separated by ; for cmake
|
||||
schemas="../data/ap203/203wseds.exp;../data/ap203e2/ap203e2_mim_lf.exp;../data/ap210e3/ap210e3_wip1.41_mim_lf.exp;../data/ap214e3/AP214E3_2010.exp;../data/ap227/ap227.exp;../data/ap235/AP235-aim-long.exp;../data/ap240/AP240_aim_lf.exp;../data/cd209/part409cdts_wg3n2617mim_lf.exp;../data/cd242/242_n2813_mim_lf.exp;../data/ifc2x3/IFC2X3_TC1.exp;../data/ifc2x4/IFC2X4_RC2.exp;../data/ISO15926/15926-0002-lifecycle_integration.exp"
|
||||
schemas="../data/203wseds/203wseds.exp;../data/ap203e2/ap203e2_mim_lf.exp;../data/ap210e2/ap210e2_v1_40_mim_lf.exp;../data/wip210e3/210e3_wip_v1_41_mim_lf.exp;../data/ap214e3/AP214E3_2010.exp;../data/ap227/ap227.exp;../data/ap235/AP235_TC_engineering_properties_schema_20110222.exp;../data/ap240/AP240_aim_lf.exp;../data/cd209/part409cdts_wg3n2617mim_lf.exp;../data/cd242/242_n2813_mim_lf.exp;../data/ifc2x3/IFC2X3_TC1.exp;../data/ifc2x4/IFC2X4_RC3.exp;../data/ISO15926/15926-0002-lifecycle_integration.exp"
|
||||
#count warnings and errors, append to $matrix_file. creates hypertext links to stderr,stdout txt
|
||||
# $1 is the name of the row, $2 is the path and first part of the filename, $3 is the schema
|
||||
function count_we {
|
||||
@@ -78,11 +78,12 @@ function fedex_details {
|
||||
function build_one_schema {
|
||||
#set $i to the schema name, all caps (to match fedex_plus output)
|
||||
i=`sed -ne '0,/^\s*SCHEMA/s/^.*SCHEMA\s\+\(.*\);.*$/\1/p;' $1|tr a-z A-Z`
|
||||
d=`echo $1|sed -e 's|^.*/\([^/]*\)\.exp$|\1|;'`
|
||||
|
||||
echo "Running fedex_plus and gcc for $i..."
|
||||
make -f data/CMakeFiles/sdai_$i.dir/build.make $i/compstructs.cc 2>"$result_dir/fedex_"$i"_stderr.txt" >"$result_dir/fedex_"$i"_stdout.txt" && \
|
||||
$mk sdai_$i >/dev/null 2>"$result_dir/compile_libsdai_"$i"_stderr.txt" && \
|
||||
$mk p21read_sdai_$i >/dev/null 2>"$result_dir/compile_p21read_sdai_"$i"_stderr.txt"
|
||||
make generate_cpp_$d 2>"$result_dir/fedex_"$i"_stderr.txt" >"$result_dir/fedex_"$i"_stdout.txt" && \
|
||||
$mk sdai_$d >/dev/null 2>"$result_dir/compile_libsdai_"$i"_stderr.txt" && \
|
||||
$mk p21read_sdai_$d >/dev/null 2>"$result_dir/compile_p21read_sdai_"$i"_stderr.txt"
|
||||
|
||||
#todo: test p21read_sdai_$i
|
||||
}
|
||||
@@ -130,6 +131,7 @@ function gen_wiki {
|
||||
git log --decorate=short -n1 |\
|
||||
head -n1 |\
|
||||
sed -e 's|^.*commit \([a-z0-9]\+\) .*$|### Current as of commit [\1](http://github.com/mpictor/StepClassLibrary/commit/\1)|;' >>$matrix_file
|
||||
echo -e "\n## See also [PLIB build matrix](http://github.com/mpictor/StepClassLibrary/wiki/PLIB-build-matrix)\n\n" >>$matrix_file
|
||||
echo "<table border=1>" >>$matrix_file
|
||||
echo "<tr><th>Key</th></tr><tr><td><table width=100%>" >>$matrix_file
|
||||
echo "<tr><th>Item</th><th>Description</th></tr>" >>$matrix_file
|
||||
|
||||
@@ -0,0 +1,235 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
#you probably want to run the ctest script that calls this instead:
|
||||
# ctest -S ctest_matrix.cmake
|
||||
|
||||
#must be ran from scl/build_matrix
|
||||
|
||||
from xml.etree import ElementTree as ET
|
||||
import os
|
||||
from datetime import date
|
||||
import subprocess
|
||||
import codecs
|
||||
import io
|
||||
|
||||
|
||||
#ctest xml file layout
|
||||
#<Site ...=...>
|
||||
# <testing>
|
||||
# <StartDateTime>..</>
|
||||
# <StartTestTime>..</>
|
||||
# <TestList>..</>
|
||||
# <Test status=..>..</>
|
||||
# <EndDateTime>Dec 28 17:49 EST</EndDateTime>
|
||||
# <EndTestTime>1325112579</EndTestTime>
|
||||
# <ElapsedMinutes>1.9</ElapsedMinutes>
|
||||
# </Testing>
|
||||
#</Site>
|
||||
|
||||
|
||||
#summary (aka 's') is a table near the top of the document
|
||||
#body (aka 'b') contains the details for all schemas
|
||||
|
||||
def main():
|
||||
xml_file = find_xml()
|
||||
wikipath, matrix = find_wiki()
|
||||
|
||||
#codecs.open is deprecated but io.open doesn't seem to work, and open() complains of unicode
|
||||
out = codecs.open(matrix,encoding='utf-8',mode='w')
|
||||
out.write( header() )
|
||||
out.write( read_tests(xml_file) )
|
||||
out.close()
|
||||
git_push(wikipath, matrix)
|
||||
|
||||
|
||||
def find_xml():
|
||||
#find xml file
|
||||
i = 0
|
||||
for dirname in os.listdir("Testing"):
|
||||
if str(date.today().year) in dirname:
|
||||
i += 1
|
||||
if i > 1:
|
||||
print "Too many directories, exiting"
|
||||
exit(1)
|
||||
xml = os.path.join("Testing", dirname, "Test.xml")
|
||||
return xml
|
||||
|
||||
def find_wiki():
|
||||
#find wiki and matrix file, issue 'git pull'
|
||||
wikipath = os.path.abspath("../../wiki-scl")
|
||||
if not os.path.isdir(os.path.join(wikipath,".git")):
|
||||
print "Can't find wiki or not a git repo"
|
||||
exit(1)
|
||||
p = subprocess.call(["git", "pull", "origin"], cwd=wikipath)
|
||||
if not p == 0:
|
||||
print "'git pull' exited with error"
|
||||
exit(1)
|
||||
matrix = os.path.join(wikipath, "Schema-build-matrix.md")
|
||||
if not os.path.isfile(matrix):
|
||||
print "Matrix file doesn't exist or isn't a file"
|
||||
exit(1)
|
||||
return wikipath,matrix
|
||||
|
||||
def git_push(path,f):
|
||||
p = subprocess.call(["git", "add", f], cwd=path)
|
||||
if not p == 0:
|
||||
print "'git add' exited with error"
|
||||
exit(1)
|
||||
msg = date.today().__str__() + " - schema matrix updated by update-matrix.py"
|
||||
p = subprocess.call(["git", "commit", "-m", msg ], cwd=path)
|
||||
if not p == 0:
|
||||
print "'git commit' exited with error"
|
||||
exit(1)
|
||||
p = subprocess.call(["git", "push", "origin"], cwd=path)
|
||||
if not p == 0:
|
||||
print "'git push' exited with error"
|
||||
exit(1)
|
||||
|
||||
|
||||
def header():
|
||||
h = "## Created " + date.today().__str__() + "\n" + "### Current as of commit "
|
||||
l = subprocess.check_output(["git", "log", """--pretty=format:%H Commit Summary: %s<br>Author: %aN<br>Date: %aD""", "-n1"])
|
||||
h += "[" + l[:8] + "](http://github.com/mpictor/StepClassLibrary/commit/" + l[:l.find(" ")]
|
||||
h += ") --\n<font color=grey>" + l[l.find(" ")+1:] + "</font>\n\n----\n"
|
||||
h += "### Summary\n<table width=100%><tr><th>Schema</th><th>Generate</th><th>Build</th></tr>"
|
||||
return h
|
||||
|
||||
def read_tests(xml):
|
||||
# read all <Test>s in xml, create mixed html/markdown
|
||||
try:
|
||||
tree = ET.parse(xml)
|
||||
except Exception, inst:
|
||||
print "Unexpected error opening %s: %s" % (xml, inst)
|
||||
return
|
||||
|
||||
root = tree.getroot()
|
||||
testing = root.find("Testing")
|
||||
|
||||
|
||||
tests = testing.findall("Test")
|
||||
summary = ""
|
||||
body = ""
|
||||
for test in tests:
|
||||
s,b = schema_info(test,tests)
|
||||
summary += s
|
||||
body += b
|
||||
summary += "</table>\n\n"
|
||||
return summary + body
|
||||
|
||||
|
||||
|
||||
def schema_info(test,tests):
|
||||
# this returns html & markdown formatted summary and body strings
|
||||
# for the generate and build tests for a single schema
|
||||
s=""
|
||||
b=""
|
||||
name = test.find("Name").text
|
||||
if name.startswith("generate_cpp_"):
|
||||
#print this one. if it passes, find and print build.
|
||||
ap = name[len("generate_cpp_"):]
|
||||
s += "<tr><td><a href=#" + ap + ">" + ap.title() + "</a></td><td>"
|
||||
s += test_status(test) + "</td><td>"
|
||||
b += "----\n<a name=\"wiki-" + ap + "\"></a>\n"
|
||||
b += "### Schema " + ap.title()
|
||||
b += "<table width=100%>"
|
||||
b += test_table("generation",test)
|
||||
if test.get("Status") == "passed":
|
||||
for build in tests:
|
||||
if build.find("Name").text == "build_cpp_sdai_" + ap:
|
||||
s += test_status(build) + "</td></tr>\n"
|
||||
b += test_table("compilation",build)
|
||||
break
|
||||
else:
|
||||
s += "----</td></tr>\n"
|
||||
b += "</table>\n"
|
||||
return s,b
|
||||
|
||||
def test_table(ttype, test):
|
||||
# populate the table for one test
|
||||
# returns: html & markdown formatted text to be added to 'body'
|
||||
b = "<tr><td>Code " + ttype
|
||||
output = test.find("Results").find("Measurement").find("Value").text
|
||||
w = output.count("WARNING")
|
||||
w += output.count("warning")
|
||||
lines = output.split("\n")
|
||||
if "The rest of the test output was removed since it exceeds the threshold of" in lines[-2]:
|
||||
trunc1 = "at least "
|
||||
trunc2 = "(ctest truncated output)"
|
||||
else:
|
||||
trunc1 = ""
|
||||
trunc2 = ""
|
||||
if test.get("Status") == "passed":
|
||||
#print summary in b
|
||||
b += " succeeded with " + trunc1 + w.__str__() + " warnings " + trunc2
|
||||
if w == 0: #nothing to print in the table, so skip it
|
||||
b += "</td></tr>\n"
|
||||
return b
|
||||
else:
|
||||
#print warnings and errors in b
|
||||
e = output.count("ERROR")
|
||||
e += output.count("error")
|
||||
b += " failed with %s%d warnings and %d errors %s" %(trunc1, w, e, trunc2)
|
||||
b += "<br>\n<table border=1 width=100%>\n"
|
||||
b += "<tr><th>Line</th><th>Text</th></tr>\n"
|
||||
|
||||
# ERRORs
|
||||
# 242_n2813_mim_lf.exp:2278: --ERROR: Expected a type...
|
||||
# gcc errors look like ???
|
||||
l=0
|
||||
for line in lines:
|
||||
if ": --ERROR:" in line:
|
||||
l += 1
|
||||
c1 = line.find(":")
|
||||
c2 = line.find(":",c1+1)
|
||||
b += "<tr><td>" + line[c1+1:c2] + "</td><td>" + line[c2+4:] + "</td></tr>\n"
|
||||
elif ": error:" in line:
|
||||
l += 1
|
||||
c1 = line.find(":")
|
||||
c2 = line.find(":",c1+1)
|
||||
c3 = line.find(":",c2+1) #skip the character number
|
||||
b += "<tr><td>" + line[c1+1:c2] + "</td><td>" + line[c3+2:] + "</td></tr>\n"
|
||||
if l > 20:
|
||||
b += "<tr><td>-</td><td><font color=red>-- maximum number of errors printed --</font></td></tr>\n"
|
||||
break
|
||||
# WARNINGs
|
||||
# ap239_arm_lf.exp:2731: WARNING: Implicit downcast...
|
||||
# WARNING: in SELECT TYPE date_or_date... (multi-line warning)
|
||||
# compstructs.cc:28:23: warning: unused
|
||||
l=0
|
||||
for line in lines:
|
||||
if ": WARNING" in line:
|
||||
l += 1
|
||||
c1 = line.find(":")
|
||||
c2 = line.find(":",c1+1)
|
||||
b += "<tr><td>" + line[c1+1:c2] + "</td><td>" + line[c2+2:] + "</td></tr>\n"
|
||||
elif "WARNING" in line:
|
||||
b += "<tr><td>????</td><td>" + line + "</td></tr>\n"
|
||||
elif ": warning:" in line:
|
||||
l += 1
|
||||
c1 = line.find(":")
|
||||
c2 = line.find(":",c1+1)
|
||||
c3 = line.find(":",c2+1) #skip the character number
|
||||
b += "<tr><td>" + line[c1+1:c2] + "</td><td>" + line[c3+2:] + "</td></tr>\n"
|
||||
if l > 20:
|
||||
b += "<tr><td>-</td><td><font color=red>-- maximum number of warnings printed --</font></td></tr>\n"
|
||||
break
|
||||
b += "</table></td></tr>\n"
|
||||
return b
|
||||
|
||||
def test_status(test):
|
||||
t = ""
|
||||
for m in test.find("Results").findall("NamedMeasurement"):
|
||||
if m.get("name") == "Execution Time":
|
||||
t = " in " + m.find("Value").text + "s"
|
||||
break
|
||||
if test.get("Status") == "passed":
|
||||
s = "<font color=green>PASS</font>"
|
||||
elif test.get("Status") == "failed":
|
||||
s = "<font color=red>FAIL</font>"
|
||||
else:
|
||||
s = "<font color=cyan>" + test.get("Status") + "</font>"
|
||||
return s + t
|
||||
|
||||
if __name__ == "__main__":
|
||||
# Someone is launching this directly
|
||||
main()
|
||||
+44
-48
@@ -8,8 +8,8 @@ set( CTEST_MEMORYCHECK_COMMAND /usr/bin/valgrind )
|
||||
set( CTEST_INITIAL_CACHE "
|
||||
SITE:STRING=${CTEST_SITE}
|
||||
BUILDNAME:STRING=${CTEST_BUILD_NAME}
|
||||
ENABLE_TESTING:BOOL=ON
|
||||
CMAKE_BUILD_TYPE:STRING=Debug
|
||||
SCL_ENABLE_TESTING:BOOL=ON
|
||||
SCL_BUILD_TYPE:STRING=Debug
|
||||
")
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ endif()
|
||||
# use config variables such as these in
|
||||
# ../.SCL_CTEST_PREFS.cmake
|
||||
#
|
||||
#set( CTEST_SITE "your name here")
|
||||
#set( CTEST_SITE "username")
|
||||
#set( CTEST_BUILD_NAME "build type, os, arch")
|
||||
#
|
||||
#
|
||||
@@ -35,6 +35,8 @@ endif()
|
||||
# SKIP_CPP_TEST_SCHEMA_GEN
|
||||
# SKIP_CPP_TEST_SCHEMA_BUILD
|
||||
# SKIP_CPP_TEST_SCHEMA_RW
|
||||
# SKIP_TEST_UNITARY_SCHEMAS
|
||||
# SKIP_TEST_EXCHANGE_FILE
|
||||
#
|
||||
# setting this one disables result submission to my.cdash.org
|
||||
# SKIP_SUBMISSION
|
||||
@@ -48,44 +50,10 @@ function( SUBMIT_TEST part )
|
||||
endif()
|
||||
endfunction( SUBMIT_TEST part )
|
||||
|
||||
# find number of processors, for faster builds
|
||||
# from http://www.kitware.com/blog/home/post/63
|
||||
if(NOT DEFINED PROCESSOR_COUNT)
|
||||
# Unknown:
|
||||
set(PROCESSOR_COUNT 0)
|
||||
|
||||
# Linux:
|
||||
set(cpuinfo_file "/proc/cpuinfo")
|
||||
if(EXISTS "${cpuinfo_file}")
|
||||
file(STRINGS "${cpuinfo_file}" procs REGEX "^processor.: [0-9]+$")
|
||||
list(LENGTH procs PROCESSOR_COUNT)
|
||||
endif()
|
||||
|
||||
# Mac:
|
||||
if(APPLE)
|
||||
find_program(cmd_sys_pro "system_profiler")
|
||||
if(cmd_sys_pro)
|
||||
execute_process(COMMAND ${cmd_sys_pro} OUTPUT_VARIABLE info)
|
||||
string(REGEX REPLACE "^.*Total Number Of Cores: ([0-9]+).*$" "\\1"
|
||||
PROCESSOR_COUNT "${info}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Windows:
|
||||
if(WIN32)
|
||||
set(PROCESSOR_COUNT "$ENV{NUMBER_OF_PROCESSORS}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(CTEST_BUILD_FLAGS "-j${PROCESSOR_COUNT}")
|
||||
|
||||
|
||||
######################################################
|
||||
##### To disable reporting of a set of tests, comment
|
||||
##### out the SUBMIT_TEST line immediately following
|
||||
##### the set you wish to disable. If other tests
|
||||
##### depend on those tests, they will be executed
|
||||
##### but not reported.
|
||||
##### the set you wish to disable.
|
||||
#####
|
||||
##### To do this for all tests:
|
||||
##### set( SKIP_SUBMISSION TRUE )
|
||||
@@ -94,26 +62,54 @@ set(CTEST_BUILD_FLAGS "-j${PROCESSOR_COUNT}")
|
||||
ctest_start(Experimental)
|
||||
ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})
|
||||
|
||||
ctest_configure( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND OPTIONS -DENABLE_TESTING=ON )
|
||||
file(WRITE "${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake" "
|
||||
set( CTEST_CUSTOM_ERROR_EXCEPTION \"{standard input}:[0-9][0-9]*: WARNING: \")
|
||||
")
|
||||
|
||||
ctest_configure( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND OPTIONS -DSCL_ENABLE_TESTING=ON )
|
||||
SUBMIT_TEST( Configure )
|
||||
ctest_build( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND )
|
||||
SUBMIT_TEST( Build )
|
||||
# ctest_memcheck( BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res PARALLEL_LEVEL ${PROCESSOR_COUNT} )
|
||||
# ctest_memcheck( BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res )
|
||||
|
||||
if(NOT SKIP_TEST_UNITARY_SCHEMAS )
|
||||
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
|
||||
INCLUDE_LABEL "unitary_schemas" )
|
||||
SUBMIT_TEST( Test )
|
||||
endif()
|
||||
|
||||
if(NOT SKIP_CPP_TEST_SCHEMA_GEN )
|
||||
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
|
||||
PARALLEL_LEVEL ${PROCESSOR_COUNT} INCLUDE_LABEL "schema_gen" )
|
||||
INCLUDE_LABEL "cpp_schema_gen" )
|
||||
SUBMIT_TEST( Test )
|
||||
if(NOT SKIP_CPP_TEST_SCHEMA_BUILD )
|
||||
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
|
||||
INCLUDE_LABEL "cpp_schema_build" )
|
||||
SUBMIT_TEST( Test )
|
||||
if(NOT SKIP_CPP_TEST_SCHEMA_RW )
|
||||
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
|
||||
INCLUDE_LABEL "cpp_schema_rw" )
|
||||
SUBMIT_TEST( Test )
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
if(NOT SKIP_CPP_TEST_SCHEMA_BUILD_CPP )
|
||||
|
||||
if(NOT SKIP_TEST_EXCHANGE_FILE )
|
||||
if( SKIP_CPP_TEST_SCHEMA_BUILD )
|
||||
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
|
||||
INCLUDE "build_cpp_sdai_AP214E3_2010" )
|
||||
SUBMIT_TEST( Test )
|
||||
endif()
|
||||
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
|
||||
PARALLEL_LEVEL ${PROCESSOR_COUNT} INCLUDE_LABEL "schema_build" )
|
||||
SUBMIT_TEST( Test )
|
||||
endif()
|
||||
if(NOT SKIP_CPP_TEST_SCHEMA_RW )
|
||||
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
|
||||
PARALLEL_LEVEL ${PROCESSOR_COUNT} INCLUDE_LABEL "schema_rw" )
|
||||
INCLUDE_LABEL "exchange_file" )
|
||||
SUBMIT_TEST( Test )
|
||||
endif()
|
||||
|
||||
if(NOT SKIP_TEST_CPP_SCHEMA_SPECIFIC )
|
||||
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
|
||||
INCLUDE_LABEL "cpp_schema_specific" )
|
||||
SUBMIT_TEST( Test )
|
||||
endif()
|
||||
|
||||
|
||||
# ctest_coverage( )
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
|
||||
set(SCL_BASE_SOURCES
|
||||
scl_memmgr.cc
|
||||
scl_trace_fprintf.c
|
||||
)
|
||||
|
||||
include_directories(
|
||||
${SCL_SOURCE_DIR}/include
|
||||
)
|
||||
|
||||
if(MSVC OR BORLAND)
|
||||
add_definitions( -DSCL_BASE_DLL_EXPORTS )
|
||||
endif()
|
||||
|
||||
SCL_ADDLIB(base "${SCL_BASE_SOURCES}" "")
|
||||
@@ -0,0 +1,408 @@
|
||||
|
||||
#define SCL_MEMMGR_CC
|
||||
|
||||
#include <scl_cf.h>
|
||||
#include "scl_memmgr.h"
|
||||
|
||||
#if __APPLE__
|
||||
# include <malloc/malloc.h>
|
||||
#else
|
||||
# include <malloc.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
|
||||
#include <string>
|
||||
#include <set>
|
||||
|
||||
#ifdef SCL_MEMMGR_ENABLE_CHECKS
|
||||
|
||||
/**
|
||||
scl_memmgr_error definition
|
||||
*/
|
||||
class scl_memmgr_error {
|
||||
private:
|
||||
std::string _srcfile;
|
||||
unsigned int _srcline;
|
||||
unsigned int _occurences;
|
||||
public:
|
||||
scl_memmgr_error( const std::string &file, const unsigned int line );
|
||||
scl_memmgr_error( const scl_memmgr_error &rhs );
|
||||
~scl_memmgr_error( void );
|
||||
|
||||
bool operator<( const scl_memmgr_error &rhs ) const;
|
||||
|
||||
std::string getsrcfile( void ) const;
|
||||
unsigned int getsrcline( void ) const;
|
||||
unsigned int getoccurences( void ) const;
|
||||
};
|
||||
|
||||
typedef std::set<scl_memmgr_error> scl_memmgr_errors;
|
||||
typedef std::set<scl_memmgr_error>::iterator scl_memmgr_error_iterator;
|
||||
|
||||
/**
|
||||
scl_memmgr_record definition
|
||||
*/
|
||||
class scl_memmgr_record {
|
||||
private:
|
||||
void * _addr;
|
||||
size_t _size;
|
||||
std::string _srcfile;
|
||||
unsigned int _srcline;
|
||||
public:
|
||||
scl_memmgr_record( void * addr, size_t size, const char *file, const unsigned int line );
|
||||
scl_memmgr_record( void * addr );
|
||||
scl_memmgr_record( const scl_memmgr_record &rhs );
|
||||
~scl_memmgr_record( void );
|
||||
|
||||
bool operator<( const scl_memmgr_record &rhs ) const;
|
||||
|
||||
void * getaddr( void ) const;
|
||||
size_t getsize( void ) const;
|
||||
std::string getsrcfile( void ) const;
|
||||
unsigned int getsrcline( void ) const;
|
||||
};
|
||||
|
||||
typedef std::set<scl_memmgr_record> scl_memmgr_records;
|
||||
typedef std::set<scl_memmgr_record>::iterator scl_memmgr_record_iterator;
|
||||
|
||||
#endif /* SCL_MEMMGR_ENABLE_CHECKS */
|
||||
|
||||
/**
|
||||
scl_memmgr definition
|
||||
*/
|
||||
class scl_memmgr {
|
||||
private:
|
||||
#ifdef SCL_MEMMGR_ENABLE_CHECKS
|
||||
bool _record_insert_busy, _record_erase_busy;
|
||||
// memory allocation/reallocation records, inserted at allocation, erased at deallocation.
|
||||
scl_memmgr_records _records;
|
||||
// memory stats
|
||||
unsigned int _allocated; // amount of memory allocated simultaniously
|
||||
unsigned int _maximum_allocated; // maximum amount of memory allocated simultaniously
|
||||
unsigned int _allocated_total; // total amount of memory allocated in bytes
|
||||
unsigned int _reallocated_total; // total amount of memory reallocated in bytes
|
||||
unsigned int _deallocated_total; // total amount of memory deallocated in bytes
|
||||
#endif /* SCL_MEMMGR_ENABLE_CHECKS */
|
||||
protected:
|
||||
public:
|
||||
scl_memmgr(void);
|
||||
~scl_memmgr(void);
|
||||
|
||||
void * allocate( size_t size, const char *file, const int line );
|
||||
void * reallocate( void * addr, size_t size, const char *file, const int line );
|
||||
void deallocate( void * addr, const char *file, const int line );
|
||||
};
|
||||
|
||||
/**
|
||||
scl_memmgr instance.
|
||||
There should be one static instance of memmgr.
|
||||
This instance is automatically destroyed when application exits, so this allows us to add
|
||||
memory leak detection in it's destructor.
|
||||
*/
|
||||
scl_memmgr memmgr;
|
||||
|
||||
/**
|
||||
c memory functions implementation
|
||||
*/
|
||||
extern "C" {
|
||||
|
||||
void * scl_malloc_fn( unsigned int size, const char * file, const int line ) {
|
||||
return memmgr.allocate(size, file, line);
|
||||
}
|
||||
|
||||
void * scl_calloc_fn( unsigned int count, unsigned int size, const char * file, const int line ) {
|
||||
return memmgr.allocate(count * size, file, line);
|
||||
}
|
||||
|
||||
void * scl_realloc_fn( void * addr, unsigned int size, const char * file, const int line ) {
|
||||
return memmgr.reallocate(addr, size, file, line);
|
||||
}
|
||||
|
||||
void scl_free_fn( void * addr ) {
|
||||
memmgr.deallocate(addr, "", 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
c++ memory operators implementation
|
||||
*/
|
||||
void * scl_operator_new( size_t size, const char * file, const int line ) {
|
||||
return memmgr.allocate(size, file, line);
|
||||
}
|
||||
|
||||
void scl_operator_delete( void * addr, const char * file, const int line ) {
|
||||
memmgr.deallocate(addr, file, line);
|
||||
}
|
||||
|
||||
void scl_operator_delete( void * addr ) {
|
||||
memmgr.deallocate(addr, "", 0);
|
||||
}
|
||||
|
||||
/**
|
||||
scl_memmgr implementation
|
||||
*/
|
||||
scl_memmgr::scl_memmgr(void) {
|
||||
#ifdef SCL_MEMMGR_ENABLE_CHECKS
|
||||
_record_insert_busy = false;
|
||||
_record_erase_busy = false;
|
||||
|
||||
_allocated = 0;
|
||||
_maximum_allocated = 0;
|
||||
_allocated_total = 0;
|
||||
_reallocated_total = 0;
|
||||
_deallocated_total = 0;
|
||||
#endif /* SCL_MEMMGR_ENABLE_CHECKS */
|
||||
}
|
||||
|
||||
/**
|
||||
Destructor:
|
||||
scl_memmgr::~scl_memmgr(void)
|
||||
Description:
|
||||
The scl_memmgr destructor is used to check for memory leaks when enabled.
|
||||
All records still present when scl_memmgr instance is destroyed can be considered as
|
||||
memory leaks.
|
||||
*/
|
||||
scl_memmgr::~scl_memmgr(void) {
|
||||
#ifdef SCL_MEMMGR_ENABLE_CHECKS
|
||||
scl_memmgr_record_iterator irecord;
|
||||
scl_memmgr_errors errors;
|
||||
scl_memmgr_error_iterator ierror;
|
||||
|
||||
// Check if total allocated equals total deallocated
|
||||
if (_allocated_total != _deallocated_total) {
|
||||
// todo: generate warning for possible memory leaks, enable full memory leak checking
|
||||
printf("scl_memmgr warning: Possible memory leaks detected (%d of %d bytes)\n", _allocated_total - _deallocated_total, _allocated_total);
|
||||
}
|
||||
|
||||
// Compact leaks into an error list to prevent same leak being reported multiple times.
|
||||
_record_insert_busy = true;
|
||||
_record_erase_busy = true;
|
||||
for (irecord = _records.begin();
|
||||
irecord != _records.end();
|
||||
irecord ++) {
|
||||
scl_memmgr_error error(irecord->getsrcfile(), irecord->getsrcline());
|
||||
ierror = errors.find(error);
|
||||
if (ierror == errors.end())
|
||||
errors.insert(error);
|
||||
//else
|
||||
// ierror->occurences ++;
|
||||
}
|
||||
_record_insert_busy = false;
|
||||
_record_erase_busy = false;
|
||||
|
||||
// Loop through memory leaks to generate/buffer errors
|
||||
for (ierror = errors.begin();
|
||||
ierror != errors.end();
|
||||
ierror ++) {
|
||||
// todo: generate error for memory leak
|
||||
printf("scl_memmgr warning: Possible memory leak in %s line %d\n", ierror->getsrcfile().c_str(), ierror->getsrcline());
|
||||
}
|
||||
|
||||
// Clear remaining records
|
||||
_record_erase_busy = true;
|
||||
_records.clear();
|
||||
errors.clear();
|
||||
_record_erase_busy = false;
|
||||
#endif /* SCL_MEMMGR_ENABLE_CHECKS */
|
||||
}
|
||||
|
||||
void * scl_memmgr::allocate( size_t size, const char *file, const int line ) {
|
||||
void * addr;
|
||||
|
||||
// Allocate
|
||||
addr = malloc(size);
|
||||
if (addr == NULL) {
|
||||
// todo: error allocation failed
|
||||
printf("scl_memmgr error: Memory allocation failed in %s line %d\n", file, line);
|
||||
}
|
||||
|
||||
// Some stl implementations (for example debian gcc) use the new operator to construct
|
||||
// new elements when inserting scl_memmgr_record. When this our new operator gets used
|
||||
// for this operation, this would result in an infinite loop. This is fixed by the
|
||||
// _record_insert_busy flag.
|
||||
#ifdef SCL_MEMMGR_ENABLE_CHECKS
|
||||
if (!_record_insert_busy)
|
||||
{
|
||||
// Store record for this allocation
|
||||
_record_insert_busy = true;
|
||||
_records.insert(scl_memmgr_record(addr, size, file, line));
|
||||
_record_insert_busy = false;
|
||||
|
||||
// Update stats
|
||||
_allocated += size;
|
||||
if (_allocated > _maximum_allocated)
|
||||
_maximum_allocated = _allocated;
|
||||
_allocated_total += size;
|
||||
}
|
||||
#endif /* SCL_MEMMGR_ENABLE_CHECKS */
|
||||
|
||||
return addr;
|
||||
}
|
||||
|
||||
void * scl_memmgr::reallocate( void * addr, size_t size, const char *file, const int line ) {
|
||||
#ifdef SCL_MEMMGR_ENABLE_CHECKS
|
||||
scl_memmgr_record_iterator record;
|
||||
|
||||
if (!_record_insert_busy)
|
||||
{
|
||||
// Find record of previous allocation/reallocation
|
||||
record = _records.find(scl_memmgr_record(addr));
|
||||
if (record == _records.end()) {
|
||||
// todo: error reallocating memory not allocated?
|
||||
printf("scl_memmgr warning: Reallocation of not allocated memory at %s line %d\n", file, line);
|
||||
}
|
||||
else {
|
||||
// Update stats
|
||||
_allocated -= record->getsize();
|
||||
_deallocated_total += record->getsize();
|
||||
|
||||
// Erase previous allocation/reallocation
|
||||
_record_erase_busy = true;
|
||||
_records.erase(record);
|
||||
_record_erase_busy = false;
|
||||
}
|
||||
}
|
||||
#endif /* SCL_MEMMGR_ENABLE_CHECKS */
|
||||
|
||||
// Reallocate
|
||||
addr = realloc(addr, size);
|
||||
if (addr == NULL) {
|
||||
// todo: error reallocation failed
|
||||
printf("scl_memmgr error: Reallocation failed at %s line %d\n", file, line);
|
||||
}
|
||||
|
||||
#ifdef SCL_MEMMGR_ENABLE_CHECKS
|
||||
if (!_record_insert_busy)
|
||||
{
|
||||
// Store record for this reallocation
|
||||
_record_insert_busy = true;
|
||||
_records.insert(scl_memmgr_record(addr, size, file, line));
|
||||
_record_insert_busy = false;
|
||||
|
||||
// Update stats
|
||||
_allocated += size;
|
||||
if (_allocated > _maximum_allocated)
|
||||
_maximum_allocated = _allocated;
|
||||
_allocated_total += size;
|
||||
_reallocated_total += size;
|
||||
}
|
||||
#endif /* SCL_MEMMGR_ENABLE_CHECKS */
|
||||
|
||||
return addr;
|
||||
}
|
||||
|
||||
void scl_memmgr::deallocate( void * addr, const char *file, const int line ) {
|
||||
#ifdef SCL_MEMMGR_ENABLE_CHECKS
|
||||
scl_memmgr_record_iterator record;
|
||||
|
||||
if (!_record_erase_busy)
|
||||
{
|
||||
// Find record of previous allocation/reallocation
|
||||
record = _records.find(scl_memmgr_record(addr));
|
||||
if (record == _records.end()) {
|
||||
// todo: error free called for not allocated memory?
|
||||
printf("scl_memmgr warning: Deallocate of not allocated memory at %s line %d\n", file, line);
|
||||
}
|
||||
else {
|
||||
// Update stats
|
||||
_allocated -= record->getsize();
|
||||
_deallocated_total += record->getsize();
|
||||
|
||||
// Erase record
|
||||
_record_erase_busy = true;
|
||||
_records.erase(record);
|
||||
_record_erase_busy = false;
|
||||
}
|
||||
}
|
||||
#endif /* SCL_MEMMGR_ENABLE_CHECKS */
|
||||
|
||||
// Deallocate
|
||||
free(addr);
|
||||
}
|
||||
|
||||
#ifdef SCL_MEMMGR_ENABLE_CHECKS
|
||||
/**
|
||||
scl_memmgr_error implementation
|
||||
*/
|
||||
scl_memmgr_error::scl_memmgr_error( const std::string &file, const unsigned int line ) {
|
||||
_srcfile = file;
|
||||
_srcline = line;
|
||||
_occurences = 1;
|
||||
}
|
||||
|
||||
scl_memmgr_error::scl_memmgr_error( const scl_memmgr_error &rhs ) {
|
||||
_srcfile = rhs._srcfile;
|
||||
_srcline = rhs._srcline;
|
||||
_occurences = rhs._occurences;
|
||||
}
|
||||
|
||||
scl_memmgr_error::~scl_memmgr_error( void ) {
|
||||
}
|
||||
|
||||
bool scl_memmgr_error::operator<( const scl_memmgr_error &rhs ) const {
|
||||
if (_srcfile == rhs._srcfile)
|
||||
return _srcline < rhs._srcline;
|
||||
return _srcfile < rhs._srcfile;
|
||||
}
|
||||
|
||||
std::string scl_memmgr_error::getsrcfile( void ) const {
|
||||
return _srcfile;
|
||||
}
|
||||
|
||||
unsigned int scl_memmgr_error::getsrcline( void ) const {
|
||||
return _srcline;
|
||||
}
|
||||
|
||||
unsigned int scl_memmgr_error::getoccurences( void ) const {
|
||||
return _occurences;
|
||||
}
|
||||
|
||||
/**
|
||||
scl_memmgr_record implementation
|
||||
*/
|
||||
scl_memmgr_record::scl_memmgr_record( void * addr, size_t size, const char *file, const unsigned int line ) {
|
||||
_addr = addr;
|
||||
_size = size;
|
||||
_srcfile = file;
|
||||
_srcline = line;
|
||||
}
|
||||
|
||||
scl_memmgr_record::scl_memmgr_record( void * addr ) {
|
||||
_addr = addr;
|
||||
_size = 0;
|
||||
_srcfile = "";
|
||||
_srcline = -1;
|
||||
}
|
||||
|
||||
scl_memmgr_record::scl_memmgr_record( const scl_memmgr_record &rhs ) {
|
||||
_addr = rhs._addr;
|
||||
_size = rhs._size;
|
||||
_srcfile = rhs._srcfile;
|
||||
_srcline = rhs._srcline;
|
||||
}
|
||||
|
||||
scl_memmgr_record::~scl_memmgr_record( void ) {
|
||||
}
|
||||
|
||||
bool scl_memmgr_record::operator<( const scl_memmgr_record &rhs ) const {
|
||||
return _addr < rhs._addr;
|
||||
}
|
||||
|
||||
void * scl_memmgr_record::getaddr( void ) const {
|
||||
return _addr;
|
||||
}
|
||||
|
||||
size_t scl_memmgr_record::getsize( void ) const {
|
||||
return _size;
|
||||
}
|
||||
|
||||
std::string scl_memmgr_record::getsrcfile( void ) const {
|
||||
return _srcfile;
|
||||
}
|
||||
|
||||
unsigned int scl_memmgr_record::getsrcline( void ) const {
|
||||
return _srcline;
|
||||
}
|
||||
|
||||
#endif /* SCL_MEMMGR_ENABLE_CHECKS */
|
||||
@@ -0,0 +1,80 @@
|
||||
#ifndef SCL_MEMMGR_H
|
||||
#define SCL_MEMMGR_H
|
||||
|
||||
#include <scl_export.h>
|
||||
|
||||
/**
|
||||
Platform specific defines
|
||||
*/
|
||||
#if defined(__MSVC__) || defined(__BORLAND__)
|
||||
#define THROW_STD_BAD_ALLOC
|
||||
#define THROW_EMPTY
|
||||
#else
|
||||
#define THROW_STD_BAD_ALLOC throw (std::bad_alloc)
|
||||
#define THROW_EMPTY throw ()
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include <cstddef>
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
SCL_BASE_EXPORT void * scl_malloc_fn( unsigned int size, const char *file, const int line );
|
||||
SCL_BASE_EXPORT void * scl_calloc_fn( unsigned int count, unsigned int size, const char *file, const int line );
|
||||
SCL_BASE_EXPORT void * scl_realloc_fn( void * addr, unsigned int size, const char *file, const int line );
|
||||
SCL_BASE_EXPORT void scl_free_fn( void * addr );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
SCL_BASE_EXPORT void * scl_operator_new( size_t size, const char * file, const int line );
|
||||
SCL_BASE_EXPORT void scl_operator_delete( void * addr, const char *file, const int line );
|
||||
SCL_BASE_EXPORT void scl_operator_delete( void * addr );
|
||||
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#ifndef SCL_MEMMGR_CC
|
||||
|
||||
#define scl_malloc(size) scl_malloc_fn(size, __FILE__, __LINE__)
|
||||
#define scl_calloc(count, size) scl_calloc_fn(count, size, __FILE__, __LINE__)
|
||||
#define scl_realloc(addr, size) scl_realloc_fn(addr, size, __FILE__, __LINE__)
|
||||
#define scl_free(addr) scl_free_fn(addr)
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include <new>
|
||||
|
||||
inline void * operator new( size_t size, const char *file, const int line ) THROW_STD_BAD_ALLOC {
|
||||
return scl_operator_new(size, file, line);
|
||||
}
|
||||
|
||||
inline void * operator new[]( size_t size, const char *file, const int line ) THROW_STD_BAD_ALLOC {
|
||||
return scl_operator_new(size, file, line);
|
||||
}
|
||||
|
||||
inline void operator delete( void *addr, const char *file, const int line ) THROW_STD_BAD_ALLOC {
|
||||
scl_operator_delete(addr, file, line);
|
||||
}
|
||||
|
||||
inline void operator delete[]( void *addr, const char *file, const int line ) THROW_STD_BAD_ALLOC {
|
||||
scl_operator_delete(addr, file, line);
|
||||
}
|
||||
|
||||
inline void operator delete( void * addr ) THROW_EMPTY {
|
||||
scl_operator_delete(addr);
|
||||
}
|
||||
|
||||
inline void operator delete[]( void * addr ) THROW_EMPTY {
|
||||
scl_operator_delete(addr);
|
||||
}
|
||||
|
||||
#define new new(__FILE__, __LINE__)
|
||||
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* SCL_MEMMGR_CC */
|
||||
|
||||
#endif /* SCL_MEMMGR_H */
|
||||
@@ -0,0 +1,16 @@
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "scl_trace_fprintf.h"
|
||||
|
||||
void trace_fprintf (char const *sourcefile, int line, FILE* file, const char *format, ...) {
|
||||
va_list args;
|
||||
if( (file != stdout) && (file != stderr ) ) {
|
||||
fprintf(file, "/* source: %s:%d */", sourcefile, line);
|
||||
}
|
||||
va_start (args, format);
|
||||
vfprintf(file, format, args);
|
||||
va_end (args);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
#ifndef SCL_TRACE_FPRINTF_H
|
||||
#define SCL_TRACE_FPRINTF_H
|
||||
|
||||
/** \file scl_trace_fprintf.h
|
||||
* Used to track the source file and line where generated code is printed from
|
||||
* When enabled, comments are printed into the generated files for every 'fprintf':
|
||||
* / * source: scl/src/fedex_plus/selects.c:1375 * /
|
||||
* To enable, configure with 'cmake .. -DSCL_TRACE_FPRINTF=ON'
|
||||
*
|
||||
* This header must be included *after* all other headers, otherwise the compiler will
|
||||
* report errors in system headers.
|
||||
* \sa trace_fprintf
|
||||
**/
|
||||
|
||||
#include "scl_export.h"
|
||||
|
||||
/** used to find where generated c++ originates from in fedex_plus
|
||||
* To enable, configure with 'cmake .. -DSCL_TRACE_FPRINTF=ON'
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
SCL_BASE_EXPORT void trace_fprintf (char const *sourcefile, int line, FILE* file, const char *format, ...);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef SCL_TRACE_FPRINTF
|
||||
# define fprintf(...) trace_fprintf(__FILE__, __LINE__, __VA_ARGS__)
|
||||
#endif /* SCL_TRACE_FPRINTF */
|
||||
|
||||
#endif /* SCL_TRACE_FPRINTF_H */
|
||||
@@ -16,11 +16,6 @@ extern ofstream * logStream;
|
||||
|
||||
static int debug_access_hooks = 0;
|
||||
|
||||
#ifdef PART26
|
||||
|
||||
const char * sclHostName = CORBA::Orbix.myHost(); // Default is local host
|
||||
#endif
|
||||
|
||||
Schema * s_example_schema = 0;
|
||||
|
||||
/* ************** TYPES */
|
||||
@@ -126,15 +121,6 @@ SdaiPoly_line::SdaiPoly_line( SdaiPoly_line & e ) {
|
||||
}
|
||||
SdaiPoly_line::~SdaiPoly_line() { }
|
||||
|
||||
|
||||
#ifdef __O3DB__
|
||||
void
|
||||
SdaiPoly_line::oodb_reInit() {
|
||||
eDesc = example_schemae_poly_line;
|
||||
attributes [0].aDesc = a_0points;
|
||||
}
|
||||
#endif
|
||||
|
||||
SdaiPoly_line::SdaiPoly_line( SCLP23( Application_instance ) *se, int * addAttrs ) {
|
||||
/* Set this to point to the head entity. */
|
||||
HeadEntity( se );
|
||||
@@ -199,17 +185,6 @@ SdaiShape::SdaiShape( SdaiShape & e ) {
|
||||
}
|
||||
SdaiShape::~SdaiShape() { }
|
||||
|
||||
|
||||
#ifdef __O3DB__
|
||||
void
|
||||
SdaiShape::oodb_reInit() {
|
||||
eDesc = example_schemae_shape;
|
||||
attributes [0].aDesc = a_1item_name;
|
||||
attributes [1].aDesc = a_2item_color;
|
||||
attributes [2].aDesc = a_3number_of_sides;
|
||||
}
|
||||
#endif
|
||||
|
||||
SdaiShape::SdaiShape( SCLP23( Application_instance ) *se, int * addAttrs ) {
|
||||
/* Set this to point to the head entity. */
|
||||
HeadEntity( se );
|
||||
@@ -363,15 +338,6 @@ create_SdaiRectangle( os_database * db ) {
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __O3DB__
|
||||
void
|
||||
SdaiRectangle::oodb_reInit() {
|
||||
eDesc = example_schemae_rectangle;
|
||||
attributes [3].aDesc = a_4height;
|
||||
attributes [4].aDesc = a_5width;
|
||||
}
|
||||
#endif
|
||||
|
||||
SdaiRectangle::SdaiRectangle( SCLP23( Application_instance ) *se, int * addAttrs ) : SdaiShape( se, ( addAttrs ? &addAttrs[1] : 0 ) ) {
|
||||
/* Set this to point to the head entity. */
|
||||
HeadEntity( se );
|
||||
@@ -450,13 +416,6 @@ SdaiSquare::SdaiSquare( SdaiSquare & e ) {
|
||||
}
|
||||
SdaiSquare::~SdaiSquare() { }
|
||||
|
||||
#ifdef __O3DB__
|
||||
void
|
||||
SdaiSquare::oodb_reInit() {
|
||||
eDesc = example_schemae_square;
|
||||
}
|
||||
#endif
|
||||
|
||||
SdaiSquare::SdaiSquare( SCLP23( Application_instance ) *se, int * addAttrs ) : SdaiRectangle( se, ( addAttrs ? &addAttrs[1] : 0 ) ) {
|
||||
/* Set this to point to the head entity. */
|
||||
HeadEntity( se );
|
||||
@@ -504,16 +463,6 @@ SdaiTriangle::SdaiTriangle( SdaiTriangle & e ) {
|
||||
}
|
||||
SdaiTriangle::~SdaiTriangle() { }
|
||||
|
||||
#ifdef __O3DB__
|
||||
void
|
||||
SdaiTriangle::oodb_reInit() {
|
||||
eDesc = example_schemae_triangle;
|
||||
attributes [3].aDesc = a_6side1_length;
|
||||
attributes [4].aDesc = a_7side2_length;
|
||||
attributes [5].aDesc = a_8side3_length;
|
||||
}
|
||||
#endif
|
||||
|
||||
SdaiTriangle::SdaiTriangle( SCLP23( Application_instance ) *se, int * addAttrs ) : SdaiShape( se, ( addAttrs ? &addAttrs[1] : 0 ) ) {
|
||||
/* Set this to point to the head entity. */
|
||||
HeadEntity( se );
|
||||
@@ -620,14 +569,6 @@ SdaiCircle::SdaiCircle( SdaiCircle & e ) {
|
||||
}
|
||||
SdaiCircle::~SdaiCircle() { }
|
||||
|
||||
#ifdef __O3DB__
|
||||
void
|
||||
SdaiCircle::oodb_reInit() {
|
||||
eDesc = example_schemae_circle;
|
||||
attributes [3].aDesc = a_9radius;
|
||||
}
|
||||
#endif
|
||||
|
||||
SdaiCircle::SdaiCircle( SCLP23( Application_instance ) *se, int * addAttrs ) : SdaiShape( se, ( addAttrs ? &addAttrs[1] : 0 ) ) {
|
||||
/* Set this to point to the head entity. */
|
||||
HeadEntity( se );
|
||||
@@ -691,16 +632,6 @@ SdaiLine::SdaiLine( SdaiLine & e ) {
|
||||
}
|
||||
SdaiLine::~SdaiLine() { }
|
||||
|
||||
|
||||
#ifdef __O3DB__
|
||||
void
|
||||
SdaiLine::oodb_reInit() {
|
||||
eDesc = example_schemae_line;
|
||||
attributes [0].aDesc = a_10end_point_one;
|
||||
attributes [1].aDesc = a_11end_point_two;
|
||||
}
|
||||
#endif
|
||||
|
||||
SdaiLine::SdaiLine( SCLP23( Application_instance ) *se, int * addAttrs ) {
|
||||
/* Set this to point to the head entity. */
|
||||
HeadEntity( se );
|
||||
@@ -788,16 +719,6 @@ SdaiCartesian_point::SdaiCartesian_point( SdaiCartesian_point & e ) {
|
||||
}
|
||||
SdaiCartesian_point::~SdaiCartesian_point() { }
|
||||
|
||||
#ifdef __O3DB__
|
||||
void
|
||||
SdaiCartesian_point::oodb_reInit() {
|
||||
eDesc = example_schemae_cartesian_point;
|
||||
attributes [0].aDesc = a_12x;
|
||||
attributes [1].aDesc = a_13y;
|
||||
attributes [2].aDesc = a_14z;
|
||||
}
|
||||
#endif
|
||||
|
||||
SdaiCartesian_point::SdaiCartesian_point( SCLP23( Application_instance ) *se, int * addAttrs ) {
|
||||
/* Set this to point to the head entity. */
|
||||
HeadEntity( se );
|
||||
|
||||
@@ -5,450 +5,407 @@
|
||||
// regenerate it.
|
||||
/* $Id$ */
|
||||
|
||||
#ifdef __O3DB__
|
||||
#include <OpenOODB.h>
|
||||
#endif
|
||||
|
||||
#ifndef SCHEMA_H
|
||||
#include <schema.h>
|
||||
#endif
|
||||
|
||||
#ifdef PART26
|
||||
#include <corbaIncludes.h>
|
||||
// Create a corbaSchema.h file in this directory with a #include in
|
||||
// it for your IDL generated schema-specific .hh file.
|
||||
#include <corbaSchema.h>
|
||||
#endif
|
||||
|
||||
/* ************** TYPES */
|
||||
/* ************** TYPES */
|
||||
|
||||
////////// ENUMERATION TYPE color
|
||||
enum Color {
|
||||
Color__red,
|
||||
Color__green,
|
||||
Color__blue,
|
||||
Color__yellow,
|
||||
Color__orange,
|
||||
Color__white,
|
||||
Color__black,
|
||||
Color__brown,
|
||||
Color_unset
|
||||
Color__red,
|
||||
Color__green,
|
||||
Color__blue,
|
||||
Color__yellow,
|
||||
Color__orange,
|
||||
Color__white,
|
||||
Color__black,
|
||||
Color__brown,
|
||||
Color_unset
|
||||
};
|
||||
|
||||
class SdaiColor_var : public SCLP23(Enum) {
|
||||
class SdaiColor_var : public SCLP23( Enum ) {
|
||||
|
||||
protected:
|
||||
EnumTypeDescriptor *type;
|
||||
protected:
|
||||
EnumTypeDescriptor * type;
|
||||
|
||||
public:
|
||||
SdaiColor_var (const char * n =0, EnumTypeDescriptor *et =example_schemat_color);
|
||||
SdaiColor_var (Color e, EnumTypeDescriptor *et =example_schemat_color)
|
||||
: type(et) { set_value (e); }
|
||||
~SdaiColor_var () { }
|
||||
SdaiColor_var& operator= (const SdaiColor_var& e)
|
||||
{ set_value (e); return *this; }
|
||||
operator Color () const;
|
||||
public:
|
||||
SdaiColor_var( const char * n = 0, EnumTypeDescriptor * et = example_schemat_color );
|
||||
SdaiColor_var( Color e, EnumTypeDescriptor * et = example_schemat_color )
|
||||
: type( et ) {
|
||||
set_value( e );
|
||||
}
|
||||
~SdaiColor_var() { }
|
||||
SdaiColor_var & operator= ( const SdaiColor_var & e ) {
|
||||
set_value( e );
|
||||
return *this;
|
||||
}
|
||||
operator Color() const;
|
||||
|
||||
inline virtual const char * Name () const
|
||||
{ return type->Name(); }
|
||||
inline virtual int no_elements () const { return 8; }
|
||||
virtual const char * element_at (int n) const;
|
||||
inline virtual const char * Name() const {
|
||||
return type->Name();
|
||||
}
|
||||
inline virtual int no_elements() const {
|
||||
return 8;
|
||||
}
|
||||
virtual const char * element_at( int n ) const;
|
||||
|
||||
};
|
||||
|
||||
typedef SdaiColor_var * SdaiColor_var_ptr;
|
||||
|
||||
SCLP23(Enum) * create_SdaiColor_var ();
|
||||
SCLP23( Enum ) * create_SdaiColor_var();
|
||||
|
||||
class SdaiColor_vars : public EnumAggregate {
|
||||
|
||||
protected:
|
||||
EnumTypeDescriptor *enum_type;
|
||||
protected:
|
||||
EnumTypeDescriptor * enum_type;
|
||||
|
||||
public:
|
||||
SdaiColor_vars( EnumTypeDescriptor * =example_schemat_color);
|
||||
virtual ~SdaiColor_vars();
|
||||
virtual SingleLinkNode * NewNode()
|
||||
{ return new EnumNode (new SdaiColor_var( "", enum_type )); }
|
||||
public:
|
||||
SdaiColor_vars( EnumTypeDescriptor * = example_schemat_color );
|
||||
virtual ~SdaiColor_vars();
|
||||
virtual SingleLinkNode * NewNode() {
|
||||
return new EnumNode( new SdaiColor_var( "", enum_type ) );
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
typedef SdaiColor_vars * SdaiColor_vars_ptr;
|
||||
|
||||
STEPaggregate * create_SdaiColor_vars ();
|
||||
STEPaggregate * create_SdaiColor_vars();
|
||||
|
||||
////////// END ENUMERATION color
|
||||
|
||||
|
||||
// ***** Build the SELECT Types
|
||||
// ***** Build the SELECT Types
|
||||
|
||||
/* ************** ENTITIES */
|
||||
/* ************** ENTITIES */
|
||||
|
||||
// ***** Print Entity Classes
|
||||
// ***** Print Entity Classes
|
||||
|
||||
///////// ENTITY poly_line
|
||||
///////// ENTITY poly_line
|
||||
|
||||
extern AttrDescriptor *a_0points;
|
||||
extern AttrDescriptor * a_0points;
|
||||
|
||||
class SdaiPoly_line : public SCLP23(Application_instance) {
|
||||
class SdaiPoly_line : public SCLP23( Application_instance ) {
|
||||
|
||||
protected:
|
||||
EntityAggregate _points ; // of line
|
||||
protected:
|
||||
EntityAggregate _points ; // of line
|
||||
|
||||
public:
|
||||
public:
|
||||
|
||||
SdaiPoly_line ( );
|
||||
SdaiPoly_line (SCLP23(Application_instance) *se, int *addAttrs = 0);
|
||||
SdaiPoly_line (SdaiPoly_line& e );
|
||||
~SdaiPoly_line ();
|
||||
SdaiPoly_line( );
|
||||
SdaiPoly_line( SCLP23( Application_instance ) *se, int * addAttrs = 0 );
|
||||
SdaiPoly_line( SdaiPoly_line & e );
|
||||
~SdaiPoly_line();
|
||||
|
||||
#ifdef __O3DB__
|
||||
void oodb_reInit();
|
||||
#endif
|
||||
|
||||
int opcode () { return 0 ; }
|
||||
const EntityAggregate_ptr points_() const;
|
||||
void points_ (const EntityAggregate_ptr x);
|
||||
int opcode() {
|
||||
return 0 ;
|
||||
}
|
||||
const EntityAggregate_ptr points_() const;
|
||||
void points_( const EntityAggregate_ptr x );
|
||||
|
||||
|
||||
};
|
||||
|
||||
#ifdef __O3DB__
|
||||
inline SCLP23(Application_instance_ptr)
|
||||
create_SdaiPoly_line () { return (SCLP23(Application_instance_ptr)) new SdaiPoly_line ; }
|
||||
#else
|
||||
inline SdaiPoly_line *
|
||||
create_SdaiPoly_line () { return new SdaiPoly_line ; }
|
||||
#endif
|
||||
create_SdaiPoly_line() {
|
||||
return new SdaiPoly_line ;
|
||||
}
|
||||
|
||||
///////// END_ENTITY poly_line
|
||||
///////// END_ENTITY poly_line
|
||||
|
||||
|
||||
///////// ENTITY shape
|
||||
///////// ENTITY shape
|
||||
|
||||
extern AttrDescriptor *a_1item_name;
|
||||
extern AttrDescriptor *a_2item_color;
|
||||
extern AttrDescriptor *a_3number_of_sides;
|
||||
extern AttrDescriptor * a_1item_name;
|
||||
extern AttrDescriptor * a_2item_color;
|
||||
extern AttrDescriptor * a_3number_of_sides;
|
||||
|
||||
class SdaiShape : public SCLP23(Application_instance) {
|
||||
class SdaiShape : public SCLP23( Application_instance ) {
|
||||
|
||||
protected:
|
||||
SCLP23(String) _item_name ;
|
||||
SdaiColor_var _item_color ; // OPTIONAL
|
||||
SCLP23(Integer) _number_of_sides ;
|
||||
public:
|
||||
protected:
|
||||
SCLP23( String ) _item_name ;
|
||||
SdaiColor_var _item_color ; // OPTIONAL
|
||||
SCLP23( Integer ) _number_of_sides ;
|
||||
public:
|
||||
|
||||
SdaiShape ( );
|
||||
SdaiShape (SCLP23(Application_instance) *se, int *addAttrs = 0);
|
||||
SdaiShape (SdaiShape& e );
|
||||
~SdaiShape ();
|
||||
SdaiShape( );
|
||||
SdaiShape( SCLP23( Application_instance ) *se, int * addAttrs = 0 );
|
||||
SdaiShape( SdaiShape & e );
|
||||
~SdaiShape();
|
||||
|
||||
#ifdef __O3DB__
|
||||
void oodb_reInit();
|
||||
#endif
|
||||
int opcode() {
|
||||
return 1 ;
|
||||
}
|
||||
const SdaiLabel item_name_() const;
|
||||
void item_name_( const SdaiLabel x );
|
||||
|
||||
int opcode () { return 1 ; }
|
||||
const SdaiLabel item_name_() const;
|
||||
void item_name_ (const SdaiLabel x);
|
||||
const SdaiColor_var item_color_() const;
|
||||
void item_color_( const SdaiColor_var x );
|
||||
|
||||
const SdaiColor_var item_color_() const;
|
||||
void item_color_ (const SdaiColor_var x);
|
||||
|
||||
const SCLP23(Integer) number_of_sides_() const;
|
||||
void number_of_sides_ (const SCLP23(Integer) x);
|
||||
const SCLP23( Integer ) number_of_sides_() const;
|
||||
void number_of_sides_( const SCLP23( Integer ) x );
|
||||
|
||||
|
||||
};
|
||||
|
||||
#ifdef __O3DB__
|
||||
inline SCLP23(Application_instance_ptr)
|
||||
create_SdaiShape () { return (SCLP23(Application_instance_ptr)) new SdaiShape ; }
|
||||
#else
|
||||
inline SdaiShape *
|
||||
create_SdaiShape () { return new SdaiShape ; }
|
||||
#endif
|
||||
create_SdaiShape() {
|
||||
return new SdaiShape ;
|
||||
}
|
||||
|
||||
///////// END_ENTITY shape
|
||||
///////// END_ENTITY shape
|
||||
|
||||
|
||||
///////// ENTITY rectangle
|
||||
///////// ENTITY rectangle
|
||||
|
||||
extern AttrDescriptor *a_4height;
|
||||
extern AttrDescriptor *a_5width;
|
||||
extern AttrDescriptor * a_4height;
|
||||
extern AttrDescriptor * a_5width;
|
||||
|
||||
class SdaiRectangle : public SdaiShape {
|
||||
|
||||
protected:
|
||||
SCLP23(Real) _height ;
|
||||
SCLP23(Real) _width ;
|
||||
public:
|
||||
|
||||
SdaiRectangle ( );
|
||||
SdaiRectangle (SCLP23(Application_instance) *se, int *addAttrs = 0);
|
||||
SdaiRectangle (SdaiRectangle& e );
|
||||
~SdaiRectangle ();
|
||||
protected:
|
||||
SCLP23( Real ) _height ;
|
||||
SCLP23( Real ) _width ;
|
||||
public:
|
||||
|
||||
#ifdef __O3DB__
|
||||
void oodb_reInit();
|
||||
#endif
|
||||
SdaiRectangle( );
|
||||
SdaiRectangle( SCLP23( Application_instance ) *se, int * addAttrs = 0 );
|
||||
SdaiRectangle( SdaiRectangle & e );
|
||||
~SdaiRectangle();
|
||||
|
||||
int opcode () { return 2 ; }
|
||||
const SdaiLength_measure height_() const;
|
||||
void height_ (const SdaiLength_measure x);
|
||||
int opcode() {
|
||||
return 2 ;
|
||||
}
|
||||
const SdaiLength_measure height_() const;
|
||||
void height_( const SdaiLength_measure x );
|
||||
|
||||
const SdaiLength_measure width_() const;
|
||||
void width_ (const SdaiLength_measure x);
|
||||
const SdaiLength_measure width_() const;
|
||||
void width_( const SdaiLength_measure x );
|
||||
|
||||
/* The first parent's access functions are */
|
||||
/* above or covered by inherited functions. */
|
||||
/* The first parent's access functions are */
|
||||
/* above or covered by inherited functions. */
|
||||
|
||||
};
|
||||
|
||||
#ifdef __O3DB__
|
||||
inline SCLP23(Application_instance_ptr)
|
||||
create_SdaiRectangle () { return (SCLP23(Application_instance_ptr)) new SdaiRectangle ; }
|
||||
#else
|
||||
inline SdaiRectangle *
|
||||
create_SdaiRectangle () { return new SdaiRectangle ; }
|
||||
#endif
|
||||
create_SdaiRectangle() {
|
||||
return new SdaiRectangle ;
|
||||
}
|
||||
|
||||
///////// END_ENTITY rectangle
|
||||
///////// END_ENTITY rectangle
|
||||
|
||||
|
||||
///////// ENTITY square
|
||||
///////// ENTITY square
|
||||
|
||||
|
||||
class SdaiSquare : public SdaiRectangle {
|
||||
|
||||
protected:
|
||||
public:
|
||||
|
||||
SdaiSquare ( );
|
||||
SdaiSquare (SCLP23(Application_instance) *se, int *addAttrs = 0);
|
||||
SdaiSquare (SdaiSquare& e );
|
||||
~SdaiSquare ();
|
||||
protected:
|
||||
public:
|
||||
|
||||
#ifdef __O3DB__
|
||||
void oodb_reInit();
|
||||
#endif
|
||||
SdaiSquare( );
|
||||
SdaiSquare( SCLP23( Application_instance ) *se, int * addAttrs = 0 );
|
||||
SdaiSquare( SdaiSquare & e );
|
||||
~SdaiSquare();
|
||||
|
||||
int opcode () { return 3 ; }
|
||||
/* The first parent's access functions are */
|
||||
/* above or covered by inherited functions. */
|
||||
int opcode() {
|
||||
return 3 ;
|
||||
}
|
||||
/* The first parent's access functions are */
|
||||
/* above or covered by inherited functions. */
|
||||
|
||||
};
|
||||
|
||||
#ifdef __O3DB__
|
||||
inline SCLP23(Application_instance_ptr)
|
||||
create_SdaiSquare () { return (SCLP23(Application_instance_ptr)) new SdaiSquare ; }
|
||||
#else
|
||||
inline SdaiSquare *
|
||||
create_SdaiSquare () { return new SdaiSquare ; }
|
||||
#endif
|
||||
create_SdaiSquare() {
|
||||
return new SdaiSquare ;
|
||||
}
|
||||
|
||||
///////// END_ENTITY square
|
||||
///////// END_ENTITY square
|
||||
|
||||
|
||||
///////// ENTITY triangle
|
||||
///////// ENTITY triangle
|
||||
|
||||
extern AttrDescriptor *a_6side1_length;
|
||||
extern AttrDescriptor *a_7side2_length;
|
||||
extern AttrDescriptor *a_8side3_length;
|
||||
extern AttrDescriptor * a_6side1_length;
|
||||
extern AttrDescriptor * a_7side2_length;
|
||||
extern AttrDescriptor * a_8side3_length;
|
||||
|
||||
class SdaiTriangle : public SdaiShape {
|
||||
|
||||
protected:
|
||||
SCLP23(Real) _side1_length ;
|
||||
SCLP23(Real) _side2_length ;
|
||||
SCLP23(Real) _side3_length ;
|
||||
public:
|
||||
|
||||
SdaiTriangle ( );
|
||||
SdaiTriangle (SCLP23(Application_instance) *se, int *addAttrs = 0);
|
||||
SdaiTriangle (SdaiTriangle& e );
|
||||
~SdaiTriangle ();
|
||||
protected:
|
||||
SCLP23( Real ) _side1_length ;
|
||||
SCLP23( Real ) _side2_length ;
|
||||
SCLP23( Real ) _side3_length ;
|
||||
public:
|
||||
|
||||
#ifdef __O3DB__
|
||||
void oodb_reInit();
|
||||
#endif
|
||||
SdaiTriangle( );
|
||||
SdaiTriangle( SCLP23( Application_instance ) *se, int * addAttrs = 0 );
|
||||
SdaiTriangle( SdaiTriangle & e );
|
||||
~SdaiTriangle();
|
||||
|
||||
int opcode () { return 4 ; }
|
||||
const SdaiLength_measure side1_length_() const;
|
||||
void side1_length_ (const SdaiLength_measure x);
|
||||
int opcode() {
|
||||
return 4 ;
|
||||
}
|
||||
const SdaiLength_measure side1_length_() const;
|
||||
void side1_length_( const SdaiLength_measure x );
|
||||
|
||||
const SdaiLength_measure side2_length_() const;
|
||||
void side2_length_ (const SdaiLength_measure x);
|
||||
const SdaiLength_measure side2_length_() const;
|
||||
void side2_length_( const SdaiLength_measure x );
|
||||
|
||||
const SdaiLength_measure side3_length_() const;
|
||||
void side3_length_ (const SdaiLength_measure x);
|
||||
const SdaiLength_measure side3_length_() const;
|
||||
void side3_length_( const SdaiLength_measure x );
|
||||
|
||||
/* The first parent's access functions are */
|
||||
/* above or covered by inherited functions. */
|
||||
/* The first parent's access functions are */
|
||||
/* above or covered by inherited functions. */
|
||||
|
||||
};
|
||||
|
||||
#ifdef __O3DB__
|
||||
inline SCLP23(Application_instance_ptr)
|
||||
create_SdaiTriangle () { return (SCLP23(Application_instance_ptr)) new SdaiTriangle ; }
|
||||
#else
|
||||
inline SdaiTriangle *
|
||||
create_SdaiTriangle () { return new SdaiTriangle ; }
|
||||
#endif
|
||||
create_SdaiTriangle() {
|
||||
return new SdaiTriangle ;
|
||||
}
|
||||
|
||||
///////// END_ENTITY triangle
|
||||
///////// END_ENTITY triangle
|
||||
|
||||
|
||||
///////// ENTITY circle
|
||||
///////// ENTITY circle
|
||||
|
||||
extern AttrDescriptor *a_9radius;
|
||||
extern AttrDescriptor * a_9radius;
|
||||
|
||||
class SdaiCircle : public SdaiShape {
|
||||
|
||||
protected:
|
||||
SCLP23(Real) _radius ;
|
||||
public:
|
||||
|
||||
SdaiCircle ( );
|
||||
SdaiCircle (SCLP23(Application_instance) *se, int *addAttrs = 0);
|
||||
SdaiCircle (SdaiCircle& e );
|
||||
~SdaiCircle ();
|
||||
protected:
|
||||
SCLP23( Real ) _radius ;
|
||||
public:
|
||||
|
||||
#ifdef __O3DB__
|
||||
void oodb_reInit();
|
||||
#endif
|
||||
SdaiCircle( );
|
||||
SdaiCircle( SCLP23( Application_instance ) *se, int * addAttrs = 0 );
|
||||
SdaiCircle( SdaiCircle & e );
|
||||
~SdaiCircle();
|
||||
|
||||
int opcode () { return 5 ; }
|
||||
const SCLP23(Real) radius_() const;
|
||||
void radius_ (const SCLP23(Real) x);
|
||||
int opcode() {
|
||||
return 5 ;
|
||||
}
|
||||
const SCLP23( Real ) radius_() const;
|
||||
void radius_( const SCLP23( Real ) x );
|
||||
|
||||
/* The first parent's access functions are */
|
||||
/* above or covered by inherited functions. */
|
||||
/* The first parent's access functions are */
|
||||
/* above or covered by inherited functions. */
|
||||
|
||||
};
|
||||
|
||||
#ifdef __O3DB__
|
||||
inline SCLP23(Application_instance_ptr)
|
||||
create_SdaiCircle () { return (SCLP23(Application_instance_ptr)) new SdaiCircle ; }
|
||||
#else
|
||||
inline SdaiCircle *
|
||||
create_SdaiCircle () { return new SdaiCircle ; }
|
||||
#endif
|
||||
create_SdaiCircle() {
|
||||
return new SdaiCircle ;
|
||||
}
|
||||
|
||||
///////// END_ENTITY circle
|
||||
///////// END_ENTITY circle
|
||||
|
||||
|
||||
///////// ENTITY line
|
||||
///////// ENTITY line
|
||||
|
||||
extern AttrDescriptor *a_10end_point_one;
|
||||
extern AttrDescriptor *a_11end_point_two;
|
||||
extern AttrDescriptor * a_10end_point_one;
|
||||
extern AttrDescriptor * a_11end_point_two;
|
||||
|
||||
class SdaiLine : public SCLP23(Application_instance) {
|
||||
class SdaiLine : public SCLP23( Application_instance ) {
|
||||
|
||||
protected:
|
||||
SCLP23(Application_instance_ptr) _end_point_one ;
|
||||
SCLP23(Application_instance_ptr) _end_point_two ;
|
||||
public:
|
||||
protected:
|
||||
SCLP23( Application_instance_ptr ) _end_point_one ;
|
||||
SCLP23( Application_instance_ptr ) _end_point_two ;
|
||||
public:
|
||||
|
||||
SdaiLine ( );
|
||||
SdaiLine (SCLP23(Application_instance) *se, int *addAttrs = 0);
|
||||
SdaiLine (SdaiLine& e );
|
||||
~SdaiLine ();
|
||||
SdaiLine( );
|
||||
SdaiLine( SCLP23( Application_instance ) *se, int * addAttrs = 0 );
|
||||
SdaiLine( SdaiLine & e );
|
||||
~SdaiLine();
|
||||
|
||||
#ifdef __O3DB__
|
||||
void oodb_reInit();
|
||||
#endif
|
||||
int opcode() {
|
||||
return 6 ;
|
||||
}
|
||||
const SdaiCartesian_point_ptr end_point_one_() const;
|
||||
void end_point_one_( const SdaiCartesian_point_ptr x );
|
||||
|
||||
int opcode () { return 6 ; }
|
||||
const SdaiCartesian_point_ptr end_point_one_() const;
|
||||
void end_point_one_ (const SdaiCartesian_point_ptr x);
|
||||
|
||||
const SdaiCartesian_point_ptr end_point_two_() const;
|
||||
void end_point_two_ (const SdaiCartesian_point_ptr x);
|
||||
const SdaiCartesian_point_ptr end_point_two_() const;
|
||||
void end_point_two_( const SdaiCartesian_point_ptr x );
|
||||
|
||||
|
||||
};
|
||||
|
||||
#ifdef __O3DB__
|
||||
inline SCLP23(Application_instance_ptr)
|
||||
create_SdaiLine () { return (SCLP23(Application_instance_ptr)) new SdaiLine ; }
|
||||
#else
|
||||
inline SdaiLine *
|
||||
create_SdaiLine () { return new SdaiLine ; }
|
||||
#endif
|
||||
create_SdaiLine() {
|
||||
return new SdaiLine ;
|
||||
}
|
||||
|
||||
///////// END_ENTITY line
|
||||
///////// END_ENTITY line
|
||||
|
||||
|
||||
///////// ENTITY cartesian_point
|
||||
///////// ENTITY cartesian_point
|
||||
|
||||
extern AttrDescriptor *a_12x;
|
||||
extern AttrDescriptor *a_13y;
|
||||
extern AttrDescriptor *a_14z;
|
||||
extern AttrDescriptor * a_12x;
|
||||
extern AttrDescriptor * a_13y;
|
||||
extern AttrDescriptor * a_14z;
|
||||
|
||||
class SdaiCartesian_point : public SCLP23(Application_instance) {
|
||||
class SdaiCartesian_point : public SCLP23( Application_instance ) {
|
||||
|
||||
protected:
|
||||
SCLP23(Real) _x ;
|
||||
SCLP23(Real) _y ;
|
||||
SCLP23(Real) _z ; // OPTIONAL
|
||||
public:
|
||||
protected:
|
||||
SCLP23( Real ) _x ;
|
||||
SCLP23( Real ) _y ;
|
||||
SCLP23( Real ) _z ; // OPTIONAL
|
||||
public:
|
||||
|
||||
SdaiCartesian_point ( );
|
||||
SdaiCartesian_point (SCLP23(Application_instance) *se, int *addAttrs = 0);
|
||||
SdaiCartesian_point (SdaiCartesian_point& e );
|
||||
~SdaiCartesian_point ();
|
||||
SdaiCartesian_point( );
|
||||
SdaiCartesian_point( SCLP23( Application_instance ) *se, int * addAttrs = 0 );
|
||||
SdaiCartesian_point( SdaiCartesian_point & e );
|
||||
~SdaiCartesian_point();
|
||||
|
||||
#ifdef __O3DB__
|
||||
void oodb_reInit();
|
||||
#endif
|
||||
int opcode() {
|
||||
return 7 ;
|
||||
}
|
||||
const SdaiPoint x_() const;
|
||||
void x_( const SdaiPoint x );
|
||||
|
||||
int opcode () { return 7 ; }
|
||||
const SdaiPoint x_() const;
|
||||
void x_ (const SdaiPoint x);
|
||||
const SdaiPoint y_() const;
|
||||
void y_( const SdaiPoint x );
|
||||
|
||||
const SdaiPoint y_() const;
|
||||
void y_ (const SdaiPoint x);
|
||||
|
||||
const SdaiPoint z_() const;
|
||||
void z_ (const SdaiPoint x);
|
||||
const SdaiPoint z_() const;
|
||||
void z_( const SdaiPoint x );
|
||||
|
||||
|
||||
};
|
||||
|
||||
#ifdef __O3DB__
|
||||
inline SCLP23(Application_instance_ptr)
|
||||
create_SdaiCartesian_point () { return (SCLP23(Application_instance_ptr)) new SdaiCartesian_point ; }
|
||||
#else
|
||||
inline SdaiCartesian_point *
|
||||
create_SdaiCartesian_point () { return new SdaiCartesian_point ; }
|
||||
#endif
|
||||
create_SdaiCartesian_point() {
|
||||
return new SdaiCartesian_point ;
|
||||
}
|
||||
|
||||
///////// END_ENTITY cartesian_point
|
||||
///////// END_ENTITY cartesian_point
|
||||
|
||||
|
||||
// ***** generate Model related pieces
|
||||
// ***** generate Model related pieces
|
||||
|
||||
class SdaiModel_contents_example_schema : public SCLP23(Model_contents) {
|
||||
class SdaiModel_contents_example_schema : public SCLP23( Model_contents ) {
|
||||
|
||||
public:
|
||||
public:
|
||||
|
||||
SdaiModel_contents_example_schema();
|
||||
SdaiModel_contents_example_schema();
|
||||
|
||||
SdaiPoly_line__set_var SdaiPoly_line_get_extents();
|
||||
SdaiPoly_line__set_var SdaiPoly_line_get_extents();
|
||||
|
||||
SdaiShape__set_var SdaiShape_get_extents();
|
||||
SdaiShape__set_var SdaiShape_get_extents();
|
||||
|
||||
SdaiRectangle__set_var SdaiRectangle_get_extents();
|
||||
SdaiRectangle__set_var SdaiRectangle_get_extents();
|
||||
|
||||
SdaiSquare__set_var SdaiSquare_get_extents();
|
||||
SdaiSquare__set_var SdaiSquare_get_extents();
|
||||
|
||||
SdaiTriangle__set_var SdaiTriangle_get_extents();
|
||||
SdaiTriangle__set_var SdaiTriangle_get_extents();
|
||||
|
||||
SdaiCircle__set_var SdaiCircle_get_extents();
|
||||
SdaiCircle__set_var SdaiCircle_get_extents();
|
||||
|
||||
SdaiLine__set_var SdaiLine_get_extents();
|
||||
SdaiLine__set_var SdaiLine_get_extents();
|
||||
|
||||
SdaiCartesian_point__set_var SdaiCartesian_point_get_extents();
|
||||
SdaiCartesian_point__set_var SdaiCartesian_point_get_extents();
|
||||
|
||||
};
|
||||
|
||||
@@ -456,6 +413,6 @@ class SdaiModel_contents_example_schema : public SCLP23(Model_contents) {
|
||||
typedef SdaiModel_contents_example_schema * SdaiModel_contents_example_schema_ptr;
|
||||
typedef SdaiModel_contents_example_schema_ptr SdaiModel_contents_example_schema_var;
|
||||
|
||||
SCLP23(Model_contents_ptr) create_SdaiModel_contents_example_schema();
|
||||
SCLP23( Model_contents_ptr ) create_SdaiModel_contents_example_schema();
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,85 +3,85 @@
|
||||
// This file was generated by fedex_plus. You probably don't want to edit
|
||||
// it since your modifications will be lost if fedex_plus is used to
|
||||
// regenerate it.
|
||||
/* $Id$ */
|
||||
/* $Id$ */
|
||||
#include <schema.h>
|
||||
|
||||
// Schema: SdaiEXAMPLE_SCHEMA
|
||||
extern Schema * s_example_schema;
|
||||
extern Schema * s_example_schema;
|
||||
|
||||
// Types:
|
||||
class SdaiColor_vars;
|
||||
extern EnumTypeDescriptor *example_schemat_color;
|
||||
typedef SCLP23(String) SdaiLabel;
|
||||
extern TypeDescriptor *example_schemat_label;
|
||||
typedef SCLP23(Real) SdaiPoint;
|
||||
extern TypeDescriptor *example_schemat_point;
|
||||
typedef SCLP23(Real) SdaiLength_measure;
|
||||
extern TypeDescriptor *example_schemat_length_measure;
|
||||
extern EnumTypeDescriptor * example_schemat_color;
|
||||
typedef SCLP23( String ) SdaiLabel;
|
||||
extern TypeDescriptor * example_schemat_label;
|
||||
typedef SCLP23( Real ) SdaiPoint;
|
||||
extern TypeDescriptor * example_schemat_point;
|
||||
typedef SCLP23( Real ) SdaiLength_measure;
|
||||
extern TypeDescriptor * example_schemat_length_measure;
|
||||
|
||||
// Entities:
|
||||
class SdaiPoly_line;
|
||||
typedef SdaiPoly_line * SdaiPoly_lineH;
|
||||
typedef SdaiPoly_line * SdaiPoly_line_ptr;
|
||||
typedef SdaiPoly_line_ptr SdaiPoly_line_var;
|
||||
#define SdaiPoly_line__set SCLP23(DAObject__set)
|
||||
#define SdaiPoly_line__set_var SCLP23(DAObject__set_var)
|
||||
extern EntityDescriptor *example_schemae_poly_line;
|
||||
typedef SdaiPoly_line * SdaiPoly_lineH;
|
||||
typedef SdaiPoly_line * SdaiPoly_line_ptr;
|
||||
typedef SdaiPoly_line_ptr SdaiPoly_line_var;
|
||||
#define SdaiPoly_line__set SCLP23(DAObject__set)
|
||||
#define SdaiPoly_line__set_var SCLP23(DAObject__set_var)
|
||||
extern EntityDescriptor * example_schemae_poly_line;
|
||||
|
||||
class SdaiShape;
|
||||
typedef SdaiShape * SdaiShapeH;
|
||||
typedef SdaiShape * SdaiShape_ptr;
|
||||
typedef SdaiShape_ptr SdaiShape_var;
|
||||
#define SdaiShape__set SCLP23(DAObject__set)
|
||||
#define SdaiShape__set_var SCLP23(DAObject__set_var)
|
||||
extern EntityDescriptor *example_schemae_shape;
|
||||
typedef SdaiShape * SdaiShapeH;
|
||||
typedef SdaiShape * SdaiShape_ptr;
|
||||
typedef SdaiShape_ptr SdaiShape_var;
|
||||
#define SdaiShape__set SCLP23(DAObject__set)
|
||||
#define SdaiShape__set_var SCLP23(DAObject__set_var)
|
||||
extern EntityDescriptor * example_schemae_shape;
|
||||
|
||||
class SdaiRectangle;
|
||||
typedef SdaiRectangle * SdaiRectangleH;
|
||||
typedef SdaiRectangle * SdaiRectangle_ptr;
|
||||
typedef SdaiRectangle_ptr SdaiRectangle_var;
|
||||
#define SdaiRectangle__set SCLP23(DAObject__set)
|
||||
#define SdaiRectangle__set_var SCLP23(DAObject__set_var)
|
||||
extern EntityDescriptor *example_schemae_rectangle;
|
||||
typedef SdaiRectangle * SdaiRectangleH;
|
||||
typedef SdaiRectangle * SdaiRectangle_ptr;
|
||||
typedef SdaiRectangle_ptr SdaiRectangle_var;
|
||||
#define SdaiRectangle__set SCLP23(DAObject__set)
|
||||
#define SdaiRectangle__set_var SCLP23(DAObject__set_var)
|
||||
extern EntityDescriptor * example_schemae_rectangle;
|
||||
|
||||
class SdaiSquare;
|
||||
typedef SdaiSquare * SdaiSquareH;
|
||||
typedef SdaiSquare * SdaiSquare_ptr;
|
||||
typedef SdaiSquare_ptr SdaiSquare_var;
|
||||
#define SdaiSquare__set SCLP23(DAObject__set)
|
||||
#define SdaiSquare__set_var SCLP23(DAObject__set_var)
|
||||
extern EntityDescriptor *example_schemae_square;
|
||||
typedef SdaiSquare * SdaiSquareH;
|
||||
typedef SdaiSquare * SdaiSquare_ptr;
|
||||
typedef SdaiSquare_ptr SdaiSquare_var;
|
||||
#define SdaiSquare__set SCLP23(DAObject__set)
|
||||
#define SdaiSquare__set_var SCLP23(DAObject__set_var)
|
||||
extern EntityDescriptor * example_schemae_square;
|
||||
|
||||
class SdaiTriangle;
|
||||
typedef SdaiTriangle * SdaiTriangleH;
|
||||
typedef SdaiTriangle * SdaiTriangle_ptr;
|
||||
typedef SdaiTriangle_ptr SdaiTriangle_var;
|
||||
#define SdaiTriangle__set SCLP23(DAObject__set)
|
||||
#define SdaiTriangle__set_var SCLP23(DAObject__set_var)
|
||||
extern EntityDescriptor *example_schemae_triangle;
|
||||
typedef SdaiTriangle * SdaiTriangleH;
|
||||
typedef SdaiTriangle * SdaiTriangle_ptr;
|
||||
typedef SdaiTriangle_ptr SdaiTriangle_var;
|
||||
#define SdaiTriangle__set SCLP23(DAObject__set)
|
||||
#define SdaiTriangle__set_var SCLP23(DAObject__set_var)
|
||||
extern EntityDescriptor * example_schemae_triangle;
|
||||
|
||||
class SdaiCircle;
|
||||
typedef SdaiCircle * SdaiCircleH;
|
||||
typedef SdaiCircle * SdaiCircle_ptr;
|
||||
typedef SdaiCircle_ptr SdaiCircle_var;
|
||||
#define SdaiCircle__set SCLP23(DAObject__set)
|
||||
#define SdaiCircle__set_var SCLP23(DAObject__set_var)
|
||||
extern EntityDescriptor *example_schemae_circle;
|
||||
typedef SdaiCircle * SdaiCircleH;
|
||||
typedef SdaiCircle * SdaiCircle_ptr;
|
||||
typedef SdaiCircle_ptr SdaiCircle_var;
|
||||
#define SdaiCircle__set SCLP23(DAObject__set)
|
||||
#define SdaiCircle__set_var SCLP23(DAObject__set_var)
|
||||
extern EntityDescriptor * example_schemae_circle;
|
||||
|
||||
class SdaiLine;
|
||||
typedef SdaiLine * SdaiLineH;
|
||||
typedef SdaiLine * SdaiLine_ptr;
|
||||
typedef SdaiLine_ptr SdaiLine_var;
|
||||
#define SdaiLine__set SCLP23(DAObject__set)
|
||||
#define SdaiLine__set_var SCLP23(DAObject__set_var)
|
||||
extern EntityDescriptor *example_schemae_line;
|
||||
typedef SdaiLine * SdaiLineH;
|
||||
typedef SdaiLine * SdaiLine_ptr;
|
||||
typedef SdaiLine_ptr SdaiLine_var;
|
||||
#define SdaiLine__set SCLP23(DAObject__set)
|
||||
#define SdaiLine__set_var SCLP23(DAObject__set_var)
|
||||
extern EntityDescriptor * example_schemae_line;
|
||||
|
||||
class SdaiCartesian_point;
|
||||
typedef SdaiCartesian_point * SdaiCartesian_pointH;
|
||||
typedef SdaiCartesian_point * SdaiCartesian_point_ptr;
|
||||
typedef SdaiCartesian_point_ptr SdaiCartesian_point_var;
|
||||
#define SdaiCartesian_point__set SCLP23(DAObject__set)
|
||||
#define SdaiCartesian_point__set_var SCLP23(DAObject__set_var)
|
||||
extern EntityDescriptor *example_schemae_cartesian_point;
|
||||
typedef SdaiCartesian_point * SdaiCartesian_pointH;
|
||||
typedef SdaiCartesian_point * SdaiCartesian_point_ptr;
|
||||
typedef SdaiCartesian_point_ptr SdaiCartesian_point_var;
|
||||
#define SdaiCartesian_point__set SCLP23(DAObject__set)
|
||||
#define SdaiCartesian_point__set_var SCLP23(DAObject__set_var)
|
||||
extern EntityDescriptor * example_schemae_cartesian_point;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -8,10 +8,6 @@
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#ifdef __O3DB__
|
||||
#include <OpenOODB.h>
|
||||
#endif
|
||||
|
||||
#include <sdai.h>
|
||||
|
||||
|
||||
@@ -26,13 +22,13 @@
|
||||
#include <STEPattribute.h>
|
||||
|
||||
#include <Sdaiclasses.h>
|
||||
extern void SchemaInit (Registry &);
|
||||
extern void InitSchemasAndEnts (Registry &);
|
||||
#include <SdaiEXAMPLE_SCHEMA.h>
|
||||
extern void SdaiEXAMPLE_SCHEMAInit (Registry & r);
|
||||
extern void SchemaInit( Registry & );
|
||||
extern void InitSchemasAndEnts( Registry & );
|
||||
#include <SdaiEXAMPLE_SCHEMA.h>
|
||||
extern void SdaiEXAMPLE_SCHEMAInit( Registry & r );
|
||||
|
||||
#include <complexSupport.h>
|
||||
ComplexCollect *gencomplex();
|
||||
ComplexCollect * gencomplex();
|
||||
|
||||
SCLP23(Model_contents_ptr) GetModelContents(char *schemaName);
|
||||
SCLP23( Model_contents_ptr ) GetModelContents( char * schemaName );
|
||||
#endif
|
||||
|
||||
@@ -8,6 +8,9 @@ set(LIBSTEPDAI_SRCS
|
||||
sdaiEntity_extent_set.cc
|
||||
sdaiModel_contents.cc
|
||||
sdaiModel_contents_list.cc
|
||||
sdaiEnum.cc
|
||||
sdaiString.cc
|
||||
sdaiBinary.cc
|
||||
)
|
||||
|
||||
SET(LIBSTEPDAI_PRIVATE_HDRS
|
||||
@@ -20,16 +23,16 @@ SET(LIBSTEPDAI_PRIVATE_HDRS
|
||||
sdaiObject.h
|
||||
sdaiSession_instance.h
|
||||
StrUtil.hh
|
||||
sdaiEnum.h
|
||||
sdaiString.h
|
||||
sdaiBinary.h
|
||||
)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${SCL_SOURCE_DIR}/src/base
|
||||
${SCL_SOURCE_DIR}/src/clstepcore
|
||||
${SCL_SOURCE_DIR}/src/clutils
|
||||
)
|
||||
|
||||
add_definitions(
|
||||
-DHAVE_CONFIG_H
|
||||
)
|
||||
|
||||
SCL_ADDLIB(stepdai "${LIBSTEPDAI_SRCS}" "steputils stepcore")
|
||||
SCL_ADDLIB(stepdai "${LIBSTEPDAI_SRCS}" "steputils base")
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
#include <memory.h>
|
||||
#include <math.h>
|
||||
#include "scl_memmgr.h"
|
||||
|
||||
// to help ObjectCenter
|
||||
#ifndef HAVE_MEMMOVE
|
||||
@@ -40,36 +41,36 @@ extern "C"
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
SCLP23( Application_instance__set )::SCLP23_NAME( Application_instance__set )( int defaultSize ) {
|
||||
SDAI_Application_instance__set::SDAI_Application_instance__set( int defaultSize ) {
|
||||
_bufsize = defaultSize;
|
||||
_buf = new SCLP23( Application_instance_ptr )[_bufsize];
|
||||
_buf = new SDAI_Application_instance_ptr[_bufsize];
|
||||
_count = 0;
|
||||
}
|
||||
|
||||
SCLP23( Application_instance__set )::~SCLP23_NAME( Application_instance__set )() {
|
||||
SDAI_Application_instance__set::~SDAI_Application_instance__set() {
|
||||
delete _buf;
|
||||
}
|
||||
|
||||
void SCLP23( Application_instance__set )::Check( int index ) {
|
||||
SCLP23( Application_instance_ptr )* newbuf;
|
||||
void SDAI_Application_instance__set::Check( int index ) {
|
||||
SDAI_Application_instance_ptr * newbuf;
|
||||
|
||||
if( index >= _bufsize ) {
|
||||
_bufsize = ( index + 1 ) * 2;
|
||||
newbuf = new SCLP23( Application_instance_ptr )[_bufsize];
|
||||
memmove( newbuf, _buf, _count * sizeof( SCLP23( Application_instance_ptr ) ) );
|
||||
newbuf = new SDAI_Application_instance_ptr[_bufsize];
|
||||
memmove( newbuf, _buf, _count * sizeof( SDAI_Application_instance_ptr ) );
|
||||
delete _buf;
|
||||
_buf = newbuf;
|
||||
}
|
||||
}
|
||||
|
||||
void SCLP23( Application_instance__set )::Insert( SCLP23( Application_instance_ptr ) v, int index ) {
|
||||
SCLP23( Application_instance_ptr )* spot;
|
||||
void SDAI_Application_instance__set::Insert( SDAI_Application_instance_ptr v, int index ) {
|
||||
SDAI_Application_instance_ptr * spot;
|
||||
index = ( index < 0 ) ? _count : index;
|
||||
|
||||
if( index < _count ) {
|
||||
Check( _count + 1 );
|
||||
spot = &_buf[index];
|
||||
memmove( spot + 1, spot, ( _count - index )*sizeof( SCLP23( Application_instance_ptr ) ) );
|
||||
memmove( spot + 1, spot, ( _count - index )*sizeof( SDAI_Application_instance_ptr ) );
|
||||
|
||||
} else {
|
||||
Check( index );
|
||||
@@ -79,14 +80,14 @@ void SCLP23( Application_instance__set )::Insert( SCLP23( Application_instance_p
|
||||
++_count;
|
||||
}
|
||||
|
||||
void SCLP23( Application_instance__set )::Append( SCLP23( Application_instance_ptr ) v ) {
|
||||
void SDAI_Application_instance__set::Append( SDAI_Application_instance_ptr v ) {
|
||||
int index = _count;
|
||||
SCLP23( Application_instance_ptr )* spot;
|
||||
SDAI_Application_instance_ptr * spot;
|
||||
|
||||
if( index < _count ) {
|
||||
Check( _count + 1 );
|
||||
spot = &_buf[index];
|
||||
memmove( spot + 1, spot, ( _count - index )*sizeof( SCLP23( Application_instance_ptr ) ) );
|
||||
memmove( spot + 1, spot, ( _count - index )*sizeof( SDAI_Application_instance_ptr ) );
|
||||
|
||||
} else {
|
||||
Check( index );
|
||||
@@ -96,22 +97,22 @@ void SCLP23( Application_instance__set )::Append( SCLP23( Application_instance_p
|
||||
++_count;
|
||||
}
|
||||
|
||||
void SCLP23( Application_instance__set )::Remove( int index ) {
|
||||
void SDAI_Application_instance__set::Remove( int index ) {
|
||||
if( 0 <= index && index < _count ) {
|
||||
--_count;
|
||||
SCLP23( Application_instance_ptr )* spot = &_buf[index];
|
||||
memmove( spot, spot + 1, ( _count - index )*sizeof( SCLP23( Application_instance_ptr ) ) );
|
||||
SDAI_Application_instance_ptr * spot = &_buf[index];
|
||||
memmove( spot, spot + 1, ( _count - index )*sizeof( SDAI_Application_instance_ptr ) );
|
||||
}
|
||||
}
|
||||
|
||||
void SCLP23( Application_instance__set )::Remove( SCLP23( Application_instance_ptr ) a ) {
|
||||
void SDAI_Application_instance__set::Remove( SDAI_Application_instance_ptr a ) {
|
||||
int index = Index( a );
|
||||
if( !( index < 0 ) ) {
|
||||
Remove( index );
|
||||
}
|
||||
}
|
||||
|
||||
int SCLP23( Application_instance__set )::Index( SCLP23( Application_instance_ptr ) v ) {
|
||||
int SDAI_Application_instance__set::Index( SDAI_Application_instance_ptr v ) {
|
||||
for( int i = 0; i < _count; ++i ) {
|
||||
if( _buf[i] == v ) {
|
||||
return i;
|
||||
@@ -120,7 +121,7 @@ int SCLP23( Application_instance__set )::Index( SCLP23( Application_instance_ptr
|
||||
return -1;
|
||||
}
|
||||
|
||||
SCLP23( Application_instance_ptr ) & SCLP23( Application_instance__set )::operator[]( int index ) {
|
||||
SDAI_Application_instance_ptr & SDAI_Application_instance__set::operator[]( int index ) {
|
||||
Check( index );
|
||||
// _count = max(_count, index+1);
|
||||
_count = ( ( _count > index + 1 ) ? _count : ( index + 1 ) );
|
||||
@@ -128,11 +129,11 @@ SCLP23( Application_instance_ptr ) & SCLP23( Application_instance__set )::operat
|
||||
}
|
||||
|
||||
int
|
||||
SCLP23( Application_instance__set )::Count() {
|
||||
SDAI_Application_instance__set::Count() {
|
||||
return _count;
|
||||
}
|
||||
|
||||
void
|
||||
SCLP23( Application_instance__set )::Clear() {
|
||||
SDAI_Application_instance__set::Clear() {
|
||||
_count = 0;
|
||||
}
|
||||
|
||||
@@ -30,35 +30,35 @@
|
||||
#ifndef SDAI_APPLICATION_INSTANCE_SET_h
|
||||
#define SDAI_APPLICATION_INSTANCE_SET_h
|
||||
|
||||
#include <scl_export.h>
|
||||
//#include <STEPentity.h>
|
||||
|
||||
class SCLP23_NAME(Application_instance__set);
|
||||
typedef SCLP23_NAME(Application_instance__set) *
|
||||
SCLP23_NAME(Application_instance__set_ptr);
|
||||
typedef SCLP23_NAME(Application_instance__set_ptr)
|
||||
SCLP23_NAME(Application_instance__set_var);
|
||||
class SDAI_Application_instance__set;
|
||||
typedef SDAI_Application_instance__set *
|
||||
SDAI_Application_instance__set_ptr;
|
||||
typedef SDAI_Application_instance__set_ptr
|
||||
SDAI_Application_instance__set_var;
|
||||
|
||||
class SCLP23_NAME(Application_instance__set)
|
||||
{
|
||||
public:
|
||||
SCLP23_NAME(Application_instance__set)(int = 16);
|
||||
~SCLP23_NAME(Application_instance__set)();
|
||||
class SCL_DAI_EXPORT SDAI_Application_instance__set {
|
||||
public:
|
||||
SDAI_Application_instance__set( int = 16 );
|
||||
~SDAI_Application_instance__set();
|
||||
|
||||
SCLP23_NAME(Application_instance_ptr)& operator[](int index);
|
||||
void Insert(SCLP23_NAME(Application_instance_ptr), int index);
|
||||
void Append(SCLP23_NAME(Application_instance_ptr));
|
||||
void Remove(int index);
|
||||
void Remove(SCLP23_NAME(Application_instance_ptr));
|
||||
int Index(SCLP23_NAME(Application_instance_ptr));
|
||||
SDAI_Application_instance_ptr & operator[]( int index );
|
||||
void Insert( SDAI_Application_instance_ptr, int index );
|
||||
void Append( SDAI_Application_instance_ptr );
|
||||
void Remove( int index );
|
||||
void Remove( SDAI_Application_instance_ptr );
|
||||
int Index( SDAI_Application_instance_ptr );
|
||||
|
||||
int Count();
|
||||
void Clear();
|
||||
private:
|
||||
void Check(int index);
|
||||
private:
|
||||
SCLP23_NAME(Application_instance_ptr)* _buf;
|
||||
int _bufsize;
|
||||
int _count;
|
||||
int Count();
|
||||
void Clear();
|
||||
private:
|
||||
void Check( int index );
|
||||
private:
|
||||
SDAI_Application_instance_ptr * _buf;
|
||||
int _bufsize;
|
||||
int _count;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user