Compare commits
207
Commits
v0.8
...
pretty_printers
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4a76e58f2c | ||
|
|
d042c5a6dc | ||
|
|
33a903b9ef | ||
|
|
066d4d7809 | ||
|
|
8a82142e1b | ||
|
|
20d72fb6d5 | ||
|
|
ab9bd3ae8d | ||
|
|
81a0362c30 | ||
|
|
84472921c1 | ||
|
|
1d01b831aa | ||
|
|
0d2e791e82 | ||
|
|
d39fbaf4d7 | ||
|
|
e422262877 | ||
|
|
71fe947ff5 | ||
|
|
beb2a595f1 | ||
|
|
0b6cd90dd9 | ||
|
|
3fd71cf457 | ||
|
|
0fbc3c0c84 | ||
|
|
a96336ab97 | ||
|
|
b24680d7e5 | ||
|
|
15afe96d67 | ||
|
|
a78ca01b54 | ||
|
|
8627627c5e | ||
|
|
9b091756b1 | ||
|
|
dfce2dcf07 | ||
|
|
5c7e63c75b | ||
|
|
0b456a833e | ||
|
|
a243b4d8c8 | ||
|
|
daec3e2640 | ||
|
|
06b13bb9af | ||
|
|
e38519a7f1 | ||
|
|
12def15dd2 | ||
|
|
a160cc9af6 | ||
|
|
1dfe76b3b4 | ||
|
|
c23ba65c41 | ||
|
|
274de2a91d | ||
|
|
1a757024c4 | ||
|
|
abae0a7c45 | ||
|
|
bfc11face5 | ||
|
|
677261d4fb | ||
|
|
4207a46f07 | ||
|
|
7316fe5070 | ||
|
|
4d32009592 | ||
|
|
0b6078b72b | ||
|
|
36e34862cc | ||
|
|
9dcb6aa640 | ||
|
|
bc5533bda8 | ||
|
|
4e88ad69eb | ||
|
|
b890c156f5 | ||
|
|
0ba7343004 | ||
|
|
f2247d222f | ||
|
|
5288026043 | ||
|
|
6e8cad223e | ||
|
|
018e7cfffc | ||
|
|
458b775f41 | ||
|
|
dc82923cf1 | ||
|
|
aa967b3316 | ||
|
|
17b41da525 | ||
|
|
135adc76c8 | ||
|
|
017faa942f | ||
|
|
46c37207da | ||
|
|
85f45f38e4 | ||
|
|
be378119f4 | ||
|
|
ecde882d5a | ||
|
|
3d90ffdf83 | ||
|
|
5dfca2ed78 | ||
|
|
fbf0272d3b | ||
|
|
c69f9ebab2 | ||
|
|
942fb89f68 | ||
|
|
893936b11f | ||
|
|
e4a8be26da | ||
|
|
c63b3cc9b8 | ||
|
|
2dace5da2e | ||
|
|
7568033499 | ||
|
|
65b6869b30 | ||
|
|
915e0de65f | ||
|
|
9c83ba32a9 | ||
|
|
13f36c11a8 | ||
|
|
6b26410d9d | ||
|
|
3e84677ac9 | ||
|
|
081cf35855 | ||
|
|
c1c3bc1077 | ||
|
|
6351ff38d9 | ||
|
|
a82f7497a6 | ||
|
|
2a3e2a9abf | ||
|
|
eaf9ffc3f3 | ||
|
|
b72f4d404a | ||
|
|
b31d8ef853 | ||
|
|
c865023114 | ||
|
|
25ca2a788d | ||
|
|
a80489dc96 | ||
|
|
35170b388e | ||
|
|
d2680940ad | ||
|
|
e24ac2acd3 | ||
|
|
903277f288 | ||
|
|
5b2782a34c | ||
|
|
97731f8611 | ||
|
|
272928d6e5 | ||
|
|
76944b3a90 | ||
|
|
8a270222c6 | ||
|
|
e8afb772f1 | ||
|
|
0eefd769e3 | ||
|
|
1c8225f79a | ||
|
|
2d8a7373fd | ||
|
|
2300021416 | ||
|
|
91a2dcacf3 | ||
|
|
618deae50e | ||
|
|
1aa78e7e48 | ||
|
|
4129d363b0 | ||
|
|
619c927ecb | ||
|
|
89684015ae | ||
|
|
8423811031 | ||
|
|
4f9ad1c75a | ||
|
|
0c34752882 | ||
|
|
0b3ab924f8 | ||
|
|
fae60fbe8c | ||
|
|
703654ae70 | ||
|
|
9fca25bed6 | ||
|
|
988d2614be | ||
|
|
1a8282d5dc | ||
|
|
235d38a80c | ||
|
|
cba6fec8d7 | ||
|
|
1d2e33e575 | ||
|
|
2829deb7cc | ||
|
|
c83f0792a1 | ||
|
|
482c7905f3 | ||
|
|
46b5e74596 | ||
|
|
ec0443a446 | ||
|
|
6708334b37 | ||
|
|
9025643a1b | ||
|
|
b996d835f5 | ||
|
|
48df74932a | ||
|
|
3b0f0b33ea | ||
|
|
167d1d7fab | ||
|
|
abb43fcb6f | ||
|
|
a2f2f41e66 | ||
|
|
e68afbad49 | ||
|
|
33ff7c57dc | ||
|
|
04a57d0f2a | ||
|
|
062b0e6ae3 | ||
|
|
5c6ffc7dca | ||
|
|
ea80885185 | ||
|
|
8964d2ed05 | ||
|
|
f25fb9d968 | ||
|
|
0336649b07 | ||
|
|
bdcd5166e1 | ||
|
|
dbbd0c63b6 | ||
|
|
cb771f628e | ||
|
|
2a17763354 | ||
|
|
7f19877b1a | ||
|
|
164355c640 | ||
|
|
2c7ed5c826 | ||
|
|
264db5d03c | ||
|
|
423d5e08f6 | ||
|
|
ba6d0a1c0c | ||
|
|
37cfaebb1f | ||
|
|
f233ae0059 | ||
|
|
7950f4db7e | ||
|
|
ec5171fe27 | ||
|
|
c962b1d391 | ||
|
|
dc32b24f3f | ||
|
|
57a3d9ca1a | ||
|
|
ef4d64a98e | ||
|
|
b3047b4b1f | ||
|
|
4bac203373 | ||
|
|
ad2e50b05d | ||
|
|
3e8c468f67 | ||
|
|
0ccca0afc2 | ||
|
|
7cbc9f84ce | ||
|
|
e266db9b3f | ||
|
|
77000dd445 | ||
|
|
1d784c8a90 | ||
|
|
5b68726a3c | ||
|
|
d7b3129834 | ||
|
|
6e3e58df00 | ||
|
|
80eabe9e80 | ||
|
|
5afcabf901 | ||
|
|
105cce4a9c | ||
|
|
cf11cad78a | ||
|
|
34c452e658 | ||
|
|
7627b46e44 | ||
|
|
10ba621ee1 | ||
|
|
5c63ccd6cf | ||
|
|
bc13835a01 | ||
|
|
44b056f9e2 | ||
|
|
061ec0dbc6 | ||
|
|
b600f05bd2 | ||
|
|
719f39f489 | ||
|
|
2c6d346584 | ||
|
|
abf41650ee | ||
|
|
b2a8343741 | ||
|
|
ee32a0f923 | ||
|
|
2a760a1e12 | ||
|
|
2014a75678 | ||
|
|
8cb5c79279 | ||
|
|
62202523b8 | ||
|
|
9ce384b600 | ||
|
|
5aacdb2206 | ||
|
|
6ec39b58aa | ||
|
|
c975ab2380 | ||
|
|
1054952e1e | ||
|
|
2216cf47d3 | ||
|
|
365b787fff | ||
|
|
4b4a4029ed | ||
|
|
c1892febc1 | ||
|
|
f0b2d97d00 | ||
|
|
1fa4927035 |
@@ -0,0 +1,65 @@
|
||||
version: '{build}'
|
||||
|
||||
# for Appveyor CI (windows)
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
|
||||
os: Windows Server 2012 R2
|
||||
|
||||
clone_folder: c:\projects\STEPcode
|
||||
|
||||
#grab zip instead of git clone
|
||||
shallow_clone: true
|
||||
platform: x64
|
||||
configuration: Debug
|
||||
|
||||
# errors or couldn't be found by cmake
|
||||
# - GENERATOR: "Visual Studio 9 2008"
|
||||
# ARCH: 32
|
||||
# - GENERATOR: "Visual Studio 10"
|
||||
# ARCH: 32
|
||||
|
||||
#no point in these without artifact support...
|
||||
# - GENERATOR: "Visual Studio 11"
|
||||
#ARCH: 32
|
||||
#- GENERATOR: "Visual Studio 12"
|
||||
#ARCH: 32
|
||||
|
||||
environment:
|
||||
matrix:
|
||||
- GENERATOR: "Visual Studio 12 Win64"
|
||||
ARCH: 64
|
||||
|
||||
# build:
|
||||
# parallel: true
|
||||
# project: ALL_BUILD.vcxproj
|
||||
|
||||
#appveyor limits compile/test to 30 minutes
|
||||
# to reduce time, only test schemas with files: ifc2x3, ap214e3, ap209
|
||||
|
||||
build_script:
|
||||
- ps: |
|
||||
cd c:\projects\STEPcode
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -version
|
||||
grep --version
|
||||
cmake .. -DSC_ENABLE_TESTING=ON -G"$env:GENERATOR" -DSC_BUILD_SCHEMAS="ifc2x3;ap214e3;ap209"
|
||||
echo "filtering build output with grep"
|
||||
cmake --build . --config Debug | grep -ve "CMake does not need to re-run because" -e "ZERO_CHECK.ZERO_CHECK" -e "^ Creating directory"
|
||||
|
||||
#msbuld seems to provide no benefits, and I can't filter its output...
|
||||
#msbuild SC.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /p:Configuration=Debug /p:Platform=x64
|
||||
# /toolsversion:14.0 /p:PlatformToolset=v140
|
||||
|
||||
test_script:
|
||||
- cmd: echo Running CTest...
|
||||
- cmd: cd c:\projects\STEPcode\build
|
||||
- cmd: echo excluding test_inverse_attr3, which hangs
|
||||
- cmd: ctest -j1 . -C Debug -E test_inverse_attr3 --output-on-failure
|
||||
|
||||
# - cmd: grep -niB20 "Test Failed" Testing/Temporary/LastTest.log
|
||||
|
||||
# we could upload a compiled zip somewhere (see Appveyor artifact documentation)
|
||||
+2
-1
@@ -1,2 +1,3 @@
|
||||
/build
|
||||
|
||||
*.kdev4
|
||||
.kdev_include_paths
|
||||
|
||||
+8
-1
@@ -1,7 +1,8 @@
|
||||
sudo: false
|
||||
language: cpp
|
||||
compiler:
|
||||
- clang
|
||||
script: mkdir build && cd build && cmake .. -DSC_ENABLE_TESTING=ON && make -j2 && make -j2 test
|
||||
script: mkdir build && cd build && cmake .. -DSC_ENABLE_TESTING=ON && make -j3 && ctest -j2 --output-on-failure
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
@@ -10,3 +11,9 @@ notifications:
|
||||
email: scl-dev@groups.google.com
|
||||
on_success: change
|
||||
on_failure: always
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
matrix:
|
||||
allow_failures:
|
||||
- os: osx
|
||||
|
||||
+14
-11
@@ -62,11 +62,11 @@ endif(COMMAND CMAKE_POLICY)
|
||||
# CMake derives much of its functionality from modules, typically
|
||||
# stored in one directory - let CMake know where to find them.
|
||||
set(SC_CMAKE_DIR "${SC_SOURCE_DIR}/cmake")
|
||||
if(NOT IS_SUBBUILD)
|
||||
if(NOT SC_IS_SUBBUILD)
|
||||
set(CMAKE_MODULE_PATH "${SC_CMAKE_DIR};${CMAKE_MODULE_PATH}")
|
||||
else(NOT IS_SUBBUILD)
|
||||
else(NOT SC_IS_SUBBUILD)
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${SC_CMAKE_DIR}")
|
||||
endif(NOT IS_SUBBUILD)
|
||||
endif(NOT SC_IS_SUBBUILD)
|
||||
|
||||
# testing and compilation options, build output dirs, install dirs, uninstall, package creation, etc
|
||||
include(${SC_CMAKE_DIR}/SC_Build_opts.cmake)
|
||||
@@ -95,10 +95,12 @@ if(NOT DEFINED SC_BUILD_SCHEMAS)
|
||||
set(SC_BUILD_SCHEMAS "ALL" CACHE string "Semicolon-separated list of paths to EXPRESS schemas to be built")
|
||||
endif(NOT DEFINED SC_BUILD_SCHEMAS)
|
||||
|
||||
list(APPEND CONFIG_END_MESSAGES
|
||||
".. Don't worry about any messages above about missing headers or failed tests, as long as"
|
||||
" you see 'Configuring done' below. Headers and features vary by compiler."
|
||||
".. Generating step can take a while if you are building several schemas.")
|
||||
if(NOT SC_IS_SUBBUILD)
|
||||
list(APPEND CONFIG_END_MESSAGES
|
||||
".. Don't worry about any messages above about missing headers or failed tests, as long as"
|
||||
" you see 'Configuring done' below. Headers and features vary by compiler."
|
||||
".. Generating step can take a while if you are building several schemas.")
|
||||
endif(NOT SC_IS_SUBBUILD)
|
||||
|
||||
# create config headers sc_cf.h and sc_version_string.h
|
||||
include(${SC_CMAKE_DIR}/SC_Config_Headers.cmake)
|
||||
@@ -114,6 +116,9 @@ elseif(BORLAND)
|
||||
add_definitions(-D__BORLAND__ -D__WIN32__)
|
||||
else()
|
||||
add_definitions(-pedantic -W -Wall -Wundef -Wfloat-equal -Wshadow -Winline -Wno-long-long)
|
||||
if(HAVE_NULLPTR)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
endif(HAVE_NULLPTR)
|
||||
endif()
|
||||
|
||||
include_directories(
|
||||
@@ -130,9 +135,7 @@ add_subdirectory(src/clstepcore)
|
||||
add_subdirectory(src/cleditor)
|
||||
add_subdirectory(src/cldai)
|
||||
add_subdirectory(src/clutils)
|
||||
if(NOT WIN32) # don't build cllazyfile on windows until export/import macros are in place
|
||||
add_subdirectory(src/cllazyfile)
|
||||
endif(NOT WIN32)
|
||||
add_subdirectory(src/cllazyfile)
|
||||
add_subdirectory(include)
|
||||
add_subdirectory(data)
|
||||
if(SC_ENABLE_TESTING)
|
||||
@@ -147,7 +150,7 @@ add_dependencies(core stepdai check-express stepeditor exp2cxx)
|
||||
# CONFIG_END_MESSAGES - list of messages to be printed after everything else is done.
|
||||
# THIS MUST BE LAST to ensure that they are visible to the user without scrolling.
|
||||
foreach(_msg ${CONFIG_END_MESSAGES})
|
||||
message("${_msg}")
|
||||
message(STATUS "${_msg}")
|
||||
endforeach(_msg ${CONFIG_END_MESSAGES})
|
||||
|
||||
# Local Variables:
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
# How to contribute
|
||||
|
||||
We love contributions!
|
||||
|
||||
## Getting started
|
||||
|
||||
* Create a github account if you haven't already, and fork the project
|
||||
* Create a new branch, using a branch name that gives an idea of what the changes are about
|
||||
* One topic per commit; a number of small commits are better than one big one
|
||||
* Do not introduce whitespace changes! (**Windows users:** `git config --global core.autocrlf true`)
|
||||
* Encouraged but not enforced: each commit should stand alone, in the sense that the code should compile and run at that point.
|
||||
* One major topic per pull request. Commits that fix small things (typos, formatting) are perfectly acceptable in a PR fixing a bug or adding a feature.
|
||||
* Tests are good. Tests are required unless you're fixing something simple or that was obviously broken.
|
||||
* Make your changes and push them to your GitHub repo
|
||||
* Once your branch is pushed, submit a pull request.
|
||||
* We'll look at the PR and either merge or add feedback. If there isn't any activity within several days, send a message to the mailing list - `scl-dev` AT `groups.google.com`.
|
||||
|
||||
## Coding Standards
|
||||
|
||||
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:
|
||||
```C
|
||||
if( a == 3 ) {
|
||||
c = 5;
|
||||
function( a, b );
|
||||
} else {
|
||||
somefunc();
|
||||
}
|
||||
```
|
||||
- indents are 4 spaces
|
||||
- no tab characters
|
||||
- line endings are LF (linux), not CRLF (windows)
|
||||
- brackets around single-line conditionals
|
||||
- spaces inside parentheses and around operators
|
||||
- return type on the same line as the function name, unless that's
|
||||
too long
|
||||
- doxygen-style comments
|
||||
(see http://www.stack.nl/~dimitri/doxygen/docblocks.html)
|
||||
|
||||
If in doubt about a large patch, run astyle with the config file
|
||||
misc/astyle.cfg.
|
||||
Download astyle from http://sourceforge.net/projects/astyle/files/astyle/
|
||||
|
||||
@@ -18,6 +18,7 @@ New since v0.7:
|
||||
large files for faster "unitary" builds, if the compiler can handle it
|
||||
- unitary builds are faster than the previous builds
|
||||
* most compiler warnings fixed
|
||||
* performance fixes and other changes from BRL-CAD
|
||||
* finally, all tests pass!
|
||||
|
||||
************************************************************************
|
||||
|
||||
+12
-8
@@ -1,5 +1,7 @@
|
||||
Travis-CI build status:
|
||||
[](https://travis-ci.org/stepcode/stepcode)
|
||||
Travis-CI | AppVeyor CI
|
||||
:-------------:|:---------------:
|
||||
Linux, OSX (LLVM) | Windows (MSVC)
|
||||
[](https://travis-ci.org/stepcode/stepcode) | [](https://ci.appveyor.com/project/mpictor/stepcode)
|
||||
|
||||
***********************************************************************
|
||||
STEPcode v0.8 -- stepcode.org, github.com/stepcode/stepcode
|
||||
@@ -35,12 +37,14 @@ 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:
|
||||
if( a == 3 ) {
|
||||
c = 5;
|
||||
function( a, b );
|
||||
} else {
|
||||
somefunc( );
|
||||
}
|
||||
```C
|
||||
if( a == 3 ) {
|
||||
c = 5;
|
||||
function( a, b );
|
||||
} else {
|
||||
somefunc( );
|
||||
}
|
||||
```
|
||||
- indents are 4 spaces
|
||||
- no tab characters
|
||||
- line endings are LF (linux), not CRLF (windows)
|
||||
@@ -1,91 +0,0 @@
|
||||
# - Check if the given C source code compiles and runs.
|
||||
# CHECK_C_SOURCE_RUNS(<code> <var>)
|
||||
# <code> - source code to try to compile
|
||||
# <var> - variable to store the result
|
||||
# (1 for success, empty for failure)
|
||||
# The following variables may be set before calling this macro to
|
||||
# modify the way the check is run:
|
||||
#
|
||||
# CMAKE_REQUIRED_FLAGS = string of compile command line flags
|
||||
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
|
||||
# CMAKE_REQUIRED_INCLUDES = list of include directories
|
||||
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2006-2009 Kitware, Inc.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distributed this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
macro(CHECK_C_FILE_RUNS SOURCE VAR)
|
||||
if("${VAR}" MATCHES "^${VAR}$")
|
||||
set(MACRO_CHECK_FUNCTION_DEFINITIONS
|
||||
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
|
||||
if(CMAKE_REQUIRED_LIBRARIES)
|
||||
set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
|
||||
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
|
||||
else(CMAKE_REQUIRED_LIBRARIES)
|
||||
set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
|
||||
endif(CMAKE_REQUIRED_LIBRARIES)
|
||||
if(CMAKE_REQUIRED_INCLUDES)
|
||||
set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
|
||||
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
|
||||
else(CMAKE_REQUIRED_INCLUDES)
|
||||
set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
|
||||
endif(CMAKE_REQUIRED_INCLUDES)
|
||||
|
||||
message(STATUS "Performing Test ${VAR}")
|
||||
try_run(${VAR}_EXITCODE ${VAR}_COMPILED
|
||||
${CMAKE_BINARY_DIR}
|
||||
${SOURCE}
|
||||
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} ${FILE_RUN_DEFINITIONS}
|
||||
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
|
||||
-DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH}
|
||||
"${CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES}"
|
||||
"${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
|
||||
COMPILE_OUTPUT_VARIABLE OUTPUT)
|
||||
# if it did not compile make the return value fail code of 1
|
||||
if(NOT ${VAR}_COMPILED)
|
||||
set(${VAR}_EXITCODE 1)
|
||||
endif(NOT ${VAR}_COMPILED)
|
||||
# if the return value was 0 then it worked
|
||||
if("${${VAR}_EXITCODE}" EQUAL 0)
|
||||
set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
|
||||
message(STATUS "Performing Test ${VAR} - Success")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||
"Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n"
|
||||
"${OUTPUT}\n"
|
||||
"Return value: ${${VAR}}\n"
|
||||
"Source file was:\n${SOURCE}\n")
|
||||
else("${${VAR}_EXITCODE}" EQUAL 0)
|
||||
if(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
|
||||
set(${VAR} "${${VAR}_EXITCODE}")
|
||||
else(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
|
||||
set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
|
||||
endif(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
|
||||
|
||||
message(STATUS "Performing Test ${VAR} - Failed")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||
"Performing C SOURCE FILE Test ${VAR} failed with the following output:\n"
|
||||
"${OUTPUT}\n"
|
||||
"Return value: ${${VAR}_EXITCODE}\n"
|
||||
"Source file was:\n${SOURCE}\n")
|
||||
|
||||
endif("${${VAR}_EXITCODE}" EQUAL 0)
|
||||
endif("${VAR}" MATCHES "^${VAR}$")
|
||||
endmacro(CHECK_C_FILE_RUNS)
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
+149
-12
@@ -10,7 +10,7 @@
|
||||
#
|
||||
# Originally based off of FindBISON.cmake from Kitware's CMake distribution
|
||||
#
|
||||
# Copyright (c) 2010-2012 United States Government as represented by
|
||||
# Copyright (c) 2010-2016 United States Government as represented by
|
||||
# the U.S. Army Research Laboratory.
|
||||
# Copyright 2009 Kitware, Inc.
|
||||
# Copyright 2006 Tristan Carel
|
||||
@@ -47,21 +47,158 @@
|
||||
find_program(LEMON_EXECUTABLE lemon DOC "path to the lemon executable")
|
||||
mark_as_advanced(LEMON_EXECUTABLE)
|
||||
|
||||
if(LEMON_EXECUTABLE AND NOT LEMON_TEMPLATE)
|
||||
if (LEMON_EXECUTABLE AND NOT LEMON_TEMPLATE)
|
||||
# look for the template in share
|
||||
if (DATA_DIR AND EXISTS "${DATA_DIR}/lemon/lempar.c")
|
||||
set (LEMON_TEMPLATE "${DATA_DIR}/lemon/lempar.c")
|
||||
elseif (EXISTS "share/lemon/lempar.c")
|
||||
set (LEMON_TEMPLATE "share/lemon/lempar.c")
|
||||
elseif (EXISTS "/usr/share/lemon/lempar.c")
|
||||
set (LEMON_TEMPLATE "/usr/share/lemon/lempar.c")
|
||||
endif (DATA_DIR AND EXISTS "${DATA_DIR}/lemon/lempar.c")
|
||||
endif (LEMON_EXECUTABLE AND NOT LEMON_TEMPLATE)
|
||||
|
||||
if (LEMON_EXECUTABLE AND NOT LEMON_TEMPLATE)
|
||||
# look for the template in bin dir
|
||||
get_filename_component(lemon_path ${LEMON_EXECUTABLE} PATH)
|
||||
if(lemon_path)
|
||||
set(LEMON_TEMPLATE "")
|
||||
if(EXISTS ${lemon_path}/lempar.c)
|
||||
set(LEMON_TEMPLATE "${lemon_path}/lempar.c")
|
||||
endif(EXISTS ${lemon_path}/lempar.c)
|
||||
if(EXISTS /usr/share/lemon/lempar.c)
|
||||
set(LEMON_TEMPLATE "/usr/share/lemon/lempar.c")
|
||||
endif(EXISTS /usr/share/lemon/lempar.c)
|
||||
endif(lemon_path)
|
||||
if (lemon_path)
|
||||
if (EXISTS ${lemon_path}/lempar.c)
|
||||
set (LEMON_TEMPLATE "${lemon_path}/lempar.c")
|
||||
endif (EXISTS ${lemon_path}/lempar.c)
|
||||
if (EXISTS /usr/share/lemon/lempar.c)
|
||||
set (LEMON_TEMPLATE "/usr/share/lemon/lempar.c")
|
||||
endif (EXISTS /usr/share/lemon/lempar.c)
|
||||
endif (lemon_path)
|
||||
endif(LEMON_EXECUTABLE AND NOT LEMON_TEMPLATE)
|
||||
|
||||
if (LEMON_EXECUTABLE AND NOT LEMON_TEMPLATE)
|
||||
# fallback
|
||||
set (LEMON_TEMPLATE "lempar.c")
|
||||
if (NOT EXISTS ${LEMON_TEMPLATE})
|
||||
message(WARNING "Lemon's lempar.c template file could not be found automatically, set LEMON_TEMPLATE")
|
||||
endif (NOT EXISTS ${LEMON_TEMPLATE})
|
||||
endif (LEMON_EXECUTABLE AND NOT LEMON_TEMPLATE)
|
||||
|
||||
mark_as_advanced(LEMON_TEMPLATE)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LEMON DEFAULT_MSG LEMON_EXECUTABLE LEMON_TEMPLATE)
|
||||
mark_as_advanced(LEMON_TEMPLATE)
|
||||
|
||||
# Define the macro
|
||||
# LEMON_TARGET(<Name> <LemonInput> <LemonSource> <LemonHeader>
|
||||
# [<ArgString>])
|
||||
# which will create a custom rule to generate a parser. <LemonInput> is
|
||||
# the path to a lemon file. <LemonSource> is the desired name for the
|
||||
# generated source file. <LemonHeader> is the desired name for the
|
||||
# generated header which contains the token list. Anything in the optional
|
||||
# <ArgString> parameter is appended to the lemon command line.
|
||||
#
|
||||
# ====================================================================
|
||||
# Example:
|
||||
#
|
||||
# find_package(LEMON)
|
||||
# LEMON_TARGET(MyParser parser.y parser.c parser.h)
|
||||
# add_executable(Foo main.cpp ${LEMON_MyParser_OUTPUTS})
|
||||
# ====================================================================
|
||||
|
||||
include(CMakeParseArguments)
|
||||
|
||||
if(NOT COMMAND LEMON_TARGET)
|
||||
macro(LEMON_TARGET Name Input)
|
||||
|
||||
get_filename_component(IN_FILE_WE ${Input} NAME_WE)
|
||||
set(LVAR_PREFIX ${Name}_${IN_FILE_WE})
|
||||
|
||||
if(${ARGC} GREATER 3)
|
||||
CMAKE_PARSE_ARGUMENTS(${LVAR_PREFIX} "" "OUT_SRC_FILE;OUT_HDR_FILE;WORKING_DIR;EXTRA_ARGS" "" ${ARGN})
|
||||
endif(${ARGC} GREATER 3)
|
||||
|
||||
# Need a working directory
|
||||
if("${${LVAR_PREFIX}_WORKING_DIR}" STREQUAL "")
|
||||
set(${LVAR_PREFIX}_WORKING_DIR "${CMAKE_CURRENT_BINARY_DIR}/${LVAR_PREFIX}")
|
||||
endif("${${LVAR_PREFIX}_WORKING_DIR}" STREQUAL "")
|
||||
file(MAKE_DIRECTORY ${${LVAR_PREFIX}_WORKING_DIR})
|
||||
|
||||
# Output source file
|
||||
if ("${${LVAR_PREFIX}_OUT_SRC_FILE}" STREQUAL "")
|
||||
set(${LVAR_PREFIX}_OUT_SRC_FILE ${${LVAR_PREFIX}_WORKING_DIR}/${IN_FILE_WE}.c)
|
||||
else ("${${LVAR_PREFIX}_OUT_SRC_FILE}" STREQUAL "")
|
||||
get_filename_component(specified_out_dir ${${LVAR_PREFIX}_OUT_SRC_FILE} PATH)
|
||||
if(NOT "${specified_out_dir}" STREQUAL "")
|
||||
message(FATAL_ERROR "\nFull path specified for OUT_SRC_FILE - should be filename only.\n")
|
||||
endif(NOT "${specified_out_dir}" STREQUAL "")
|
||||
set(${LVAR_PREFIX}_OUT_SRC_FILE ${${LVAR_PREFIX}_WORKING_DIR}/${${LVAR_PREFIX}_OUT_SRC_FILE})
|
||||
endif ("${${LVAR_PREFIX}_OUT_SRC_FILE}" STREQUAL "")
|
||||
|
||||
# Output header file
|
||||
if ("${${LVAR_PREFIX}_OUT_HDR_FILE}" STREQUAL "")
|
||||
set(${LVAR_PREFIX}_OUT_HDR_FILE ${${LVAR_PREFIX}_WORKING_DIR}/${IN_FILE_WE}.h)
|
||||
else ("${${LVAR_PREFIX}_OUT_HDR_FILE}" STREQUAL "")
|
||||
get_filename_component(specified_out_dir ${${LVAR_PREFIX}_OUT_HDR_FILE} PATH)
|
||||
if(NOT "${specified_out_dir}" STREQUAL "")
|
||||
message(FATAL_ERROR "\nFull path specified for OUT_HDR_FILE - should be filename only.\n")
|
||||
endif(NOT "${specified_out_dir}" STREQUAL "")
|
||||
set(${LVAR_PREFIX}_OUT_HDR_FILE ${${LVAR_PREFIX}_WORKING_DIR}/${${LVAR_PREFIX}_OUT_HDR_FILE})
|
||||
endif ("${${LVAR_PREFIX}_OUT_HDR_FILE}" STREQUAL "")
|
||||
|
||||
# input file
|
||||
get_filename_component(in_full ${Input} ABSOLUTE)
|
||||
if("${in_full}" STREQUAL "${Input}")
|
||||
set(lemon_in_file ${Input})
|
||||
else("${in_full}" STREQUAL "${Input}")
|
||||
set(lemon_in_file "${CMAKE_CURRENT_SOURCE_DIR}/${Input}")
|
||||
endif("${in_full}" STREQUAL "${Input}")
|
||||
|
||||
|
||||
# names of lemon output files will be based on the name of the input file
|
||||
set(LEMON_GEN_SOURCE ${${LVAR_PREFIX}_WORKING_DIR}/${IN_FILE_WE}.c)
|
||||
set(LEMON_GEN_HEADER ${${LVAR_PREFIX}_WORKING_DIR}/${IN_FILE_WE}.h)
|
||||
set(LEMON_GEN_OUT ${${LVAR_PREFIX}_WORKING_DIR}/${IN_FILE_WE}.out)
|
||||
|
||||
# copy input to bin directory and run lemon
|
||||
get_filename_component(INPUT_NAME ${Input} NAME)
|
||||
add_custom_command(
|
||||
OUTPUT ${LEMON_GEN_OUT} ${LEMON_GEN_SOURCE} ${LEMON_GEN_HEADER}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${lemon_in_file} ${${LVAR_PREFIX}_WORKING_DIR}/${INPUT_NAME}
|
||||
COMMAND ${LEMON_EXECUTABLE} -T${LEMON_TEMPLATE} ${${LVAR_PREFIX}_WORKING_DIR}/${INPUT_NAME} ${${LVAR_PREFIX}__EXTRA_ARGS}
|
||||
DEPENDS ${Input} ${LEMON_TEMPLATE} ${LEMON_EXECUTABLE_TARGET}
|
||||
WORKING_DIRECTORY ${${LVAR_PREFIX}_WORKING_DIR}
|
||||
COMMENT "[LEMON][${Name}] Building parser with ${LEMON_EXECUTABLE}"
|
||||
)
|
||||
|
||||
# rename generated outputs
|
||||
if(NOT "${${LVAR_PREFIX}_OUT_SRC_FILE}" STREQUAL "${LEMON_GEN_SOURCE}")
|
||||
add_custom_command(
|
||||
OUTPUT ${${LVAR_PREFIX}_OUT_SRC_FILE}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LEMON_GEN_SOURCE} ${${LVAR_PREFIX}_OUT_SRC_FILE}
|
||||
DEPENDS ${LemonInput} ${LEMON_EXECUTABLE_TARGET} ${LEMON_GEN_SOURCE}
|
||||
)
|
||||
set(LEMON_${Name}_OUTPUTS ${${LVAR_PREFIX}_OUT_SRC_FILE} ${LEMON_${Name}_OUTPUTS})
|
||||
endif(NOT "${${LVAR_PREFIX}_OUT_SRC_FILE}" STREQUAL "${LEMON_GEN_SOURCE}")
|
||||
if(NOT "${${LVAR_PREFIX}_OUT_HDR_FILE}" STREQUAL "${LEMON_GEN_HEADER}")
|
||||
add_custom_command(
|
||||
OUTPUT ${${LVAR_PREFIX}_OUT_HDR_FILE}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LEMON_GEN_HEADER} ${${LVAR_PREFIX}_OUT_HDR_FILE}
|
||||
DEPENDS ${LemonInput} ${LEMON_EXECUTABLE_TARGET} ${LEMON_GEN_HEADER}
|
||||
)
|
||||
set(LEMON_${Name}_OUTPUTS ${${LVAR_PREFIX}_OUT_HDR_FILE} ${LEMON_${Name}_OUTPUTS})
|
||||
endif(NOT "${${LVAR_PREFIX}_OUT_HDR_FILE}" STREQUAL "${LEMON_GEN_HEADER}")
|
||||
|
||||
set(LEMON_${Name}_OUTPUTS ${LEMON_${Name}_OUTPUTS} ${LEMON_GEN_OUT})
|
||||
|
||||
# make sure we clean up generated output and copied input
|
||||
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${LEMON_${Name}_OUTPUTS}")
|
||||
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${${LVAR_PREFIX}_WORKING_DIR}/${INPUT_NAME}")
|
||||
|
||||
# macro ran successfully
|
||||
set(LEMON_${Name}_DEFINED TRUE)
|
||||
|
||||
set(LEMON_${Name}_SRC ${${LVAR_PREFIX}_OUT_SRC_FILE})
|
||||
set(LEMON_${Name}_HDR ${${LVAR_PREFIX}_OUT_HDR_FILE})
|
||||
set(LEMON_${Name}_INCLUDE_DIR ${${LVAR_PREFIX}_WORKING_DIR})
|
||||
|
||||
endmacro(LEMON_TARGET)
|
||||
endif(NOT COMMAND LEMON_TARGET)
|
||||
|
||||
#============================================================
|
||||
# FindLEMON.cmake ends here
|
||||
|
||||
+182
-1
@@ -10,7 +10,7 @@
|
||||
#
|
||||
# Originally based off of FindBISON.cmake from Kitware's CMake distribution
|
||||
#
|
||||
# Copyright (c) 2010-2012 United States Government as represented by
|
||||
# Copyright (c) 2010-2016 United States Government as represented by
|
||||
# the U.S. Army Research Laboratory.
|
||||
# Copyright 2009 Kitware, Inc.
|
||||
# Copyright 2006 Tristan Carel
|
||||
@@ -68,6 +68,187 @@ include(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PERPLEX DEFAULT_MSG PERPLEX_EXECUTABLE PERPLEX_TEMPLATE)
|
||||
mark_as_advanced(PERPLEX_TEMPLATE)
|
||||
|
||||
# Defines two macros - PERPLEX_TARGET, which takes perplex inputs and
|
||||
# runs both perplex and re2c to generate C source code/headers, and
|
||||
# ADD_PERPLEX_LEMON_DEPENDENCY which is used to set up dependencies between
|
||||
# scanner and parser targets when necessary.
|
||||
#
|
||||
# #====================================================================
|
||||
# Example:
|
||||
#
|
||||
# find_package(LEMON)
|
||||
# find_package(RE2C)
|
||||
# find_package(PERPLEX)
|
||||
#
|
||||
# LEMON_TARGET(MyParser parser.y "${CMAKE_CURRENT_BINARY_DIR}/parser.cpp")
|
||||
# PERPLEX_TARGET(MyScanner scanner.re "${CMAKE_CURRENT_BINARY_DIR}/scanner.cpp" "${CMAKE_CURRENT_BINARY_DIR}/scanner_header.hpp")
|
||||
# ADD_PERPLEX_LEMON_DEPENDENCY(MyScanner MyParser)
|
||||
#
|
||||
# include_directories("${CMAKE_CURRENT_BINARY_DIR}")
|
||||
# add_executable(Foo
|
||||
# Foo.cc
|
||||
# ${LEMON_MyParser_OUTPUTS}
|
||||
# ${PERPLEX_MyScanner_OUTPUTS}
|
||||
# )
|
||||
# ====================================================================
|
||||
#
|
||||
#=============================================================================
|
||||
#
|
||||
# Originally based off of FindBISON.cmake from Kitware's CMake distribution
|
||||
#
|
||||
# Copyright (c) 2010-2016 United States Government as represented by
|
||||
# the U.S. Army Research Laboratory.
|
||||
# Copyright 2009 Kitware, Inc.
|
||||
# Copyright 2006 Tristan Carel
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# * The names of the authors may not be used to endorse or promote
|
||||
# products derived from this software without specific prior written
|
||||
# permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#=============================================================================
|
||||
|
||||
#============================================================
|
||||
# PERPLEX_TARGET (public macro)
|
||||
#============================================================
|
||||
|
||||
include(CMakeParseArguments)
|
||||
|
||||
if(NOT COMMAND PERPLEX_TARGET)
|
||||
macro(PERPLEX_TARGET Name Input)
|
||||
get_filename_component(IN_FILE_WE ${Input} NAME_WE)
|
||||
set(PVAR_PREFIX ${Name}_${IN_FILE_WE})
|
||||
|
||||
if(${ARGC} GREATER 3)
|
||||
CMAKE_PARSE_ARGUMENTS(${PVAR_PREFIX} "" "TEMPLATE;OUT_SRC_FILE;OUT_HDR_FILE;WORKING_DIR" "" ${ARGN})
|
||||
endif(${ARGC} GREATER 3)
|
||||
|
||||
# Need a working directory
|
||||
if("${${PVAR_PREFIX}_WORKING_DIR}" STREQUAL "")
|
||||
set(${PVAR_PREFIX}_WORKING_DIR "${CMAKE_CURRENT_BINARY_DIR}/${PVAR_PREFIX}")
|
||||
endif("${${PVAR_PREFIX}_WORKING_DIR}" STREQUAL "")
|
||||
file(MAKE_DIRECTORY ${${PVAR_PREFIX}_WORKING_DIR})
|
||||
|
||||
# Set up intermediate and final output names
|
||||
|
||||
# Output source file
|
||||
if ("${${PVAR_PREFIX}_OUT_SRC_FILE}" STREQUAL "")
|
||||
set(${PVAR_PREFIX}_OUT_SRC_FILE ${${PVAR_PREFIX}_WORKING_DIR}/${IN_FILE_WE}.c)
|
||||
else ("${${PVAR_PREFIX}_OUT_SRC_FILE}" STREQUAL "")
|
||||
get_filename_component(specified_out_dir ${${PVAR_PREFIX}_OUT_SRC_FILE} PATH)
|
||||
if(NOT "${specified_out_dir}" STREQUAL "")
|
||||
message(FATAL_ERROR "\nFull path specified for OUT_SRC_FILE - should be filename only.\n")
|
||||
endif(NOT "${specified_out_dir}" STREQUAL "")
|
||||
set(${PVAR_PREFIX}_OUT_SRC_FILE ${${PVAR_PREFIX}_WORKING_DIR}/${${PVAR_PREFIX}_OUT_SRC_FILE})
|
||||
endif ("${${PVAR_PREFIX}_OUT_SRC_FILE}" STREQUAL "")
|
||||
|
||||
# Output header file
|
||||
if ("${${PVAR_PREFIX}_OUT_HDR_FILE}" STREQUAL "")
|
||||
set(${PVAR_PREFIX}_OUT_HDR_FILE ${${PVAR_PREFIX}_WORKING_DIR}/${IN_FILE_WE}.h)
|
||||
else ("${${PVAR_PREFIX}_OUT_HDR_FILE}" STREQUAL "")
|
||||
get_filename_component(specified_out_dir ${${PVAR_PREFIX}_OUT_HDR_FILE} PATH)
|
||||
if(NOT "${specified_out_dir}" STREQUAL "")
|
||||
message(FATAL_ERROR "\nFull path specified for OUT_HDR_FILE - should be filename only.\n")
|
||||
endif(NOT "${specified_out_dir}" STREQUAL "")
|
||||
set(${PVAR_PREFIX}_OUT_HDR_FILE ${${PVAR_PREFIX}_WORKING_DIR}/${${PVAR_PREFIX}_OUT_HDR_FILE})
|
||||
endif ("${${PVAR_PREFIX}_OUT_HDR_FILE}" STREQUAL "")
|
||||
|
||||
# input file
|
||||
get_filename_component(in_full ${Input} ABSOLUTE)
|
||||
if("${in_full}" STREQUAL "${Input}")
|
||||
set(perplex_in_file ${Input})
|
||||
else("${in_full}" STREQUAL "${Input}")
|
||||
set(perplex_in_file "${CMAKE_CURRENT_SOURCE_DIR}/${Input}")
|
||||
endif("${in_full}" STREQUAL "${Input}")
|
||||
|
||||
# Intermediate file
|
||||
set(re2c_src "${${PVAR_PREFIX}_WORKING_DIR}/${IN_FILE_WE}.re")
|
||||
|
||||
# Make sure we have a template
|
||||
if ("${${PVAR_PREFIX}_TEMPLATE}" STREQUAL "")
|
||||
if(PERPLEX_TEMPLATE)
|
||||
set(${PVAR_PREFIX}_TEMPLATE ${PERPLEX_TEMPLATE})
|
||||
else(PERPLEX_TEMPLATE)
|
||||
message(FATAL_ERROR "\nNo Perplex template file specified - please specify the file using the PERPLEX_TEMPLATE variable:\ncmake .. -DPERPLEX_TEMPLATE=/path/to/template_file.c\n")
|
||||
endif(PERPLEX_TEMPLATE)
|
||||
endif ("${${PVAR_PREFIX}_TEMPLATE}" STREQUAL "")
|
||||
|
||||
get_filename_component(IN_FILE ${Input} NAME)
|
||||
add_custom_command(
|
||||
OUTPUT ${re2c_src} ${${PVAR_PREFIX}_OUT_HDR_FILE} ${${PVAR_PREFIX}_WORKING_DIR}/${IN_FILE}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${perplex_in_file} ${${PVAR_PREFIX}_WORKING_DIR}/${IN_FILE}
|
||||
COMMAND ${PERPLEX_EXECUTABLE} -c -o ${re2c_src} -i ${${PVAR_PREFIX}_OUT_HDR_FILE} -t ${${PVAR_PREFIX}_TEMPLATE} ${${PVAR_PREFIX}_WORKING_DIR}/${IN_FILE}
|
||||
DEPENDS ${Input} ${${PVAR_PREFIX}_TEMPLATE} ${PERPLEX_EXECUTABLE_TARGET} ${RE2C_EXECUTABLE_TARGET}
|
||||
WORKING_DIRECTORY ${${PVAR_PREFIX}_WORKING_DIR}
|
||||
COMMENT "[PERPLEX][${Name}] Generating re2c input with ${PERPLEX_EXECUTABLE}"
|
||||
)
|
||||
|
||||
if(NOT DEBUGGING_GENERATED_SOURCES)
|
||||
add_custom_command(
|
||||
OUTPUT ${${PVAR_PREFIX}_OUT_SRC_FILE}
|
||||
COMMAND ${RE2C_EXECUTABLE} --no-debug-info --no-generation-date -c -o ${${PVAR_PREFIX}_OUT_SRC_FILE} ${re2c_src}
|
||||
DEPENDS ${Input} ${re2c_src} ${${PVAR_PREFIX}_OUT_HDR_FILE} ${PERPLEX_EXECUTABLE_TARGET} ${RE2C_EXECUTABLE_TARGET}
|
||||
WORKING_DIRECTORY ${${PVAR_PREFIX}_WORKING_DIR}
|
||||
COMMENT "[RE2C][${Name}] Building scanner with ${RE2C_EXECUTABLE}"
|
||||
)
|
||||
else(NOT DEBUGGING_GENERATED_SOURCES)
|
||||
add_custom_command(
|
||||
OUTPUT ${${PVAR_PREFIX}_OUT_SRC_FILE}
|
||||
COMMAND ${RE2C_EXECUTABLE} --no-generation-date -c -o ${${PVAR_PREFIX}_OUT_SRC_FILE} ${re2c_src}
|
||||
DEPENDS ${Input} ${re2c_src} ${${PVAR_PREFIX}_OUT_HDR_FILE} ${PERPLEX_EXECUTABLE_TARGET} ${RE2C_EXECUTABLE_TARGET}
|
||||
WORKING_DIRECTORY ${${PVAR_PREFIX}_WORKING_DIR}
|
||||
COMMENT "[RE2C][${Name}] Building scanner with ${RE2C_EXECUTABLE}"
|
||||
)
|
||||
endif(NOT DEBUGGING_GENERATED_SOURCES)
|
||||
|
||||
set(PERPLEX_${Name}_DEFINED TRUE)
|
||||
set(PERPLEX_${Name}_SRC ${${PVAR_PREFIX}_OUT_SRC_FILE})
|
||||
set(PERPLEX_${Name}_HDR ${${PVAR_PREFIX}_OUT_HDR_FILE})
|
||||
set(PERPLEX_${Name}_INCLUDE_DIR ${${PVAR_PREFIX}_WORKING_DIR})
|
||||
endmacro(PERPLEX_TARGET)
|
||||
endif(NOT COMMAND PERPLEX_TARGET)
|
||||
|
||||
#============================================================
|
||||
# ADD_PERPLEX_LEMON_DEPENDENCY (public macro)
|
||||
#============================================================
|
||||
if(NOT COMMAND ADD_PERPLEX_LEMON_DEPENDENCY)
|
||||
macro(ADD_PERPLEX_LEMON_DEPENDENCY PERPLEXTarget LemonTarget)
|
||||
|
||||
if(NOT PERPLEX_${PERPLEXTarget}_SRC)
|
||||
message(SEND_ERROR "PERPLEX target `${PERPLEXTarget}' does not exists.")
|
||||
endif()
|
||||
|
||||
if(NOT LEMON_${LemonTarget}_HDR)
|
||||
message(SEND_ERROR "Lemon target `${LemonTarget}' does not exists.")
|
||||
endif()
|
||||
|
||||
set_source_files_properties(${PERPLEX_${PERPLEXTarget}_SRC}
|
||||
PROPERTIES OBJECT_DEPENDS ${LEMON_${LemonTarget}_HDR})
|
||||
endmacro(ADD_PERPLEX_LEMON_DEPENDENCY)
|
||||
endif(NOT COMMAND ADD_PERPLEX_LEMON_DEPENDENCY)
|
||||
|
||||
#============================================================
|
||||
# FindPERPLEX.cmake ends here
|
||||
|
||||
|
||||
+128
-1
@@ -9,10 +9,137 @@ mark_as_advanced(RE2C_EXECUTABLE)
|
||||
include(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(RE2C DEFAULT_MSG RE2C_EXECUTABLE)
|
||||
|
||||
# Provide a macro to generate custom build rules:
|
||||
|
||||
# RE2C_TARGET(Name RE2CInput RE2COutput [COMPILE_FLAGS <string>])
|
||||
# which creates a custom command to generate the <RE2COutput> file from
|
||||
# the <RE2CInput> file. If COMPILE_FLAGS option is specified, the next
|
||||
# parameter is added to the re2c command line. Name is an alias used to
|
||||
# get details of this custom command.
|
||||
|
||||
# This module also defines a macro:
|
||||
# ADD_RE2C_LEMON_DEPENDENCY(RE2CTarget LemonTarget)
|
||||
# which adds the required dependency between a scanner and a parser
|
||||
# where <RE2CTarget> and <LemonTarget> are the first parameters of
|
||||
# respectively RE2C_TARGET and LEMON_TARGET macros.
|
||||
#
|
||||
# ====================================================================
|
||||
# Example:
|
||||
#
|
||||
# find_package(LEMON)
|
||||
# find_package(RE2C)
|
||||
#
|
||||
# LEMON_TARGET(MyParser parser.y "${CMAKE_CURRENT_BINARY_DIR}/parser.cpp")
|
||||
# RE2C_TARGET(MyScanner scanner.re "${CMAKE_CURRENT_BINARY_DIR}/scanner.cpp")
|
||||
# ADD_RE2C_LEMON_DEPENDENCY(MyScanner MyParser)
|
||||
#
|
||||
# include_directories("${CMAKE_CURRENT_BINARY_DIR}")
|
||||
# add_executable(Foo
|
||||
# Foo.cc
|
||||
# ${LEMON_MyParser_OUTPUTS}
|
||||
# ${RE2C_MyScanner_OUTPUTS}
|
||||
# )
|
||||
# ====================================================================
|
||||
#
|
||||
#=============================================================================
|
||||
# Copyright (c) 2010-2016 United States Government as represented by
|
||||
# the U.S. Army Research Laboratory.
|
||||
# Copyright 2009 Kitware, Inc.
|
||||
# Copyright 2006 Tristan Carel
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# * The names of the authors may not be used to endorse or promote
|
||||
# products derived from this software without specific prior written
|
||||
# permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#=============================================================================
|
||||
|
||||
#============================================================
|
||||
# RE2C_TARGET (public macro)
|
||||
#============================================================
|
||||
#
|
||||
# TODO - rework this macro to make use of CMakeParseArguments, see
|
||||
# http://www.cmake.org/pipermail/cmake/2012-July/051309.html
|
||||
if(NOT COMMAND RE2C_TARGET)
|
||||
macro(RE2C_TARGET Name Input Output)
|
||||
set(RE2C_TARGET_usage "RE2C_TARGET(<Name> <Input> <Output> [COMPILE_FLAGS <string>]")
|
||||
if(${ARGC} GREATER 3)
|
||||
if(${ARGC} EQUAL 5)
|
||||
if("${ARGV3}" STREQUAL "COMPILE_FLAGS")
|
||||
set(RE2C_EXECUTABLE_opts "${ARGV4}")
|
||||
SEPARATE_ARGUMENTS(RE2C_EXECUTABLE_opts)
|
||||
else()
|
||||
message(SEND_ERROR ${RE2C_TARGET_usage})
|
||||
endif()
|
||||
else()
|
||||
message(SEND_ERROR ${RE2C_TARGET_usage})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_custom_command(OUTPUT ${Output}
|
||||
COMMAND ${RE2C_EXECUTABLE}
|
||||
ARGS ${RE2C_EXECUTABLE_opts} -o${Output} ${Input}
|
||||
DEPENDS ${Input} ${RE2C_EXECUTABLE_TARGET}
|
||||
COMMENT "[RE2C][${Name}] Building scanner with ${RE2C_EXECUTABLE}"
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
set(RE2C_${Name}_DEFINED TRUE)
|
||||
set(RE2C_${Name}_OUTPUTS ${Output})
|
||||
set(RE2C_${Name}_INPUT ${Input})
|
||||
set(RE2C_${Name}_COMPILE_FLAGS ${RE2C_EXECUTABLE_opts})
|
||||
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${Output}")
|
||||
endmacro(RE2C_TARGET)
|
||||
endif(NOT COMMAND RE2C_TARGET)
|
||||
#============================================================
|
||||
|
||||
#============================================================
|
||||
# ADD_RE2C_LEMON_DEPENDENCY (public macro)
|
||||
#============================================================
|
||||
#
|
||||
if(NOT COMMAND ADD_RE2C_LEMON_DEPENDENCY)
|
||||
macro(ADD_RE2C_LEMON_DEPENDENCY RE2CTarget LemonTarget)
|
||||
|
||||
if(NOT RE2C_${RE2CTarget}_OUTPUTS)
|
||||
message(SEND_ERROR "RE2C target `${RE2CTarget}' does not exists.")
|
||||
endif()
|
||||
|
||||
if(NOT LEMON_${LemonTarget}_HDR)
|
||||
message(SEND_ERROR "Lemon target `${LemonTarget}' does not exists.")
|
||||
endif()
|
||||
|
||||
set_source_files_properties(${RE2C_${RE2CTarget}_OUTPUTS}
|
||||
PROPERTIES OBJECT_DEPENDS ${LEMON_${LemonTarget}_HDR})
|
||||
endmacro(ADD_RE2C_LEMON_DEPENDENCY)
|
||||
endif(NOT COMMAND ADD_RE2C_LEMON_DEPENDENCY)
|
||||
#============================================================
|
||||
|
||||
# RE2C_Util.cmake ends here
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ macro(VERIFY_FILES filelist warn resultvar)
|
||||
MD5(${filefullname} ${filevar}_md5)
|
||||
if(NOT "${${filevar}_md5}" STREQUAL "${baseline_${filevar}_md5}")
|
||||
if("${warn}" STREQUAL "1")
|
||||
message("\n${filename} differs from baseline: baseline md5 hash is ${baseline_${filevar}_md5} and current hash is ${${filevar}_md5}\n")
|
||||
message("\n${filename} differs from baseline: baseline md5 hash is ${baseline_${filevar}_md5} and current hash is ${${filevar}_md5}\n")
|
||||
endif("${warn}" STREQUAL "1")
|
||||
set(${resultvar} 0)
|
||||
endif(NOT "${${filevar}_md5}" STREQUAL "${baseline_${filevar}_md5}")
|
||||
@@ -59,20 +59,6 @@ macro(WRITE_MD5_SUMS filelist outfile)
|
||||
endforeach(fileitem ${filelist})
|
||||
endmacro(WRITE_MD5_SUMS)
|
||||
|
||||
|
||||
macro(GET_GENERATOR_EXEC_VERSIONS)
|
||||
# Read lemon version
|
||||
execute_process(COMMAND ${LEMON_EXECUTABLE} -x OUTPUT_VARIABLE lemon_version)
|
||||
string(REPLACE "Lemon version " "" lemon_version "${lemon_version}")
|
||||
string(STRIP "${lemon_version}" lemon_version)
|
||||
# Read re2c version
|
||||
execute_process(COMMAND ${RE2C_EXECUTABLE} -V OUTPUT_VARIABLE re2c_version)
|
||||
string(STRIP "${re2c_version}" re2c_version)
|
||||
# Read perplex version
|
||||
execute_process(COMMAND ${PERPLEX_EXECUTABLE} -v OUTPUT_VARIABLE perplex_version)
|
||||
string(STRIP "${perplex_version}" perplex_version)
|
||||
endmacro(GET_GENERATOR_EXEC_VERSIONS)
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
|
||||
@@ -1,146 +0,0 @@
|
||||
# Defines the macro
|
||||
# LEMON_TARGET(<Name> <LemonInput> <LemonSource> <LemonHeader>
|
||||
# [<ArgString>])
|
||||
# which will create a custom rule to generate a parser. <LemonInput> is
|
||||
# the path to a lemon file. <LemonSource> is the desired name for the
|
||||
# generated source file. <LemonHeader> is the desired name for the
|
||||
# generated header which contains the token list. Anything in the optional
|
||||
# <ArgString> parameter is appended to the lemon command line.
|
||||
#
|
||||
# ====================================================================
|
||||
# Example:
|
||||
#
|
||||
# find_package(LEMON)
|
||||
# LEMON_TARGET(MyParser parser.y parser.c parser.h)
|
||||
# add_executable(Foo main.cpp ${LEMON_MyParser_OUTPUTS})
|
||||
# ====================================================================
|
||||
#
|
||||
#=============================================================================
|
||||
#
|
||||
# Originally based off of FindBISON.cmake from Kitware's CMake distribution
|
||||
#
|
||||
# Copyright (c) 2010-2012 United States Government as represented by
|
||||
# the U.S. Army Research Laboratory.
|
||||
# Copyright 2009 Kitware, Inc.
|
||||
# Copyright 2006 Tristan Carel
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# * The names of the authors may not be used to endorse or promote
|
||||
# products derived from this software without specific prior written
|
||||
# permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#=============================================================================
|
||||
|
||||
#============================================================
|
||||
# LEMON_TARGET (public macro)
|
||||
#============================================================
|
||||
#
|
||||
macro(LEMON_TARGET Name LemonInput LemonSource LemonHeader)
|
||||
if(NOT ${ARGC} EQUAL 4 AND NOT ${ARGC} EQUAL 5)
|
||||
message(SEND_ERROR "Usage")
|
||||
else()
|
||||
get_filename_component(LemonInputFull ${LemonInput} ABSOLUTE)
|
||||
get_filename_component(LemonSourceFull ${LemonSource} ABSOLUTE)
|
||||
get_filename_component(LemonHeaderFull ${LemonHeader} ABSOLUTE)
|
||||
|
||||
if(NOT ${LemonInput} STREQUAL ${LemonInputFull})
|
||||
set(LEMON_${Name}_INPUT "${CMAKE_CURRENT_BINARY_DIR}/${LemonInput}")
|
||||
else(NOT ${LemonInput} STREQUAL ${LemonInputFull})
|
||||
set(LEMON_${Name}_INPUT "${LemonInput}")
|
||||
endif(NOT ${LemonInput} STREQUAL ${LemonInputFull})
|
||||
|
||||
if(NOT ${LemonSource} STREQUAL ${LemonSourceFull})
|
||||
set(LEMON_${Name}_OUTPUT_SOURCE "${CMAKE_CURRENT_BINARY_DIR}/${LemonSource}")
|
||||
else(NOT ${LemonSource} STREQUAL ${LemonSourceFull})
|
||||
set(LEMON_${Name}_OUTPUT_SOURCE "${LemonSource}")
|
||||
endif(NOT ${LemonSource} STREQUAL ${LemonSourceFull})
|
||||
|
||||
if(NOT ${LemonHeader} STREQUAL ${LemonHeaderFull})
|
||||
set(LEMON_${Name}_OUTPUT_HEADER "${CMAKE_CURRENT_BINARY_DIR}/${LemonHeader}")
|
||||
else(NOT ${LemonHeader} STREQUAL ${LemonHeaderFull})
|
||||
set(LEMON_${Name}_OUTPUT_HEADER "${LemonHeader}")
|
||||
endif(NOT ${LemonHeader} STREQUAL ${LemonHeaderFull})
|
||||
|
||||
set(LEMON_${Name}_EXTRA_ARGS "${ARGV4}")
|
||||
|
||||
# get input name minus path
|
||||
get_filename_component(INPUT_NAME "${LemonInput}" NAME)
|
||||
set(LEMON_BIN_INPUT ${CMAKE_CURRENT_BINARY_DIR}/${INPUT_NAME})
|
||||
|
||||
# names of lemon output files will be based on the name of the input file
|
||||
string(REGEX REPLACE "^(.*)(\\.[^.]*)$" "\\1.c" LEMON_GEN_SOURCE "${INPUT_NAME}")
|
||||
string(REGEX REPLACE "^(.*)(\\.[^.]*)$" "\\1.h" LEMON_GEN_HEADER "${INPUT_NAME}")
|
||||
string(REGEX REPLACE "^(.*)(\\.[^.]*)$" "\\1.out" LEMON_GEN_OUT "${INPUT_NAME}")
|
||||
|
||||
# copy input to bin directory and run lemon
|
||||
add_custom_command(
|
||||
OUTPUT ${LEMON_GEN_OUT} ${LEMON_GEN_SOURCE} ${LEMON_GEN_HEADER}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/${LemonInput} ${LEMON_BIN_INPUT}
|
||||
COMMAND ${LEMON_EXECUTABLE} ${INPUT_NAME} ${LEMON_${Name}_EXTRA_ARGS}
|
||||
DEPENDS ${LemonInput} ${LEMON_TEMPLATE} ${LEMON_EXECUTABLE_TARGET}
|
||||
COMMENT "[LEMON][${Name}] Building parser with ${LEMON_EXECUTABLE}"
|
||||
)
|
||||
|
||||
# rename generated outputs
|
||||
if(NOT "${LemonSource}" STREQUAL "${LEMON_GEN_SOURCE}")
|
||||
add_custom_command(
|
||||
OUTPUT ${LemonSource}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LEMON_GEN_SOURCE} ${LemonSource}
|
||||
DEPENDS ${LemonInput} ${LEMON_EXECUTABLE_TARGET} ${LEMON_GEN_SOURCE}
|
||||
)
|
||||
set(LEMON_${Name}_OUTPUTS ${LemonSource} ${LEMON_${Name}_OUTPUTS})
|
||||
endif(NOT "${LemonSource}" STREQUAL "${LEMON_GEN_SOURCE}")
|
||||
if(NOT "${LemonHeader}" STREQUAL "${LEMON_GEN_HEADER}")
|
||||
add_custom_command(
|
||||
OUTPUT ${LemonHeader}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LEMON_GEN_HEADER} ${LemonHeader}
|
||||
DEPENDS ${LemonInput} ${LEMON_EXECUTABLE_TARGET} ${LEMON_GEN_HEADER}
|
||||
)
|
||||
set(LEMON_${Name}_OUTPUTS ${LemonHeader} ${LEMON_${Name}_OUTPUTS})
|
||||
endif(NOT "${LemonHeader}" STREQUAL "${LEMON_GEN_HEADER}")
|
||||
|
||||
set(LEMON_${Name}_OUTPUTS ${LEMON_GEN_OUT} ${LemonSource} ${LemonHeader})
|
||||
|
||||
# make sure we clean up generated output and copied input
|
||||
if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
|
||||
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${LEMON_${Name}_OUTPUTS}")
|
||||
else("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
|
||||
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${LEMON_${Name}_OUTPUTS};${LEMON_BIN_INPUT}")
|
||||
endif("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
|
||||
|
||||
# macro ran successfully
|
||||
set(LEMON_${Name}_DEFINED TRUE)
|
||||
endif(NOT ${ARGC} EQUAL 4 AND NOT ${ARGC} EQUAL 5)
|
||||
endmacro(LEMON_TARGET)
|
||||
#
|
||||
#============================================================
|
||||
# LEMON_Utils.cmake ends here
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
@@ -1,134 +0,0 @@
|
||||
# Defines two macros - PERPLEX_TARGET, which takes perplex inputs and
|
||||
# runs both perplex and re2c to generate C source code/headers, and
|
||||
# ADD_PERPLEX_LEMON_DEPENDENCY which is used to set up dependencies between
|
||||
# scanner and parser targets when necessary.
|
||||
#
|
||||
# #====================================================================
|
||||
# Example:
|
||||
#
|
||||
# find_package(LEMON)
|
||||
# find_package(RE2C)
|
||||
# find_package(PERPLEX)
|
||||
#
|
||||
# LEMON_TARGET(MyParser parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.cpp
|
||||
# PERPLEX_TARGET(MyScanner scanner.re ${CMAKE_CURRENT_BINARY_DIR}/scanner.cpp ${CMAKE_CURRENT_BINARY_DIR}/scanner_header.hpp)
|
||||
# ADD_PERPLEX_LEMON_DEPENDENCY(MyScanner MyParser)
|
||||
#
|
||||
# include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
# add_executable(Foo
|
||||
# Foo.cc
|
||||
# ${LEMON_MyParser_OUTPUTS}
|
||||
# ${PERPLEX_MyScanner_OUTPUTS}
|
||||
# )
|
||||
# ====================================================================
|
||||
#
|
||||
#=============================================================================
|
||||
#
|
||||
# Originally based off of FindBISON.cmake from Kitware's CMake distribution
|
||||
#
|
||||
# Copyright (c) 2010-2012 United States Government as represented by
|
||||
# the U.S. Army Research Laboratory.
|
||||
# Copyright 2009 Kitware, Inc.
|
||||
# Copyright 2006 Tristan Carel
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# * The names of the authors may not be used to endorse or promote
|
||||
# products derived from this software without specific prior written
|
||||
# permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#=============================================================================
|
||||
|
||||
#============================================================
|
||||
# PERPLEX_TARGET (public macro)
|
||||
#============================================================
|
||||
macro(PERPLEX_TARGET Name Input OutputSrc OutputHeader)
|
||||
if(${ARGC} GREATER 4)
|
||||
set(Template ${ARGV4})
|
||||
else(${ARGC} GREATER 4)
|
||||
if(PERPLEX_TEMPLATE)
|
||||
set(Template ${PERPLEX_TEMPLATE})
|
||||
else(PERPLEX_TEMPLATE)
|
||||
message(FATAL_ERROR "\nNo Perplex template file specifed - please specify the file using the PERPLEX_TEMPLATE variable:\ncmake .. -DPERPLEX_TEMPLATE=/path/to/template_file.c\n")
|
||||
endif(PERPLEX_TEMPLATE)
|
||||
endif(${ARGC} GREATER 4)
|
||||
|
||||
get_filename_component(OutputName ${OutputSrc} NAME)
|
||||
set(re2c_src "${CMAKE_CURRENT_BINARY_DIR}/${OutputName}.re")
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${re2c_src} ${OutputHeader}
|
||||
COMMAND ${PERPLEX_EXECUTABLE} -c -o ${re2c_src} -i ${OutputHeader} -t ${Template} ${Input}
|
||||
DEPENDS ${Input} ${Template} ${PERPLEX_EXECUTABLE_TARGET} ${RE2C_EXECUTABLE_TARGET}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
COMMENT "[PERPLEX][${Name}] Generating re2c input with ${PERPLEX_EXECUTABLE}"
|
||||
)
|
||||
if(NOT DEBUGGING_GENERATED_SOURCES)
|
||||
add_custom_command(
|
||||
OUTPUT ${OutputSrc}
|
||||
COMMAND ${RE2C_EXECUTABLE} --no-debug-info --no-generation-date -c -o ${OutputSrc} ${re2c_src}
|
||||
DEPENDS ${Input} ${re2c_src} ${OutputHeader} ${PERPLEX_EXECUTABLE_TARGET} ${RE2C_EXECUTABLE_TARGET}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
COMMENT "[RE2C][${Name}] Building scanner with ${RE2C_EXECUTABLE}"
|
||||
)
|
||||
else(NOT DEBUGGING_GENERATED_SOURCES)
|
||||
add_custom_command(
|
||||
OUTPUT ${OutputSrc}
|
||||
COMMAND ${RE2C_EXECUTABLE} --no-generation-date -c -o ${OutputSrc} ${re2c_src}
|
||||
DEPENDS ${Input} ${re2c_src} ${OutputHeader} ${PERPLEX_EXECUTABLE_TARGET} ${RE2C_EXECUTABLE_TARGET}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
COMMENT "[RE2C][${Name}] Building scanner with ${RE2C_EXECUTABLE}"
|
||||
)
|
||||
endif(NOT DEBUGGING_GENERATED_SOURCES)
|
||||
set(PERPLEX_${Name}_DEFINED TRUE)
|
||||
set(PERPLEX_${Name}_OUTPUTS ${OutputSrc})
|
||||
set(PERPLEX_${Name}_INPUT ${Input})
|
||||
endmacro(PERPLEX_TARGET)
|
||||
|
||||
#============================================================
|
||||
# ADD_PERPLEX_LEMON_DEPENDENCY (public macro)
|
||||
#============================================================
|
||||
macro(ADD_PERPLEX_LEMON_DEPENDENCY PERPLEXTarget LemonTarget)
|
||||
|
||||
if(NOT PERPLEX_${PERPLEXTarget}_OUTPUTS)
|
||||
message(SEND_ERROR "PERPLEX target `${PERPLEXTarget}' does not exists.")
|
||||
endif()
|
||||
|
||||
if(NOT LEMON_${LemonTarget}_OUTPUT_HEADER)
|
||||
message(SEND_ERROR "Lemon target `${LemonTarget}' does not exists.")
|
||||
endif()
|
||||
|
||||
set_source_files_properties(${PERPLEX_${PERPLEXTarget}_OUTPUTS}
|
||||
PROPERTIES OBJECT_DEPENDS ${LEMON_${LemonTarget}_OUTPUT_HEADER})
|
||||
endmacro(ADD_PERPLEX_LEMON_DEPENDENCY)
|
||||
|
||||
#============================================================
|
||||
# PERPLEX_Utils.cmake ends here
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
@@ -1,3 +1,12 @@
|
||||
# BIN and LIB directories
|
||||
if(NOT DEFINED BIN_DIR)
|
||||
set(BIN_DIR bin)
|
||||
endif(NOT DEFINED BIN_DIR)
|
||||
|
||||
if(NOT DEFINED LIB_DIR)
|
||||
set(LIB_DIR lib)
|
||||
endif(NOT DEFINED LIB_DIR)
|
||||
|
||||
# testing and compilation options, build output dirs, install dirs, etc
|
||||
# included by root CMakeLists
|
||||
|
||||
@@ -42,6 +51,12 @@ OPTION_WITH_DEFAULT(SC_CPP_GENERATOR "Compile exp2cxx" ON)
|
||||
OPTION_WITH_DEFAULT(SC_MEMMGR_ENABLE_CHECKS "Enable sc_memmgr's memory leak detection" OFF)
|
||||
OPTION_WITH_DEFAULT(SC_TRACE_FPRINTF "Enable extra comments in generated code so the code's source in exp2cxx may be located" OFF)
|
||||
|
||||
# Should we use C++11?
|
||||
OPTION_WITH_DEFAULT(SC_ENABLE_CXX11 "Build with C++ 11 features" ON)
|
||||
|
||||
# Get version from git
|
||||
OPTION_WITH_DEFAULT(SC_GIT_VERSION "Build using version from git" ON)
|
||||
|
||||
option(SC_BUILD_EXPRESS_ONLY "Only build express parser." OFF)
|
||||
mark_as_advanced(SC_BUILD_EXPRESS_ONLY)
|
||||
|
||||
@@ -71,6 +86,13 @@ if(SC_ENABLE_TESTING)
|
||||
ENABLE_TESTING()
|
||||
endif(SC_ENABLE_TESTING)
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
# Executable install option
|
||||
OPTION_WITH_DEFAULT(SC_SKIP_EXEC_INSTALL "Skip installing executables" OFF)
|
||||
if(SC_SKIP_EXEC_INSTALL)
|
||||
set(SC_EXEC_NOINSTALL "NO_INSTALL")
|
||||
endif(SC_SKIP_EXEC_INSTALL)
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
# The following logic is what allows binaries to run successfully in
|
||||
# the build directory AND install directory. Thanks to plplot for
|
||||
|
||||
@@ -44,25 +44,53 @@ CHECK_FUNCTION_EXISTS(getopt HAVE_GETOPT)
|
||||
|
||||
CHECK_TYPE_SIZE("ssize_t" SSIZE_T)
|
||||
|
||||
set( TEST_STD_THREAD "
|
||||
if(SC_ENABLE_CXX11)
|
||||
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()
|
||||
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" )
|
||||
set( CMAKE_REQUIRED_FLAGS "-pthread -std=c++11" )
|
||||
else( UNIX )
|
||||
# vars probably need set for MSVC11, embarcadero, etc
|
||||
# vars probably need set for embarcadero, etc
|
||||
endif( UNIX )
|
||||
CHECK_CXX_SOURCE_RUNS( "${TEST_STD_THREAD}" HAVE_STD_THREAD ) #quotes are *required*!
|
||||
cmake_pop_check_state()
|
||||
cmake_pop_check_state()
|
||||
|
||||
set( TEST_STD_CHRONO "
|
||||
#include <iostream>
|
||||
#include <chrono>
|
||||
int main() {
|
||||
std::chrono::seconds sec(1);
|
||||
std::cout << \"1s is \"<< std::chrono::duration_cast<std::chrono::milliseconds>(sec).count() << \" ms\" << std::endl;
|
||||
}
|
||||
" )
|
||||
cmake_push_check_state()
|
||||
if( UNIX )
|
||||
set( CMAKE_REQUIRED_FLAGS "-std=c++11" )
|
||||
else( UNIX )
|
||||
# vars probably need set for embarcadero, etc
|
||||
endif( UNIX )
|
||||
CHECK_CXX_SOURCE_RUNS( "${TEST_STD_CHRONO}" HAVE_STD_CHRONO ) #quotes are *required*!
|
||||
cmake_pop_check_state()
|
||||
|
||||
set( TEST_NULLPTR "
|
||||
#include <cstddef>
|
||||
std::nullptr_t f() {return nullptr;}
|
||||
int main() {return !(f() == f());}
|
||||
" )
|
||||
cmake_push_check_state()
|
||||
if( UNIX )
|
||||
set( CMAKE_REQUIRED_FLAGS "-std=c++11" )
|
||||
else( UNIX )
|
||||
# vars probably need set for embarcadero, etc
|
||||
endif( UNIX )
|
||||
CHECK_CXX_SOURCE_RUNS( "${TEST_NULLPTR}" HAVE_NULLPTR ) #quotes are *required*!
|
||||
cmake_pop_check_state()
|
||||
endif(SC_ENABLE_CXX11)
|
||||
|
||||
# Now that all the tests are done, configure the sc_cf.h file:
|
||||
get_property(CONFIG_H_FILE_CONTENTS GLOBAL PROPERTY SC_CONFIG_H_CONTENTS)
|
||||
@@ -75,14 +103,23 @@ configure_file(${CONFIG_H_FILE} ${SC_BINARY_DIR}/${INCLUDE_INSTALL_DIR}/sc_cf.h)
|
||||
# Using 'ver_string' instead of 'sc_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(${SC_CMAKE_DIR}/sc_version_string.cmake ${SC_BINARY_DIR}/sc_version_string.cmake @ONLY)
|
||||
add_custom_target(version_string ALL DEPENDS ver_string )
|
||||
# creates sc_version_string.h using cmake script
|
||||
add_custom_command(OUTPUT ver_string ${CMAKE_CURRENT_BINARY_DIR}/${INCLUDE_INSTALL_DIR}/sc_version_string.h
|
||||
COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${SC_SOURCE_DIR}
|
||||
-DBINARY_DIR=${SC_BINARY_DIR}
|
||||
-P ${SC_BINARY_DIR}/sc_version_string.cmake)
|
||||
# sc_version_string.h is a generated file
|
||||
if(SC_GIT_VERSION)
|
||||
configure_file(${SC_CMAKE_DIR}/sc_version_string.cmake ${SC_BINARY_DIR}/sc_version_string.cmake @ONLY)
|
||||
add_custom_target(version_string ALL DEPENDS ver_string)
|
||||
# creates sc_version_string.h using cmake script
|
||||
add_custom_command(OUTPUT ver_string
|
||||
COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${SC_SOURCE_DIR} -DBINARY_DIR=${SC_BINARY_DIR} -P ${SC_BINARY_DIR}/sc_version_string.cmake
|
||||
)
|
||||
# sc_version_string.h is a generated file
|
||||
else(SC_GIT_VERSION)
|
||||
set(VER_HDR "
|
||||
#ifndef SC_VERSION_STRING
|
||||
#define SC_VERSION_STRING
|
||||
static char sc_version[512] = {\"${SC_VERSION}\"};
|
||||
#endif"
|
||||
)
|
||||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${INCLUDE_INSTALL_DIR}/sc_version_string.h "${VER_HDR}")
|
||||
endif(SC_GIT_VERSION)
|
||||
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${INCLUDE_INSTALL_DIR}/sc_version_string.h
|
||||
PROPERTIES GENERATED TRUE
|
||||
HEADER_FILE_ONLY TRUE )
|
||||
|
||||
@@ -40,12 +40,6 @@ if(NOT "${SC_GENERATE_LEXER_PARSER}" STREQUAL "OFF")
|
||||
get_filename_component(PERPLEX_TEMPLATE "${CMAKE_BINARY_DIR}/${PERPLEX_TEMPLATE}" ABSOLUTE)
|
||||
endif(NOT "${perplex_template_fpath}" STREQUAL "${PERPLEX_TEMPLATE}")
|
||||
|
||||
if(NOT COMMAND LEMON_TARGET)
|
||||
include(${SC_CMAKE_DIR}/LEMON_Util.cmake)
|
||||
endif(NOT COMMAND LEMON_TARGET)
|
||||
if(NOT COMMAND PERPLEX_TARGET)
|
||||
include(${SC_CMAKE_DIR}/PERPLEX_Util.cmake)
|
||||
endif(NOT COMMAND PERPLEX_TARGET)
|
||||
set(SC_GENERATE_LP_SOURCES 1)
|
||||
message(".. Found perplex, re2c, and lemon - can regenerate lexer/parser if necessary")
|
||||
else(LEMON_EXECUTABLE AND LEMON_TEMPLATE AND PERPLEX_EXECUTABLE AND PERPLEX_TEMPLATE AND RE2C_EXECUTABLE)
|
||||
|
||||
+65
-78
@@ -10,108 +10,86 @@ macro(DEFINE_DLL_EXPORTS libname)
|
||||
string(TOUPPER ${LOWERCORE} UPPER_CORE)
|
||||
set(export "SC_${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}")
|
||||
set_property(TARGET ${libname} APPEND PROPERTY COMPILE_DEFINITIONS "${export}")
|
||||
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)
|
||||
set(imports "")
|
||||
foreach(lib ${libs})
|
||||
string(REGEX REPLACE "lib" "" shortname "${lib}")
|
||||
string(REGEX REPLACE "step" "" LOWERCORE "${shortname}")
|
||||
string(TOUPPER ${LOWERCORE} UPPER_CORE)
|
||||
list(APPEND defs "SC_${UPPER_CORE}_DLL_IMPORTS")
|
||||
list(APPEND imports "SC_${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)
|
||||
set_property(TARGET ${tgt} APPEND PROPERTY COMPILE_DEFINITIONS "${imports}")
|
||||
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 ((SC_ENABLE_TESTING) AND ("${arg_3}" STREQUAL "TESTABLE")))
|
||||
INSTALL(TARGETS ${target} DESTINATION ${dest})
|
||||
else(NOT ((SC_ENABLE_TESTING) AND ("${arg_3}" STREQUAL "TESTABLE")))
|
||||
set_target_properties(${target} PROPERTIES EXCLUDE_FROM_ALL ON)
|
||||
endif(NOT ((SC_ENABLE_TESTING) AND ("${arg_3}" STREQUAL "TESTABLE")))
|
||||
endmacro(EXCLUDE_OR_INSTALL target dest arg_3)
|
||||
|
||||
#SC_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"
|
||||
#SC_ADDEXEC(execname "source files" "linked libs" ["TESTABLE"] ["NO_INSTALL"])
|
||||
macro(SC_ADDEXEC execname srcslist libslist)
|
||||
if(SC_BUILD_SHARED_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 SC-ENABLE_STRICT)
|
||||
set(LOCAL_COMPILE_FLAGS "${LOCAL_COMPILE_FLAGS} ${STRICT_FLAGS}")
|
||||
endif(${extraarg} MATCHES "STRICT" AND SC-ENABLE_STRICT)
|
||||
endforeach(extraarg ${ARGN})
|
||||
if(LOCAL_COMPILE_FLAGS)
|
||||
set_target_properties(${execname} PROPERTIES COMPILE_FLAGS ${LOCAL_COMPILE_FLAGS})
|
||||
endif(LOCAL_COMPILE_FLAGS)
|
||||
endif(SC_BUILD_SHARED_LIBS)
|
||||
if(SC_BUILD_STATIC_LIBS)
|
||||
if(NOT SC_BUILD_SHARED_LIBS)
|
||||
set(staticexecname "${execname}")
|
||||
else()
|
||||
set(staticexecname "${execname}-static")
|
||||
endif(NOT SC_BUILD_SHARED_LIBS)
|
||||
add_executable(${staticexecname} ${srcslist})
|
||||
target_link_libraries(${staticexecname} ${libslist})
|
||||
EXCLUDE_OR_INSTALL(${staticexecname} "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 SC-ENABLE_STRICT)
|
||||
set(LOCAL_COMPILE_FLAGS "${LOCAL_COMPILE_FLAGS} ${STRICT_FLAGS}")
|
||||
endif(${extraarg} MATCHES "STRICT" AND SC-ENABLE_STRICT)
|
||||
endforeach(extraarg ${ARGN})
|
||||
if(LOCAL_COMPILE_FLAGS)
|
||||
set_target_properties(${staticexecname} PROPERTIES COMPILE_FLAGS ${LOCAL_COMPILE_FLAGS})
|
||||
endif(LOCAL_COMPILE_FLAGS)
|
||||
endif(SC_BUILD_STATIC_LIBS)
|
||||
|
||||
string(TOUPPER "${execname}" EXECNAME_UPPER)
|
||||
if(${ARGC} GREATER 3)
|
||||
CMAKE_PARSE_ARGUMENTS(${EXECNAME_UPPER} "NO_INSTALL;TESTABLE" "" "" ${ARGN})
|
||||
endif(${ARGC} GREATER 3)
|
||||
|
||||
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
|
||||
if(NOT ${EXECNAME_UPPER}_NO_INSTALL AND NOT ${EXECNAME_UPPER}_TESTABLE)
|
||||
install(TARGETS ${execname}
|
||||
RUNTIME DESTINATION ${BIN_DIR}
|
||||
LIBRARY DESTINATION ${LIB_DIR}
|
||||
ARCHIVE DESTINATION ${LIB_DIR}
|
||||
)
|
||||
endif(NOT ${EXECNAME_UPPER}_NO_INSTALL AND NOT ${EXECNAME_UPPER}_TESTABLE)
|
||||
if(NOT SC_ENABLE_TESTING AND ${EXECNAME_UPPER}_TESTABLE)
|
||||
set_target_properties( ${execname} PROPERTIES EXCLUDE_FROM_ALL ON )
|
||||
endif(NOT SC_ENABLE_TESTING AND ${EXECNAME_UPPER}_TESTABLE)
|
||||
|
||||
# Enable extra compiler flags if local executables and/or global options dictate
|
||||
set(LOCAL_COMPILE_FLAGS "")
|
||||
foreach(extraarg ${ARGN})
|
||||
if(${extraarg} MATCHES "STRICT" AND SC-ENABLE_STRICT)
|
||||
set(LOCAL_COMPILE_FLAGS "${LOCAL_COMPILE_FLAGS} ${STRICT_FLAGS}")
|
||||
endif(${extraarg} MATCHES "STRICT" AND SC-ENABLE_STRICT)
|
||||
endforeach(extraarg ${ARGN})
|
||||
if(LOCAL_COMPILE_FLAGS)
|
||||
set_target_properties(${execname} PROPERTIES COMPILE_FLAGS ${LOCAL_COMPILE_FLAGS})
|
||||
endif(LOCAL_COMPILE_FLAGS)
|
||||
|
||||
endmacro(SC_ADDEXEC execname srcslist libslist)
|
||||
|
||||
#SC_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"
|
||||
#SC_ADDLIB(libname "source files" "linked libs" ["TESTABLE"] ["NO_INSTALL"] ["SO_SRCS ..."] ["STATIC_SRCS ..."])
|
||||
macro(SC_ADDLIB libname srcslist libslist)
|
||||
|
||||
string(TOUPPER "${libname}" LIBNAME_UPPER)
|
||||
if(${ARGC} GREATER 3)
|
||||
CMAKE_PARSE_ARGUMENTS(${LIBNAME_UPPER} "NO_INSTALL;TESTABLE" "" "SO_SRCS;STATIC_SRCS" ${ARGN})
|
||||
endif(${ARGC} GREATER 3)
|
||||
|
||||
string(REGEX REPLACE "-framework;" "-framework " libslist "${libslist1}")
|
||||
if(SC_BUILD_SHARED_LIBS)
|
||||
add_library(${libname} SHARED ${srcslist})
|
||||
add_library(${libname} SHARED ${srcslist} ${${LIBNAME_UPPER}_SO_SRCS})
|
||||
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 ${SC_ABI_VERSION} SOVERSION ${SC_ABI_SOVERSION})
|
||||
EXCLUDE_OR_INSTALL(${libname} "lib" "${ARGV3}")
|
||||
if(NOT ${LIBNAME_UPPER}_NO_INSTALL AND NOT ${LIBNAME_UPPER}_TESTABLE)
|
||||
install(TARGETS ${libname}
|
||||
RUNTIME DESTINATION ${BIN_DIR}
|
||||
LIBRARY DESTINATION ${LIB_DIR}
|
||||
ARCHIVE DESTINATION ${LIB_DIR}
|
||||
)
|
||||
endif(NOT ${LIBNAME_UPPER}_NO_INSTALL AND NOT ${LIBNAME_UPPER}_TESTABLE)
|
||||
if(NOT SC_ENABLE_TESTING AND ${LIBNAME_UPPER}_TESTABLE)
|
||||
set_target_properties( ${libname} PROPERTIES EXCLUDE_FROM_ALL ON )
|
||||
endif(NOT SC_ENABLE_TESTING AND ${LIBNAME_UPPER}_TESTABLE)
|
||||
if(APPLE)
|
||||
set_target_properties(${libname} PROPERTIES LINK_FLAGS "-flat_namespace -undefined suppress")
|
||||
endif(APPLE)
|
||||
@@ -122,7 +100,7 @@ macro(SC_ADDLIB libname srcslist libslist)
|
||||
else()
|
||||
set(staticlibname "${libname}-static")
|
||||
endif(NOT SC_BUILD_SHARED_LIBS)
|
||||
add_library(${staticlibname} STATIC ${srcslist})
|
||||
add_library(${staticlibname} STATIC ${srcslist} ${${LIBNAME_UPPER}_STATIC_SRCS})
|
||||
DEFINE_DLL_EXPORTS(${staticlibname})
|
||||
if(NOT ${libs} MATCHES "NONE")
|
||||
target_link_libraries(${staticlibname} "${libslist}")
|
||||
@@ -137,7 +115,16 @@ macro(SC_ADDLIB libname srcslist libslist)
|
||||
# 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(${staticlibname} PROPERTIES PREFIX "lib")
|
||||
endif(WIN32)
|
||||
EXCLUDE_OR_INSTALL(${staticlibname} "lib" "${ARGV3}")
|
||||
if(NOT ${LIBNAME_UPPER}_NO_INSTALL AND NOT ${LIBNAME_UPPER}_TESTABLE)
|
||||
install(TARGETS ${libname}-static
|
||||
RUNTIME DESTINATION ${BIN_DIR}
|
||||
LIBRARY DESTINATION ${LIB_DIR}
|
||||
ARCHIVE DESTINATION ${LIB_DIR}
|
||||
)
|
||||
endif(NOT ${LIBNAME_UPPER}_NO_INSTALL AND NOT ${LIBNAME_UPPER}_TESTABLE)
|
||||
if(NOT SC_ENABLE_TESTING AND ${LIBNAME_UPPER}_TESTABLE)
|
||||
set_target_properties( ${libname}-static PROPERTIES EXCLUDE_FROM_ALL ON )
|
||||
endif(NOT SC_ENABLE_TESTING AND ${LIBNAME_UPPER}_TESTABLE)
|
||||
if(APPLE)
|
||||
set_target_properties(${staticlibname} PROPERTIES LINK_FLAGS "-flat_namespace -undefined suppress")
|
||||
endif(APPLE)
|
||||
|
||||
@@ -1,30 +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\"")
|
||||
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)
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
|
||||
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)
|
||||
@@ -1,102 +0,0 @@
|
||||
# Inherit the parent CMake setting
|
||||
set(CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@")
|
||||
set(LEMON_EXECUTABLE "@LEMON_EXECUTABLE@")
|
||||
set(RE2C_EXECUTABLE "@RE2C_EXECUTABLE@")
|
||||
set(PERPLEX_EXECUTABLE "@PERPLEX_EXECUTABLE@")
|
||||
set(SYNC_SCRIPT "@SYNC_SCRIPT@")
|
||||
set(SYNC_TARGET_NAME "@SYNC_TARGET_NAME@")
|
||||
set(DEBUGGING_GENERATED_SOURCES "@DEBUGGING_GENERATED_SOURCES@")
|
||||
|
||||
if(NOT DEBUGGING_GENERATED_SOURCES)
|
||||
# Include the file the provides the baseline against which
|
||||
# current files will be compared
|
||||
include("@BASELINE_INFORMATION_FILE@")
|
||||
|
||||
# Define a variety of convenience routines
|
||||
include("@PROJECT_CMAKE_DIR@/Generated_Source_Utils.cmake")
|
||||
|
||||
# The following need to be checked:
|
||||
#
|
||||
# 1. baseline input MD5 hashes against the current input
|
||||
# hashes. If the cached sources were generated using
|
||||
# inputs other than the current inputs, note they are
|
||||
# out of sync but don't stop. Templates used by perplex
|
||||
# and lemon are part of this group.
|
||||
#
|
||||
# 2. baseline cached source MD5 hashes against current
|
||||
# cached source MD5 hashes. Making sure no changes
|
||||
# have been made to the generated sources. If the
|
||||
# cached sources need to be updated (see #1, for example)
|
||||
# their MD5 hashes need to be updated at the same time.
|
||||
#
|
||||
# 3. MD5 hashes of output generated by the tools against
|
||||
# the MD5 hashes of the equalivent cached sources, if
|
||||
# a) the tool versions are the same b) the input MD5
|
||||
# hash comparisions were the same and c) the baseline
|
||||
# test from #2 passed. This is done to detect platform
|
||||
# differences in output sources, but is only valid if
|
||||
# the input files are in their "pristine" state and the
|
||||
# toolchain is equalivent to that used for the baseline.
|
||||
|
||||
# Individually verify all of the files in question.
|
||||
set(input_files "@INPUT_FILELIST@")
|
||||
VERIFY_FILES("${input_files}" 0 input_unchanged)
|
||||
set(template_files "@TEMPLATE_FILELIST@")
|
||||
VERIFY_FILES("${template_files}" 1 templates_unchanged)
|
||||
set(cached_files "@CACHED_FILELIST@")
|
||||
VERIFY_FILES("${cached_files}" 1 cached_unchanged)
|
||||
if(cached_unchanged)
|
||||
message( "Cached generated source code has not been modified.")
|
||||
else()
|
||||
message(FATAL_ERROR "Cached generated sources do not match the MD5 hashes present in /home/mark/step/sc/src/express/generated/verification_info.cmake - if updating cached sources, remember that the build enforces the requirement that associated MD5 hashes in /home/mark/step/sc/src/express/generated/verification_info.cmake are current as well. Cached generated sources should not be directly edited.")
|
||||
endif(cached_unchanged)
|
||||
|
||||
GET_GENERATOR_EXEC_VERSIONS()
|
||||
|
||||
if("${lemon_version}" VERSION_EQUAL "${baseline_lemon_version}" AND "${perplex_version}" VERSION_EQUAL "${baseline_perplex_version}" AND "${re2c_version}" VERSION_EQUAL "${baseline_re2c_version}")
|
||||
set(tool_versions_equal 1)
|
||||
else()
|
||||
set(tool_versions_equal 0)
|
||||
endif()
|
||||
|
||||
if(NOT input_unchanged)
|
||||
if(templates_unchanged AND tool_versions_equal)
|
||||
message("Input files changed - syncing cached outputs")
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -P ${SYNC_SCRIPT} OUTPUT_VARIABLE output)
|
||||
else(templates_unchanged AND tool_versions_equal)
|
||||
if(NOT templates_unchanged AND NOT tool_versions_equal)
|
||||
message("Input files have been updated, but templates and current tool versions do not match those previously used to generate cached sources. Automatic syncing will not proceed.")
|
||||
message("To force syncing, use the build target ${SYNC_TARGET_NAME}")
|
||||
else(NOT templates_unchanged AND NOT tool_versions_equal)
|
||||
if(NOT templates_unchanged)
|
||||
message("Input files have been updated, but templates do not match those previously used to generate cached sources. Automatic syncing will not proceed.")
|
||||
message("To force syncing, use the build target ${SYNC_TARGET_NAME}")
|
||||
endif(NOT templates_unchanged)
|
||||
if(NOT tool_versions_equal)
|
||||
message("Input files have been updated, but tool versions do not match those previously used to generate cached sources. Automatic syncing will not proceed.")
|
||||
message("To force syncing, use the build target ${SYNC_TARGET_NAME}")
|
||||
endif(NOT tool_versions_equal)
|
||||
endif(NOT templates_unchanged AND NOT tool_versions_equal)
|
||||
endif(templates_unchanged AND tool_versions_equal)
|
||||
else(NOT input_unchanged)
|
||||
if(templates_unchanged AND cached_unchanged AND tool_versions_equal)
|
||||
# Under these conditions, the uncached generated output should be equal to the cached files.
|
||||
# Check if it is - a difference here may indicate a platform-specific behavior in one of the
|
||||
# generators.
|
||||
set(build_files "@BUILD_OUTPUT_FILELIST@")
|
||||
VERIFY_FILES("${build_files}" 1 platform_unchanged)
|
||||
if(NOT platform_unchanged)
|
||||
message("Note: give these build inputs and tools, source files should be identical to generated files. Differences were still observed - possible indiciation of platform-specific generator behavior.")
|
||||
endif(NOT platform_unchanged)
|
||||
endif(templates_unchanged AND cached_unchanged AND tool_versions_equal)
|
||||
endif(NOT input_unchanged)
|
||||
else(NOT DEBUGGING_GENERATED_SOURCES)
|
||||
message("\nNote: DEBUGGING_GENERATED_SOURCES is enabled - generated outputs will contain configuration-specific debugging information, so syncing cached output files is not possible. To restore normal behavior, disable DEBUGGING_GENERATED_SOURCES.\n")
|
||||
endif(NOT DEBUGGING_GENERATED_SOURCES)
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
@@ -0,0 +1,35 @@
|
||||
# Inherit the parent CMake setting
|
||||
set(CURRENT_SOURCE_DIR @CMAKE_CURRENT_SOURCE_DIR@)
|
||||
set(CURRENT_BINARY_DIR @CMAKE_CURRENT_BINARY_DIR@)
|
||||
|
||||
# Define a variety of convenience routines
|
||||
include(@PROJECT_CMAKE_DIR@/Generated_Source_Utils.cmake)
|
||||
|
||||
# The following steps are executed to sync generated sources:
|
||||
#
|
||||
# 1. Create a new verification_info.cmake file and populate
|
||||
# it with the MD5 sums for current files.
|
||||
#
|
||||
# 2. Overwrite the original cached verification_info.cmake
|
||||
# and generated files with the new ones. If LOCKED_SOURCE_DIR
|
||||
# is ON, this step will not be carried out - instead, an
|
||||
# informational message with manual updating instructions
|
||||
# will be printed.
|
||||
|
||||
set(new_info_file "${CURRENT_BINARY_DIR}/verification_info.cmake")
|
||||
|
||||
|
||||
file(WRITE ${new_info_file} "# Autogenerated verification information\n")
|
||||
|
||||
# Handle input files
|
||||
set(input_files "@MD5_FILELIST@")
|
||||
WRITE_MD5_SUMS("${input_files}" "${new_info_file}")
|
||||
|
||||
message("New verification file created: ${new_info_file}")
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
@@ -0,0 +1,30 @@
|
||||
# Inherit the parent CMake setting
|
||||
set(DEBUGGING_GENERATED_SOURCES @DEBUGGING_GENERATED_SOURCES@)
|
||||
set(CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@")
|
||||
|
||||
# Include the file the provides the baseline against which
|
||||
# current files will be compared
|
||||
|
||||
include("@BASELINE_INFORMATION_FILE@")
|
||||
|
||||
# Define a variety of convenience routines
|
||||
include("@PROJECT_CMAKE_DIR@/Generated_Source_Utils.cmake")
|
||||
|
||||
# Individually verify all of the files in question.
|
||||
set(filelist "@MD5_FILELIST@")
|
||||
VERIFY_FILES("${filelist}" 1 srcs_pass)
|
||||
if(NOT srcs_pass)
|
||||
if(NOT DEBUGGING_GENERATED_SOURCES)
|
||||
message(FATAL_ERROR "Sources have been modified and md5 sums have not been updated. This generally indicates either\n a) an input file has been modified but generated files have not been updated, or\n b) genenerated files have been edited directly.\nTo clear the error:\n a) Copy the new generated sources from the build directory to the generated/ sources directory, use the <target>_md5gen build target to create a new verifictation_info.cmake file, and copy verfication_info.cmake to generated/ as well.\n b) install Perplex/Re2C/LEMON and make the changes to the input file rather than the generated file.\nNote:\n If this is a debugging situation where multiple sequential tests must be conducted, temporarily set the variable DEBUGGING_GENERATED_SOURCES to ON during the CMake configure to disable this check.\nThis measure is necessary to ensure that compilations using either Perplex/Re2C/LEMON generation or the cached outputs of those tools produce consistent results.")
|
||||
else(NOT DEBUGGING_GENERATED_SOURCES)
|
||||
message(WARNING "Note: Sources have been modified and md5 sums have not been updated - build failure condition temporarily overridden by DEBUGGING_GENERATED_SOURCES setting.")
|
||||
endif(NOT DEBUGGING_GENERATED_SOURCES)
|
||||
endif(NOT srcs_pass)
|
||||
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
@@ -1,10 +1,16 @@
|
||||
# creates sc_version_string.h, which defines sc_version()
|
||||
# sc_version() returns a pretty commit description and a build timestamp.
|
||||
|
||||
# only update the file if the git commit has changed, because whenever the file is updated files including the header must rebuild
|
||||
# parallel rebuilds can result in race conditions and failures, particularly when running ctest in parallel
|
||||
|
||||
# http://stackoverflow.com/questions/3780667
|
||||
# http://www.cmake.org/pipermail/cmake/2009-February/027014.html
|
||||
|
||||
set(SC_IS_SUBBUILD "@SC_IS_SUBBUILD@")
|
||||
set(SC_ENABLE_TESTING "@SC_ENABLE_TESTING@")
|
||||
|
||||
set(SC_VERSION_HEADER "${BINARY_DIR}/include/sc_version_string.h")
|
||||
|
||||
#---------- find commit id ------------------
|
||||
#use git for a pretty commit id
|
||||
@@ -42,7 +48,9 @@ string(REPLACE "\n" "" GIT_COMMIT_ID ${GIT_COMMIT_ID})
|
||||
#once cmake_minimum_required is >= 2.8.11, we can use TIMESTAMP:
|
||||
#string(TIMESTAMP date_time_string)
|
||||
|
||||
if(UNIX)
|
||||
if(SC_ENABLE_TESTING)
|
||||
set (date_time_string "NA - disabled for testing")
|
||||
elseif(UNIX)
|
||||
execute_process(COMMAND date "+%d %b %Y %H:%M" OUTPUT_VARIABLE date_time_string OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
elseif(WIN32)
|
||||
execute_process(COMMAND cmd /c date /t OUTPUT_VARIABLE currentDate OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
@@ -69,11 +77,12 @@ set(header_string "/* sc_version_string.h - written by cmake. Changes will be lo
|
||||
"#endif\n"
|
||||
)
|
||||
|
||||
file(WRITE sc_version_string.h.txt ${header_string})
|
||||
# copy the file to the final header only if the version changes
|
||||
# reduces needless rebuilds
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
sc_version_string.h.txt ${BINARY_DIR}/include/sc_version_string.h)
|
||||
#don't update the file unless somethig changed
|
||||
string(RANDOM tmpsuffix)
|
||||
file(WRITE ${SC_VERSION_HEADER}.${tmpsuffix} ${header_string})
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SC_VERSION_HEADER}.${tmpsuffix} ${SC_VERSION_HEADER})
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E remove ${SC_VERSION_HEADER}.${tmpsuffix})
|
||||
|
||||
if(NOT SC_IS_SUBBUILD)
|
||||
message("-- sc_version_string.h is up-to-date.")
|
||||
endif(NOT SC_IS_SUBBUILD)
|
||||
|
||||
@@ -12,15 +12,15 @@
|
||||
# this makes compilation faster, but sometimes runs into compiler limitations
|
||||
if(NOT DEFINED SC_UNITY_BUILD)
|
||||
if(BORLAND)
|
||||
message(".. Will not do unity build for this compiler.")
|
||||
message( STATUS "Will not do unity build for this compiler. (SC_UNITY_BUILD=FALSE)")
|
||||
set(SC_UNITY_BUILD FALSE)
|
||||
else()
|
||||
message(".. Assuming compiler is capable of unity build.")
|
||||
message( STATUS "Assuming compiler is capable of unity build. (SC_UNITY_BUILD=TRUE)")
|
||||
set(SC_UNITY_BUILD TRUE)
|
||||
endif(BORLAND)
|
||||
message(".. Override by setting SC_UNITY_BUILD; TRUE will result in *huge* translation units, higher memory use in compilation, and faster build times.")
|
||||
message( STATUS "Override by setting SC_UNITY_BUILD; TRUE will result in faster build times but *huge* translation units and higher memory use in compilation.")
|
||||
else(NOT DEFINED SC_UNITY_BUILD)
|
||||
message(".. Respecting user-defined SC_UNITY_BUILD value of ${SC_UNITY_BUILD}.")
|
||||
message( STATUS "Respecting user-defined SC_UNITY_BUILD value of ${SC_UNITY_BUILD}.")
|
||||
endif(NOT DEFINED SC_UNITY_BUILD)
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ set(CMAKE_C_COMPILER \"${CMAKE_C_COMPILER}\" CACHE STRING \"compiler\")
|
||||
set(CMAKE_CXX_COMPILER \"${CMAKE_CXX_COMPILER}\" CACHE STRING \"compiler\")
|
||||
")
|
||||
|
||||
message("-- Compiling schema scanner...")
|
||||
message( STATUS "Compiling schema scanner...")
|
||||
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${SC_BINARY_DIR}/schemas)
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${SCANNER_BUILD_DIR})
|
||||
@@ -72,7 +72,7 @@ if(NOT ${_ss_build_stat} STREQUAL "0")
|
||||
message(FATAL_ERROR "Scanner build status: ${_ss_build_stat}. stdout:\n${_ss_build_out}\nstderr:\n${_ss_build_err}")
|
||||
endif(NOT ${_ss_build_stat} STREQUAL "0")
|
||||
|
||||
message("-- Schema scanner built. Running it...")
|
||||
message( STATUS "Schema scanner built. Running it...")
|
||||
|
||||
# not sure if it makes sense to install this or not...
|
||||
if(WIN32)
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
# Inherit the parent CMake setting
|
||||
set(DEBUGGING_GENERATED_SOURCES @DEBUGGING_GENERATED_SOURCES@)
|
||||
set(CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@")
|
||||
|
||||
# Include the file the provides the baseline against which
|
||||
# current files will be compared
|
||||
if(NOT DEBUGGING_GENERATED_SOURCES)
|
||||
|
||||
include("@BASELINE_INFORMATION_FILE@")
|
||||
|
||||
# Define a variety of convenience routines
|
||||
include("@PROJECT_CMAKE_DIR@/Generated_Source_Utils.cmake")
|
||||
|
||||
# Individually verify all of the files in question.
|
||||
set(filelist "@CACHED_FILELIST@")
|
||||
VERIFY_FILES("${filelist}" 1 srcs_pass)
|
||||
if( srcs_pass)
|
||||
message( "Generated source code has not been modified.")
|
||||
else(srcs_pass)
|
||||
message(FATAL_ERROR "Generated sources have been modified. These files should never be modified directly except when debugging faulty output from the generators - changes to lexer and parser logic should be made to the generator input files. If this is a debugging situation, set the variable DEBUGGING_GENERATED_SOURCES to ON during the CMake configure.")
|
||||
endif(srcs_pass)
|
||||
|
||||
# If we got by that test, see if it looks like these
|
||||
# sources came from the current input files. It's not
|
||||
# a failure condition if they didn't, but warn about it.
|
||||
set(filelist "@INPUT_FILELIST@")
|
||||
VERIFY_FILES("${filelist}" 0 inputs_same)
|
||||
if(NOT inputs_same)
|
||||
message("Note: cached generated sources are not in sync with input files.")
|
||||
endif(NOT inputs_same)
|
||||
|
||||
endif(NOT DEBUGGING_GENERATED_SOURCES)
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
@@ -217,7 +217,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637538433= FEA_PARAMETRIC_POINT('',(1.,0.,0.));
|
||||
#637538435= PARAMETRIC_REPRESENTATION_CONTEXT(
|
||||
'parametric_representation_context','parametric');
|
||||
#637538439= CURVE_3D_ELEMENT_DESCRIPTOR(.LINEAR.,'LINEAR_CURVE.CROD',((
|
||||
#637538439= CURVE_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,'LINEAR_CURVE.CROD',((
|
||||
ENUMERATED_CURVE_ELEMENT_PURPOSE(.AXIAL.)),(
|
||||
ENUMERATED_CURVE_ELEMENT_PURPOSE(.TORSION.))));
|
||||
#637538443= CURVE_3D_ELEMENT_PROPERTY('PROD.1','',(#637538445),(
|
||||
@@ -784,7 +784,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
);
|
||||
#637539490= PARAMETRIC_REPRESENTATION_CONTEXT(
|
||||
'parametric_representation_context','parametric');
|
||||
#637539494= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR.,'LINEAR_WEDGE.CPENTA',
|
||||
#637539494= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,'LINEAR_WEDGE.CPENTA',
|
||||
(ENUMERATED_VOLUME_ELEMENT_PURPOSE(.STRESS_DISPLACEMENT.)),.WEDGE.);
|
||||
#637539496= VOLUME_3D_ELEMENT_REPRESENTATION('367',(#637539489),
|
||||
#637539490,(#637539284,#637539280,#637539252,#637539424,#637539420,
|
||||
@@ -1074,7 +1074,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637539781= VOLUME_3D_ELEMENT_REPRESENTATION('272',(#637539489),
|
||||
#637539490,(#637538832,#637538864,#637539000,#637538976),#637538282,
|
||||
#637539784,#637539460);
|
||||
#637539784= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR.,
|
||||
#637539784= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,
|
||||
'LINEAR_TETRAHEDRON.CTETRA',(ENUMERATED_VOLUME_ELEMENT_PURPOSE(
|
||||
.STRESS_DISPLACEMENT.)),.TETRAHEDRON.);
|
||||
#637539786= VOLUME_3D_ELEMENT_REPRESENTATION('271',(#637539489),
|
||||
@@ -1797,7 +1797,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637540503= VOLUME_3D_ELEMENT_REPRESENTATION('32',(#637539489),
|
||||
#637539490,(#637538500,#637538504,#637538524,#637538520,#637538560,
|
||||
#637538564,#637538584,#637538580),#637538282,#637540506,#637539460);
|
||||
#637540506= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR.,
|
||||
#637540506= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,
|
||||
'LINEAR_HEXAHEDRON.CHEXA',(ENUMERATED_VOLUME_ELEMENT_PURPOSE(
|
||||
.STRESS_DISPLACEMENT.)),.HEXAHEDRON.);
|
||||
#637540508= VOLUME_3D_ELEMENT_REPRESENTATION('31',(#637539489),
|
||||
@@ -784,7 +784,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
);
|
||||
#637539488= PARAMETRIC_REPRESENTATION_CONTEXT(
|
||||
'parametric_representation_context','parametric');
|
||||
#637539492= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR.,'LINEAR_WEDGE.CPENTA',
|
||||
#637539492= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,'LINEAR_WEDGE.CPENTA',
|
||||
(ENUMERATED_VOLUME_ELEMENT_PURPOSE(.STRESS_DISPLACEMENT.)),.WEDGE.);
|
||||
#637539494= VOLUME_3D_ELEMENT_REPRESENTATION('367',(#637539487),
|
||||
#637539488,(#637539282,#637539278,#637539250,#637539422,#637539418,
|
||||
@@ -1074,7 +1074,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637539779= VOLUME_3D_ELEMENT_REPRESENTATION('272',(#637539487),
|
||||
#637539488,(#637538830,#637538862,#637538998,#637538974),#637538280,
|
||||
#637539782,#637539458);
|
||||
#637539782= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR.,
|
||||
#637539782= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,
|
||||
'LINEAR_TETRAHEDRON.CTETRA',(ENUMERATED_VOLUME_ELEMENT_PURPOSE(
|
||||
.STRESS_DISPLACEMENT.)),.TETRAHEDRON.);
|
||||
#637539784= VOLUME_3D_ELEMENT_REPRESENTATION('271',(#637539487),
|
||||
@@ -1797,7 +1797,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637540501= VOLUME_3D_ELEMENT_REPRESENTATION('32',(#637539487),
|
||||
#637539488,(#637538498,#637538502,#637538522,#637538518,#637538558,
|
||||
#637538562,#637538582,#637538578),#637538280,#637540504,#637539458);
|
||||
#637540504= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR.,
|
||||
#637540504= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,
|
||||
'LINEAR_HEXAHEDRON.CHEXA',(ENUMERATED_VOLUME_ELEMENT_PURPOSE(
|
||||
.STRESS_DISPLACEMENT.)),.HEXAHEDRON.);
|
||||
#637540506= VOLUME_3D_ELEMENT_REPRESENTATION('31',(#637539487),
|
||||
@@ -784,7 +784,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
);
|
||||
#637539490= PARAMETRIC_REPRESENTATION_CONTEXT(
|
||||
'parametric_representation_context','parametric');
|
||||
#637539494= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR.,'LINEAR_WEDGE.CPENTA',
|
||||
#637539494= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,'LINEAR_WEDGE.CPENTA',
|
||||
(ENUMERATED_VOLUME_ELEMENT_PURPOSE(.STRESS_DISPLACEMENT.)),.WEDGE.);
|
||||
#637539496= VOLUME_3D_ELEMENT_LOCATION_POINT_VARIABLE_VALUES(#637539497,
|
||||
#637539487,.F.,(#637539499,#637539504,#637539509,#637539514,#637539519,
|
||||
@@ -5698,7 +5698,7 @@ ANISOTROPIC_SYMMETRIC_TENSOR2_3D((3.419102,7.558704,4.948215,-9.982081,
|
||||
#637542876= VOLUME_3D_ELEMENT_REPRESENTATION('272',(#637539489),
|
||||
#637539490,(#637538832,#637538864,#637539000,#637538976),#637538282,
|
||||
#637542879,#637539460);
|
||||
#637542879= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR.,
|
||||
#637542879= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,
|
||||
'LINEAR_TETRAHEDRON.CTETRA',(ENUMERATED_VOLUME_ELEMENT_PURPOSE(
|
||||
.STRESS_DISPLACEMENT.)),.TETRAHEDRON.);
|
||||
#637542881= VOLUME_3D_ELEMENT_LOCATION_POINT_VARIABLE_VALUES(#637539497,
|
||||
@@ -15071,7 +15071,7 @@ ANISOTROPIC_SYMMETRIC_TENSOR2_3D((167.411,-189.9718,-234.8069,113.0858,
|
||||
#637549373= VOLUME_3D_ELEMENT_REPRESENTATION('32',(#637539489),
|
||||
#637539490,(#637538500,#637538504,#637538524,#637538520,#637538560,
|
||||
#637538564,#637538584,#637538580),#637538282,#637549376,#637539460);
|
||||
#637549376= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR.,
|
||||
#637549376= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,
|
||||
'LINEAR_HEXAHEDRON.CHEXA',(ENUMERATED_VOLUME_ELEMENT_PURPOSE(
|
||||
.STRESS_DISPLACEMENT.)),.HEXAHEDRON.);
|
||||
#637549378= VOLUME_3D_ELEMENT_LOCATION_POINT_VARIABLE_VALUES(#637539497,
|
||||
@@ -217,7 +217,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637538431= FEA_PARAMETRIC_POINT('',(1.,0.,0.));
|
||||
#637538433= PARAMETRIC_REPRESENTATION_CONTEXT(
|
||||
'parametric_representation_context','parametric');
|
||||
#637538437= CURVE_3D_ELEMENT_DESCRIPTOR(.LINEAR.,'LINEAR_CURVE.CROD',((
|
||||
#637538437= CURVE_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,'LINEAR_CURVE.CROD',((
|
||||
ENUMERATED_CURVE_ELEMENT_PURPOSE(.AXIAL.)),(
|
||||
ENUMERATED_CURVE_ELEMENT_PURPOSE(.TORSION.))));
|
||||
#637538441= CURVE_3D_ELEMENT_PROPERTY('PROD.1','',(#637538443),(
|
||||
@@ -217,7 +217,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637538433= FEA_PARAMETRIC_POINT('',(1.,0.,0.));
|
||||
#637538435= PARAMETRIC_REPRESENTATION_CONTEXT(
|
||||
'parametric_representation_context','parametric');
|
||||
#637538439= CURVE_3D_ELEMENT_DESCRIPTOR(.LINEAR.,'LINEAR_CURVE.CROD',((
|
||||
#637538439= CURVE_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,'LINEAR_CURVE.CROD',((
|
||||
ENUMERATED_CURVE_ELEMENT_PURPOSE(.AXIAL.)),(
|
||||
ENUMERATED_CURVE_ELEMENT_PURPOSE(.TORSION.))));
|
||||
#637538443= CURVE_3D_ELEMENT_PROPERTY('PROD.1','',(#637538445),(
|
||||
@@ -217,7 +217,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637538433= FEA_PARAMETRIC_POINT('',(1.,0.,0.));
|
||||
#637538435= PARAMETRIC_REPRESENTATION_CONTEXT(
|
||||
'parametric_representation_context','parametric');
|
||||
#637538439= CURVE_3D_ELEMENT_DESCRIPTOR(.LINEAR.,'LINEAR_CURVE.CBAR*',((
|
||||
#637538439= CURVE_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,'LINEAR_CURVE.CBAR*',((
|
||||
ENUMERATED_CURVE_ELEMENT_PURPOSE(.AXIAL.)),(
|
||||
ENUMERATED_CURVE_ELEMENT_PURPOSE(.Y_Y_BENDING.),
|
||||
ENUMERATED_CURVE_ELEMENT_PURPOSE(.Z_Z_BENDING.)),(
|
||||
@@ -217,7 +217,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637538431= FEA_PARAMETRIC_POINT('',(1.,0.,0.));
|
||||
#637538433= PARAMETRIC_REPRESENTATION_CONTEXT(
|
||||
'parametric_representation_context','parametric');
|
||||
#637538437= CURVE_3D_ELEMENT_DESCRIPTOR(.LINEAR.,'LINEAR_CURVE.CBAR*',((
|
||||
#637538437= CURVE_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,'LINEAR_CURVE.CBAR*',((
|
||||
ENUMERATED_CURVE_ELEMENT_PURPOSE(.AXIAL.)),(
|
||||
ENUMERATED_CURVE_ELEMENT_PURPOSE(.Y_Y_BENDING.),
|
||||
ENUMERATED_CURVE_ELEMENT_PURPOSE(.Z_Z_BENDING.)),(
|
||||
@@ -217,7 +217,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637538433= FEA_PARAMETRIC_POINT('',(1.,0.,0.));
|
||||
#637538435= PARAMETRIC_REPRESENTATION_CONTEXT(
|
||||
'parametric_representation_context','parametric');
|
||||
#637538439= CURVE_3D_ELEMENT_DESCRIPTOR(.LINEAR.,'LINEAR_CURVE.CBAR*',((
|
||||
#637538439= CURVE_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,'LINEAR_CURVE.CBAR*',((
|
||||
ENUMERATED_CURVE_ELEMENT_PURPOSE(.AXIAL.)),(
|
||||
ENUMERATED_CURVE_ELEMENT_PURPOSE(.Y_Y_BENDING.),
|
||||
ENUMERATED_CURVE_ELEMENT_PURPOSE(.Z_Z_BENDING.)),(
|
||||
@@ -346,7 +346,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637538689= PARAMETRIC_SURFACE_3D_ELEMENT_COORDINATE_SYSTEM('',1,0.);
|
||||
#637538690= PARAMETRIC_REPRESENTATION_CONTEXT(
|
||||
'parametric_representation_context','parametric');
|
||||
#637538694= SURFACE_3D_ELEMENT_DESCRIPTOR(.LINEAR.,
|
||||
#637538694= SURFACE_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,
|
||||
'LINEAR_TRIANGLE.CTRIA3',((ENUMERATED_SURFACE_ELEMENT_PURPOSE(
|
||||
.MEMBRANE_DIRECT.),ENUMERATED_SURFACE_ELEMENT_PURPOSE(.MEMBRANE_SHEAR.))
|
||||
,(ENUMERATED_SURFACE_ELEMENT_PURPOSE(.BENDING_DIRECT.),
|
||||
@@ -503,7 +503,7 @@ UNSPECIFIED_VALUE(.UNSPECIFIED.),UNSPECIFIED_VALUE(.UNSPECIFIED.));
|
||||
#637538690,(#637538456,#637538460,#637538504,#637538500),#637538282,
|
||||
#637538847,#637538699,#637538660);
|
||||
#637538845= PARAMETRIC_SURFACE_3D_ELEMENT_COORDINATE_SYSTEM('',1,0.);
|
||||
#637538847= SURFACE_3D_ELEMENT_DESCRIPTOR(.LINEAR.,
|
||||
#637538847= SURFACE_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,
|
||||
'LINEAR_QUADRILATERAL.CQUAD4',((ENUMERATED_SURFACE_ELEMENT_PURPOSE(
|
||||
.MEMBRANE_DIRECT.),ENUMERATED_SURFACE_ELEMENT_PURPOSE(.MEMBRANE_SHEAR.))
|
||||
,(ENUMERATED_SURFACE_ELEMENT_PURPOSE(.BENDING_DIRECT.),
|
||||
@@ -346,7 +346,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637538687= PARAMETRIC_SURFACE_3D_ELEMENT_COORDINATE_SYSTEM('',1,0.);
|
||||
#637538688= PARAMETRIC_REPRESENTATION_CONTEXT(
|
||||
'parametric_representation_context','parametric');
|
||||
#637538692= SURFACE_3D_ELEMENT_DESCRIPTOR(.LINEAR.,
|
||||
#637538692= SURFACE_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,
|
||||
'LINEAR_TRIANGLE.CTRIA3',((ENUMERATED_SURFACE_ELEMENT_PURPOSE(
|
||||
.MEMBRANE_DIRECT.),ENUMERATED_SURFACE_ELEMENT_PURPOSE(.MEMBRANE_SHEAR.))
|
||||
,(ENUMERATED_SURFACE_ELEMENT_PURPOSE(.BENDING_DIRECT.),
|
||||
@@ -503,7 +503,7 @@ UNSPECIFIED_VALUE(.UNSPECIFIED.),UNSPECIFIED_VALUE(.UNSPECIFIED.));
|
||||
#637538688,(#637538454,#637538458,#637538502,#637538498),#637538280,
|
||||
#637538845,#637538697,#637538658);
|
||||
#637538843= PARAMETRIC_SURFACE_3D_ELEMENT_COORDINATE_SYSTEM('',1,0.);
|
||||
#637538845= SURFACE_3D_ELEMENT_DESCRIPTOR(.LINEAR.,
|
||||
#637538845= SURFACE_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,
|
||||
'LINEAR_QUADRILATERAL.CQUAD4',((ENUMERATED_SURFACE_ELEMENT_PURPOSE(
|
||||
.MEMBRANE_DIRECT.),ENUMERATED_SURFACE_ELEMENT_PURPOSE(.MEMBRANE_SHEAR.))
|
||||
,(ENUMERATED_SURFACE_ELEMENT_PURPOSE(.BENDING_DIRECT.),
|
||||
@@ -346,7 +346,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637538689= PARAMETRIC_SURFACE_3D_ELEMENT_COORDINATE_SYSTEM('',1,0.);
|
||||
#637538690= PARAMETRIC_REPRESENTATION_CONTEXT(
|
||||
'parametric_representation_context','parametric');
|
||||
#637538694= SURFACE_3D_ELEMENT_DESCRIPTOR(.LINEAR.,
|
||||
#637538694= SURFACE_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,
|
||||
'LINEAR_TRIANGLE.CTRIA3',((ENUMERATED_SURFACE_ELEMENT_PURPOSE(
|
||||
.MEMBRANE_DIRECT.),ENUMERATED_SURFACE_ELEMENT_PURPOSE(.MEMBRANE_SHEAR.))
|
||||
,(ENUMERATED_SURFACE_ELEMENT_PURPOSE(.BENDING_DIRECT.),
|
||||
@@ -1375,7 +1375,7 @@ ANISOTROPIC_SYMMETRIC_TENSOR2_3D((-500.0138,-127.7892,0.,25.74217,0.,0.)
|
||||
#637538690,(#637538456,#637538460,#637538504,#637538500),#637538282,
|
||||
#637539434,#637538699,#637538660);
|
||||
#637539432= PARAMETRIC_SURFACE_3D_ELEMENT_COORDINATE_SYSTEM('',1,0.);
|
||||
#637539434= SURFACE_3D_ELEMENT_DESCRIPTOR(.LINEAR.,
|
||||
#637539434= SURFACE_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,
|
||||
'LINEAR_QUADRILATERAL.CQUAD4',((ENUMERATED_SURFACE_ELEMENT_PURPOSE(
|
||||
.MEMBRANE_DIRECT.),ENUMERATED_SURFACE_ELEMENT_PURPOSE(.MEMBRANE_SHEAR.))
|
||||
,(ENUMERATED_SURFACE_ELEMENT_PURPOSE(.BENDING_DIRECT.),
|
||||
@@ -719,7 +719,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
);
|
||||
#637539370= PARAMETRIC_REPRESENTATION_CONTEXT(
|
||||
'parametric_representation_context','parametric');
|
||||
#637539374= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR.,'LINEAR_WEDGE.CPENTA',
|
||||
#637539374= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,'LINEAR_WEDGE.CPENTA',
|
||||
(ENUMERATED_VOLUME_ELEMENT_PURPOSE(.STRESS_DISPLACEMENT.)),.WEDGE.);
|
||||
#637539376= VOLUME_3D_ELEMENT_REPRESENTATION('367',(#637539369),
|
||||
#637539370,(#637538804,#637539184,#637539160,#637538924,#637539304,
|
||||
@@ -1009,7 +1009,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637539661= VOLUME_3D_ELEMENT_REPRESENTATION('272',(#637539369),
|
||||
#637539370,(#637538800,#637538548,#637538944,#637538572),#637538282,
|
||||
#637539664,#637539340);
|
||||
#637539664= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR.,
|
||||
#637539664= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,
|
||||
'LINEAR_TETRAHEDRON.CTETRA',(ENUMERATED_VOLUME_ELEMENT_PURPOSE(
|
||||
.STRESS_DISPLACEMENT.)),.TETRAHEDRON.);
|
||||
#637539666= VOLUME_3D_ELEMENT_REPRESENTATION('271',(#637539369),
|
||||
@@ -1732,7 +1732,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637540383= VOLUME_3D_ELEMENT_REPRESENTATION('32',(#637539369),
|
||||
#637539370,(#637538500,#637538504,#637538524,#637538520,#637538560,
|
||||
#637538564,#637538584,#637538580),#637538282,#637540386,#637539340);
|
||||
#637540386= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR.,
|
||||
#637540386= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,
|
||||
'LINEAR_HEXAHEDRON.CHEXA',(ENUMERATED_VOLUME_ELEMENT_PURPOSE(
|
||||
.STRESS_DISPLACEMENT.)),.HEXAHEDRON.);
|
||||
#637540388= VOLUME_3D_ELEMENT_REPRESENTATION('31',(#637539369),
|
||||
@@ -719,7 +719,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
);
|
||||
#637539368= PARAMETRIC_REPRESENTATION_CONTEXT(
|
||||
'parametric_representation_context','parametric');
|
||||
#637539372= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR.,'LINEAR_WEDGE.CPENTA',
|
||||
#637539372= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,'LINEAR_WEDGE.CPENTA',
|
||||
(ENUMERATED_VOLUME_ELEMENT_PURPOSE(.STRESS_DISPLACEMENT.)),.WEDGE.);
|
||||
#637539374= VOLUME_3D_ELEMENT_REPRESENTATION('367',(#637539367),
|
||||
#637539368,(#637538802,#637539182,#637539158,#637538922,#637539302,
|
||||
@@ -1009,7 +1009,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637539659= VOLUME_3D_ELEMENT_REPRESENTATION('272',(#637539367),
|
||||
#637539368,(#637538798,#637538546,#637538942,#637538570),#637538280,
|
||||
#637539662,#637539338);
|
||||
#637539662= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR.,
|
||||
#637539662= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,
|
||||
'LINEAR_TETRAHEDRON.CTETRA',(ENUMERATED_VOLUME_ELEMENT_PURPOSE(
|
||||
.STRESS_DISPLACEMENT.)),.TETRAHEDRON.);
|
||||
#637539664= VOLUME_3D_ELEMENT_REPRESENTATION('271',(#637539367),
|
||||
@@ -1732,7 +1732,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637540381= VOLUME_3D_ELEMENT_REPRESENTATION('32',(#637539367),
|
||||
#637539368,(#637538498,#637538502,#637538522,#637538518,#637538558,
|
||||
#637538562,#637538582,#637538578),#637538280,#637540384,#637539338);
|
||||
#637540384= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR.,
|
||||
#637540384= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,
|
||||
'LINEAR_HEXAHEDRON.CHEXA',(ENUMERATED_VOLUME_ELEMENT_PURPOSE(
|
||||
.STRESS_DISPLACEMENT.)),.HEXAHEDRON.);
|
||||
#637540386= VOLUME_3D_ELEMENT_REPRESENTATION('31',(#637539367),
|
||||
@@ -719,7 +719,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
);
|
||||
#637539370= PARAMETRIC_REPRESENTATION_CONTEXT(
|
||||
'parametric_representation_context','parametric');
|
||||
#637539374= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR.,'LINEAR_WEDGE.CPENTA',
|
||||
#637539374= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,'LINEAR_WEDGE.CPENTA',
|
||||
(ENUMERATED_VOLUME_ELEMENT_PURPOSE(.STRESS_DISPLACEMENT.)),.WEDGE.);
|
||||
#637539376= VOLUME_3D_ELEMENT_LOCATION_POINT_VARIABLE_VALUES(#637539377,
|
||||
#637539367,.F.,(#637539379,#637539384,#637539389,#637539394,#637539399,
|
||||
@@ -5633,7 +5633,7 @@ ANISOTROPIC_SYMMETRIC_TENSOR2_3D((3.419102,7.558704,4.948215,-9.982081,
|
||||
#637542756= VOLUME_3D_ELEMENT_REPRESENTATION('272',(#637539369),
|
||||
#637539370,(#637538800,#637538548,#637538944,#637538572),#637538282,
|
||||
#637542759,#637539340);
|
||||
#637542759= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR.,
|
||||
#637542759= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,
|
||||
'LINEAR_TETRAHEDRON.CTETRA',(ENUMERATED_VOLUME_ELEMENT_PURPOSE(
|
||||
.STRESS_DISPLACEMENT.)),.TETRAHEDRON.);
|
||||
#637542761= VOLUME_3D_ELEMENT_LOCATION_POINT_VARIABLE_VALUES(#637539377,
|
||||
@@ -15006,7 +15006,7 @@ ANISOTROPIC_SYMMETRIC_TENSOR2_3D((167.411,-189.9718,-234.8069,113.0858,
|
||||
#637549253= VOLUME_3D_ELEMENT_REPRESENTATION('32',(#637539369),
|
||||
#637539370,(#637538500,#637538504,#637538524,#637538520,#637538560,
|
||||
#637538564,#637538584,#637538580),#637538282,#637549256,#637539340);
|
||||
#637549256= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR.,
|
||||
#637549256= VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER.,
|
||||
'LINEAR_HEXAHEDRON.CHEXA',(ENUMERATED_VOLUME_ELEMENT_PURPOSE(
|
||||
.STRESS_DISPLACEMENT.)),.HEXAHEDRON.);
|
||||
#637549258= VOLUME_3D_ELEMENT_LOCATION_POINT_VARIABLE_VALUES(#637539377,
|
||||
@@ -687,7 +687,7 @@ SI_UNIT($,.DEGREE_CELSIUS.)THERMODYNAMIC_TEMPERATURE_UNIT());
|
||||
#637539350= PARAMETRIC_SURFACE_3D_ELEMENT_COORDINATE_SYSTEM('',1,0.);
|
||||
#637539351= PARAMETRIC_REPRESENTATION_CONTEXT(
|
||||
'parametric_representation_context','parametric');
|
||||
#637539355= SURFACE_3D_ELEMENT_DESCRIPTOR(.QUADRATIC.,
|
||||
#637539355= SURFACE_3D_ELEMENT_DESCRIPTOR(.QUADRATIC_ORDER.,
|
||||
'QUADRATIC_QUADRILATERAL.CQUAD8',((ENUMERATED_SURFACE_ELEMENT_PURPOSE(
|
||||
.MEMBRANE_DIRECT.),ENUMERATED_SURFACE_ELEMENT_PURPOSE(.MEMBRANE_SHEAR.))
|
||||
,(ENUMERATED_SURFACE_ELEMENT_PURPOSE(.BENDING_DIRECT.),
|
||||
@@ -896,7 +896,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637539351,(#637538532,#637538372,#637538328,#637539004,#637538744,
|
||||
#637539008),#637538282,#637539515,#637539360,#637539363);
|
||||
#637539513= PARAMETRIC_SURFACE_3D_ELEMENT_COORDINATE_SYSTEM('',1,0.);
|
||||
#637539515= SURFACE_3D_ELEMENT_DESCRIPTOR(.QUADRATIC.,
|
||||
#637539515= SURFACE_3D_ELEMENT_DESCRIPTOR(.QUADRATIC_ORDER.,
|
||||
'QUADRATIC_TRIANGLE.CTRIA6',((ENUMERATED_SURFACE_ELEMENT_PURPOSE(
|
||||
.MEMBRANE_DIRECT.),ENUMERATED_SURFACE_ELEMENT_PURPOSE(.MEMBRANE_SHEAR.))
|
||||
,(ENUMERATED_SURFACE_ELEMENT_PURPOSE(.BENDING_DIRECT.),
|
||||
@@ -687,7 +687,7 @@ SI_UNIT($,.DEGREE_CELSIUS.)THERMODYNAMIC_TEMPERATURE_UNIT());
|
||||
#637539348= PARAMETRIC_SURFACE_3D_ELEMENT_COORDINATE_SYSTEM('',1,0.);
|
||||
#637539349= PARAMETRIC_REPRESENTATION_CONTEXT(
|
||||
'parametric_representation_context','parametric');
|
||||
#637539353= SURFACE_3D_ELEMENT_DESCRIPTOR(.QUADRATIC.,
|
||||
#637539353= SURFACE_3D_ELEMENT_DESCRIPTOR(.QUADRATIC_ORDER.,
|
||||
'QUADRATIC_QUADRILATERAL.CQUAD8',((ENUMERATED_SURFACE_ELEMENT_PURPOSE(
|
||||
.MEMBRANE_DIRECT.),ENUMERATED_SURFACE_ELEMENT_PURPOSE(.MEMBRANE_SHEAR.))
|
||||
,(ENUMERATED_SURFACE_ELEMENT_PURPOSE(.BENDING_DIRECT.),
|
||||
@@ -896,7 +896,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637539349,(#637538530,#637538370,#637538326,#637539002,#637538742,
|
||||
#637539006),#637538280,#637539513,#637539358,#637539361);
|
||||
#637539511= PARAMETRIC_SURFACE_3D_ELEMENT_COORDINATE_SYSTEM('',1,0.);
|
||||
#637539513= SURFACE_3D_ELEMENT_DESCRIPTOR(.QUADRATIC.,
|
||||
#637539513= SURFACE_3D_ELEMENT_DESCRIPTOR(.QUADRATIC_ORDER.,
|
||||
'QUADRATIC_TRIANGLE.CTRIA6',((ENUMERATED_SURFACE_ELEMENT_PURPOSE(
|
||||
.MEMBRANE_DIRECT.),ENUMERATED_SURFACE_ELEMENT_PURPOSE(.MEMBRANE_SHEAR.))
|
||||
,(ENUMERATED_SURFACE_ELEMENT_PURPOSE(.BENDING_DIRECT.),
|
||||
@@ -687,7 +687,7 @@ SI_UNIT($,.DEGREE_CELSIUS.)THERMODYNAMIC_TEMPERATURE_UNIT());
|
||||
#637539350= PARAMETRIC_SURFACE_3D_ELEMENT_COORDINATE_SYSTEM('',1,0.);
|
||||
#637539351= PARAMETRIC_REPRESENTATION_CONTEXT(
|
||||
'parametric_representation_context','parametric');
|
||||
#637539355= SURFACE_3D_ELEMENT_DESCRIPTOR(.QUADRATIC.,
|
||||
#637539355= SURFACE_3D_ELEMENT_DESCRIPTOR(.QUADRATIC_ORDER.,
|
||||
'QUADRATIC_QUADRILATERAL.CQUAD8',((ENUMERATED_SURFACE_ELEMENT_PURPOSE(
|
||||
.MEMBRANE_DIRECT.),ENUMERATED_SURFACE_ELEMENT_PURPOSE(.MEMBRANE_SHEAR.))
|
||||
,(ENUMERATED_SURFACE_ELEMENT_PURPOSE(.BENDING_DIRECT.),
|
||||
@@ -3640,7 +3640,7 @@ ANISOTROPIC_SYMMETRIC_TENSOR2_3D((-783.8278,3524.98,0.,-750.8163,0.,0.))
|
||||
#637539351,(#637538532,#637538372,#637538328,#637539004,#637538744,
|
||||
#637539008),#637538282,#637541306,#637539360,#637539363);
|
||||
#637541304= PARAMETRIC_SURFACE_3D_ELEMENT_COORDINATE_SYSTEM('',1,0.);
|
||||
#637541306= SURFACE_3D_ELEMENT_DESCRIPTOR(.QUADRATIC.,
|
||||
#637541306= SURFACE_3D_ELEMENT_DESCRIPTOR(.QUADRATIC_ORDER.,
|
||||
'QUADRATIC_TRIANGLE.CTRIA6',((ENUMERATED_SURFACE_ELEMENT_PURPOSE(
|
||||
.MEMBRANE_DIRECT.),ENUMERATED_SURFACE_ELEMENT_PURPOSE(.MEMBRANE_SHEAR.))
|
||||
,(ENUMERATED_SURFACE_ELEMENT_PURPOSE(.BENDING_DIRECT.),
|
||||
@@ -2587,7 +2587,7 @@ SI_UNIT($,.DEGREE_CELSIUS.)THERMODYNAMIC_TEMPERATURE_UNIT());
|
||||
);
|
||||
#637542839= PARAMETRIC_REPRESENTATION_CONTEXT(
|
||||
'parametric_representation_context','parametric');
|
||||
#637542843= VOLUME_3D_ELEMENT_DESCRIPTOR(.QUADRATIC.,
|
||||
#637542843= VOLUME_3D_ELEMENT_DESCRIPTOR(.QUADRATIC_ORDER.,
|
||||
'QUADRATIC_WEDGE.CPENTA',(ENUMERATED_VOLUME_ELEMENT_PURPOSE(
|
||||
.STRESS_DISPLACEMENT.)),.WEDGE.);
|
||||
#637542845= ELEMENT_MATERIAL('MAT1.1','Fea Material',(#637542847,
|
||||
@@ -3104,7 +3104,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637539964,#637539780,#637539832,#637539836,#637539820,#637539928,
|
||||
#637539980,#637539984,#637539968,#637542834,#637542834,#637542834,
|
||||
#637542834,#637542834,#637542834),#637538282,#637543160,#637542845);
|
||||
#637543160= VOLUME_3D_ELEMENT_DESCRIPTOR(.QUADRATIC.,
|
||||
#637543160= VOLUME_3D_ELEMENT_DESCRIPTOR(.QUADRATIC_ORDER.,
|
||||
'QUADRATIC_HEXAHEDRON.CHEXA',(ENUMERATED_VOLUME_ELEMENT_PURPOSE(
|
||||
.STRESS_DISPLACEMENT.)),.HEXAHEDRON.);
|
||||
#637543162= VOLUME_3D_ELEMENT_REPRESENTATION('31',(#637542838),
|
||||
@@ -3301,7 +3301,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637542839,(#637538588,#637538612,#637538708,#637538592,#637540000,
|
||||
#637540004,#637540008,#637539988,#637539992,#637539996),#637538282,
|
||||
#637543262,#637542845);
|
||||
#637543262= VOLUME_3D_ELEMENT_DESCRIPTOR(.QUADRATIC.,
|
||||
#637543262= VOLUME_3D_ELEMENT_DESCRIPTOR(.QUADRATIC_ORDER.,
|
||||
'QUADRATIC_TETRAHEDRON.CTETRA',(ENUMERATED_VOLUME_ELEMENT_PURPOSE(
|
||||
.STRESS_DISPLACEMENT.)),.TETRAHEDRON.);
|
||||
#637543264= VOLUME_3D_ELEMENT_REPRESENTATION('34',(#637542838),
|
||||
@@ -2587,7 +2587,7 @@ SI_UNIT($,.DEGREE_CELSIUS.)THERMODYNAMIC_TEMPERATURE_UNIT());
|
||||
);
|
||||
#637542837= PARAMETRIC_REPRESENTATION_CONTEXT(
|
||||
'parametric_representation_context','parametric');
|
||||
#637542841= VOLUME_3D_ELEMENT_DESCRIPTOR(.QUADRATIC.,
|
||||
#637542841= VOLUME_3D_ELEMENT_DESCRIPTOR(.QUADRATIC_ORDER.,
|
||||
'QUADRATIC_WEDGE.CPENTA',(ENUMERATED_VOLUME_ELEMENT_PURPOSE(
|
||||
.STRESS_DISPLACEMENT.)),.WEDGE.);
|
||||
#637542843= ELEMENT_MATERIAL('MAT1.1','Fea Material',(#637542845,
|
||||
@@ -3104,7 +3104,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637539962,#637539778,#637539830,#637539834,#637539818,#637539926,
|
||||
#637539978,#637539982,#637539966,#637542832,#637542832,#637542832,
|
||||
#637542832,#637542832,#637542832),#637538280,#637543158,#637542843);
|
||||
#637543158= VOLUME_3D_ELEMENT_DESCRIPTOR(.QUADRATIC.,
|
||||
#637543158= VOLUME_3D_ELEMENT_DESCRIPTOR(.QUADRATIC_ORDER.,
|
||||
'QUADRATIC_HEXAHEDRON.CHEXA',(ENUMERATED_VOLUME_ELEMENT_PURPOSE(
|
||||
.STRESS_DISPLACEMENT.)),.HEXAHEDRON.);
|
||||
#637543160= VOLUME_3D_ELEMENT_REPRESENTATION('31',(#637542836),
|
||||
@@ -3301,7 +3301,7 @@ ISOTROPIC_SYMMETRIC_TENSOR2_3D(0.));
|
||||
#637542837,(#637538586,#637538610,#637538706,#637538590,#637539998,
|
||||
#637540002,#637540006,#637539986,#637539990,#637539994),#637538280,
|
||||
#637543260,#637542843);
|
||||
#637543260= VOLUME_3D_ELEMENT_DESCRIPTOR(.QUADRATIC.,
|
||||
#637543260= VOLUME_3D_ELEMENT_DESCRIPTOR(.QUADRATIC_ORDER.,
|
||||
'QUADRATIC_TETRAHEDRON.CTETRA',(ENUMERATED_VOLUME_ELEMENT_PURPOSE(
|
||||
.STRESS_DISPLACEMENT.)),.TETRAHEDRON.);
|
||||
#637543262= VOLUME_3D_ELEMENT_REPRESENTATION('34',(#637542836),
|
||||
@@ -2587,7 +2587,7 @@ SI_UNIT($,.DEGREE_CELSIUS.)THERMODYNAMIC_TEMPERATURE_UNIT());
|
||||
);
|
||||
#637542839= PARAMETRIC_REPRESENTATION_CONTEXT(
|
||||
'parametric_representation_context','parametric');
|
||||
#637542843= VOLUME_3D_ELEMENT_DESCRIPTOR(.QUADRATIC.,
|
||||
#637542843= VOLUME_3D_ELEMENT_DESCRIPTOR(.QUADRATIC_ORDER.,
|
||||
'QUADRATIC_WEDGE.CPENTA',(ENUMERATED_VOLUME_ELEMENT_PURPOSE(
|
||||
.STRESS_DISPLACEMENT.)),.WEDGE.);
|
||||
#637542845= ELEMENT_MATERIAL('MAT1.1','Fea Material',(#637542847,
|
||||
@@ -7728,7 +7728,7 @@ ANISOTROPIC_SYMMETRIC_TENSOR2_3D((-11.57079,-8.150762,34.35221,-7.068575
|
||||
#637539964,#637539780,#637539832,#637539836,#637539820,#637539928,
|
||||
#637539980,#637539984,#637539968,#637542834,#637542834,#637542834,
|
||||
#637542834,#637542834,#637542834),#637538282,#637546255,#637542845);
|
||||
#637546255= VOLUME_3D_ELEMENT_DESCRIPTOR(.QUADRATIC.,
|
||||
#637546255= VOLUME_3D_ELEMENT_DESCRIPTOR(.QUADRATIC_ORDER.,
|
||||
'QUADRATIC_HEXAHEDRON.CHEXA',(ENUMERATED_VOLUME_ELEMENT_PURPOSE(
|
||||
.STRESS_DISPLACEMENT.)),.HEXAHEDRON.);
|
||||
#637546257= VOLUME_3D_ELEMENT_LOCATION_POINT_VARIABLE_VALUES(#637542873,
|
||||
@@ -9927,7 +9927,7 @@ ANISOTROPIC_SYMMETRIC_TENSOR2_3D((-2814.943,159.5768,445.0004,-196.6884,
|
||||
#637542839,(#637538588,#637538612,#637538708,#637538592,#637540000,
|
||||
#637540004,#637540008,#637539988,#637539992,#637539996),#637538282,
|
||||
#637547664,#637542845);
|
||||
#637547664= VOLUME_3D_ELEMENT_DESCRIPTOR(.QUADRATIC.,
|
||||
#637547664= VOLUME_3D_ELEMENT_DESCRIPTOR(.QUADRATIC_ORDER.,
|
||||
'QUADRATIC_TETRAHEDRON.CTETRA',(ENUMERATED_VOLUME_ELEMENT_PURPOSE(
|
||||
.STRESS_DISPLACEMENT.)),.TETRAHEDRON.);
|
||||
#637547666= VOLUME_3D_ELEMENT_LOCATION_POINT_VARIABLE_VALUES(#637542873,
|
||||
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
+114
-48
@@ -1,4 +1,4 @@
|
||||
# Doxyfile 1.7.4
|
||||
# Doxyfile 1.7.6.1
|
||||
|
||||
# This file describes the settings to be used by the documentation system
|
||||
# doxygen (www.doxygen.org) for a project
|
||||
@@ -22,22 +22,23 @@
|
||||
|
||||
DOXYFILE_ENCODING = UTF-8
|
||||
|
||||
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
|
||||
# by quotes) that should identify the project.
|
||||
# The PROJECT_NAME tag is a single word (or sequence of words) that should
|
||||
# identify the project. Note that if you do not use Doxywizard you need
|
||||
# to put quotes around the project name if it contains spaces.
|
||||
|
||||
PROJECT_NAME = scl
|
||||
PROJECT_NAME = SC
|
||||
|
||||
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
|
||||
# This could be handy for archiving the generated documentation or
|
||||
# if some version control system is used.
|
||||
|
||||
PROJECT_NUMBER = 3.2
|
||||
PROJECT_NUMBER = 0.8
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# 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 = "STEPcode"
|
||||
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
|
||||
@@ -51,7 +52,7 @@ PROJECT_LOGO =
|
||||
# If a relative path is entered, it will be relative to the location
|
||||
# where doxygen was started. If left blank the current directory will be used.
|
||||
|
||||
OUTPUT_DIRECTORY = .
|
||||
OUTPUT_DIRECTORY = /mnt/raid/mark/sc-doxygen
|
||||
|
||||
# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
|
||||
# 4096 sub-directories (in 2 levels) under the output directory of each output
|
||||
@@ -204,6 +205,13 @@ TAB_SIZE = 8
|
||||
|
||||
ALIASES =
|
||||
|
||||
# This tag can be used to specify a number of word-keyword mappings (TCL only).
|
||||
# A mapping has the form "name=value". For example adding
|
||||
# "class=itcl::class" will allow you to use the command class in the
|
||||
# itcl::class meaning.
|
||||
|
||||
TCL_SUBST =
|
||||
|
||||
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
|
||||
# sources only. Doxygen will then generate output that is more tailored for C.
|
||||
# For instance, some of the names that are used will be different. The list
|
||||
@@ -293,6 +301,15 @@ SUBGROUPING = YES
|
||||
|
||||
INLINE_GROUPED_CLASSES = NO
|
||||
|
||||
# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and
|
||||
# unions with only public data fields will be shown inline in the documentation
|
||||
# of the scope in which they are defined (i.e. file, namespace, or group
|
||||
# documentation), provided this scope is documented. If set to NO (the default),
|
||||
# structs, classes, and unions are shown on a separate page (for HTML and Man
|
||||
# pages) or section (for LaTeX and RTF).
|
||||
|
||||
INLINE_SIMPLE_STRUCTS = NO
|
||||
|
||||
# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
|
||||
# is documented as struct, union, or enum with the name of the typedef. So
|
||||
# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
|
||||
@@ -315,10 +332,21 @@ TYPEDEF_HIDES_STRUCT = NO
|
||||
# a logarithmic scale so increasing the size by one will roughly double the
|
||||
# memory usage. The cache size is given by this formula:
|
||||
# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
|
||||
# corresponding to a cache size of 2^16 = 65536 symbols
|
||||
# corresponding to a cache size of 2^16 = 65536 symbols.
|
||||
|
||||
SYMBOL_CACHE_SIZE = 0
|
||||
|
||||
# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be
|
||||
# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given
|
||||
# their name and scope. Since this can be an expensive process and often the
|
||||
# same symbol appear multiple times in the code, doxygen keeps a cache of
|
||||
# pre-resolved symbols. If the cache is too small doxygen will become slower.
|
||||
# If the cache is too large, memory is wasted. The cache size is given by this
|
||||
# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0,
|
||||
# corresponding to a cache size of 2^16 = 65536 symbols.
|
||||
|
||||
LOOKUP_CACHE_SIZE = 0
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Build related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
@@ -338,7 +366,7 @@ EXTRACT_PRIVATE = NO
|
||||
# If the EXTRACT_STATIC tag is set to YES all static members of a file
|
||||
# will be included in the documentation.
|
||||
|
||||
EXTRACT_STATIC = NO
|
||||
EXTRACT_STATIC = YES
|
||||
|
||||
# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
|
||||
# defined locally in source files will be included in the documentation.
|
||||
@@ -559,6 +587,16 @@ FILE_VERSION_FILTER =
|
||||
|
||||
LAYOUT_FILE =
|
||||
|
||||
# The CITE_BIB_FILES tag can be used to specify one or more bib files
|
||||
# containing the references data. This must be a list of .bib files. The
|
||||
# .bib extension is automatically appended if omitted. Using this command
|
||||
# requires the bibtex tool to be installed. See also
|
||||
# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style
|
||||
# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this
|
||||
# feature you need bibtex and perl available in the search path.
|
||||
|
||||
CITE_BIB_FILES =
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to warning and progress messages
|
||||
#---------------------------------------------------------------------------
|
||||
@@ -621,7 +659,8 @@ WARN_LOGFILE =
|
||||
|
||||
INPUT = src \
|
||||
include \
|
||||
build/src/express
|
||||
build/src/express \
|
||||
build/include
|
||||
|
||||
# This tag can be used to specify the character encoding of the source files
|
||||
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
|
||||
@@ -677,13 +716,16 @@ FILE_PATTERNS = *.c \
|
||||
|
||||
RECURSIVE = YES
|
||||
|
||||
# The EXCLUDE tag can be used to specify files and/or directories that should
|
||||
# The EXCLUDE tag can be used to specify files and/or directories that should be
|
||||
# excluded from the INPUT source files. This way you can easily exclude a
|
||||
# subdirectory from a directory tree whose root is specified with the INPUT tag.
|
||||
# subdirectory from a directory tree whose root is specified with the INPUT tag.
|
||||
# Note that relative paths are relative to the directory from which doxygen is
|
||||
# run.
|
||||
|
||||
EXCLUDE =
|
||||
EXCLUDE = .git \
|
||||
cmake/
|
||||
|
||||
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
|
||||
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
|
||||
# directories that are symbolic links (a Unix file system feature) are excluded
|
||||
# from the input.
|
||||
|
||||
@@ -773,7 +815,7 @@ FILTER_SOURCE_PATTERNS =
|
||||
# Note: To get rid of all source code in the generated output, make sure also
|
||||
# VERBATIM_HEADERS is set to NO.
|
||||
|
||||
SOURCE_BROWSER = NO
|
||||
SOURCE_BROWSER = YES
|
||||
|
||||
# Setting the INLINE_SOURCES tag to YES will include the body
|
||||
# of functions and classes directly in the documentation.
|
||||
@@ -865,13 +907,13 @@ HTML_FILE_EXTENSION = .html
|
||||
|
||||
# The HTML_HEADER tag can be used to specify a personal HTML header for
|
||||
# each generated HTML page. If it is left blank doxygen will generate a
|
||||
# standard header. Note that when using a custom header you are responsible
|
||||
# standard header. Note that when using a custom header you are responsible
|
||||
# for the proper inclusion of any scripts and style sheets that doxygen
|
||||
# needs, which is dependent on the configuration options used.
|
||||
# It is adviced to generate a default header using "doxygen -w html
|
||||
# It is advised to generate a default header using "doxygen -w html
|
||||
# header.html footer.html stylesheet.css YourConfigFile" and then modify
|
||||
# that header. Note that the header is subject to change so you typically
|
||||
# have to redo this when upgrading to a newer version of doxygen or when
|
||||
# have to redo this when upgrading to a newer version of doxygen or when
|
||||
# changing the value of configuration settings such as GENERATE_TREEVIEW!
|
||||
|
||||
HTML_HEADER =
|
||||
@@ -887,7 +929,7 @@ HTML_FOOTER =
|
||||
# fine-tune the look of the HTML output. If the tag is left blank doxygen
|
||||
# will generate a default style sheet. Note that doxygen will try to copy
|
||||
# the style sheet file to the HTML output directory, so don't put your own
|
||||
# stylesheet in the HTML output directory as well, or it will be erased!
|
||||
# style sheet in the HTML output directory as well, or it will be erased!
|
||||
|
||||
HTML_STYLESHEET =
|
||||
|
||||
@@ -901,7 +943,7 @@ HTML_STYLESHEET =
|
||||
HTML_EXTRA_FILES =
|
||||
|
||||
# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
|
||||
# Doxygen will adjust the colors in the stylesheet and background images
|
||||
# Doxygen will adjust the colors in the style sheet and background images
|
||||
# according to this color. Hue is specified as an angle on a colorwheel,
|
||||
# see http://en.wikipedia.org/wiki/Hue for more information.
|
||||
# For instance the value 0 represents red, 60 is yellow, 120 is green,
|
||||
@@ -1096,29 +1138,33 @@ GENERATE_ECLIPSEHELP = NO
|
||||
|
||||
ECLIPSE_DOC_ID = org.doxygen.Project
|
||||
|
||||
# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
|
||||
# top of each HTML page. The value NO (the default) enables the index and
|
||||
# the value YES disables it.
|
||||
# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs)
|
||||
# at top of each HTML page. The value NO (the default) enables the index and
|
||||
# the value YES disables it. Since the tabs have the same information as the
|
||||
# navigation tree you can set this option to NO if you already set
|
||||
# GENERATE_TREEVIEW to YES.
|
||||
|
||||
DISABLE_INDEX = NO
|
||||
|
||||
# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values
|
||||
# (range [0,1..20]) that doxygen will group on one line in the generated HTML
|
||||
# documentation. Note that a value of 0 will completely suppress the enum
|
||||
# values from appearing in the overview section.
|
||||
|
||||
ENUM_VALUES_PER_LINE = 4
|
||||
|
||||
# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
|
||||
# structure should be generated to display hierarchical information.
|
||||
# If the tag value is set to YES, a side panel will be generated
|
||||
# containing a tree-like index structure (just like the one that
|
||||
# is generated for HTML Help). For this to work a browser that supports
|
||||
# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
|
||||
# Windows users are probably better off using the HTML help feature.
|
||||
# Windows users are probably better off using the HTML help feature.
|
||||
# Since the tree basically has the same information as the tab index you
|
||||
# could consider to set DISABLE_INDEX to NO when enabling this option.
|
||||
|
||||
GENERATE_TREEVIEW = YES
|
||||
|
||||
# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values
|
||||
# (range [0,1..20]) that doxygen will group on one line in the generated HTML
|
||||
# documentation. Note that a value of 0 will completely suppress the enum
|
||||
# values from appearing in the overview section.
|
||||
|
||||
ENUM_VALUES_PER_LINE = 4
|
||||
|
||||
# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
|
||||
# and Class Hierarchy pages using a tree view instead of an ordered list.
|
||||
|
||||
@@ -1171,6 +1217,11 @@ USE_MATHJAX = NO
|
||||
|
||||
MATHJAX_RELPATH = http://www.mathjax.org/mathjax
|
||||
|
||||
# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension
|
||||
# names that should be enabled during MathJax rendering.
|
||||
|
||||
MATHJAX_EXTENSIONS =
|
||||
|
||||
# When the SEARCHENGINE tag is enabled doxygen will generate a search box
|
||||
# for the HTML output. The underlying search engine uses javascript
|
||||
# and DHTML and should work on any modern browser. Note that when using
|
||||
@@ -1179,7 +1230,7 @@ MATHJAX_RELPATH = http://www.mathjax.org/mathjax
|
||||
# typically be disabled. For large projects the javascript based search engine
|
||||
# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
|
||||
|
||||
SEARCHENGINE = NO
|
||||
SEARCHENGINE = YES
|
||||
|
||||
# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
|
||||
# implemented using a PHP enabled web server instead of at the web client
|
||||
@@ -1284,6 +1335,12 @@ LATEX_HIDE_INDICES = NO
|
||||
|
||||
LATEX_SOURCE_CODE = NO
|
||||
|
||||
# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
|
||||
# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See
|
||||
# http://en.wikipedia.org/wiki/BibTeX for more info.
|
||||
|
||||
LATEX_BIB_STYLE = plain
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the RTF output
|
||||
#---------------------------------------------------------------------------
|
||||
@@ -1315,7 +1372,7 @@ COMPACT_RTF = NO
|
||||
|
||||
RTF_HYPERLINKS = NO
|
||||
|
||||
# Load stylesheet definitions from file. Syntax is similar to doxygen's
|
||||
# Load style sheet definitions from file. Syntax is similar to doxygen's
|
||||
# config file, i.e. a series of assignments. You only have to provide
|
||||
# replacements, missing definitions are set to their default value.
|
||||
|
||||
@@ -1585,32 +1642,30 @@ HAVE_DOT = YES
|
||||
|
||||
DOT_NUM_THREADS = 0
|
||||
|
||||
# By default doxygen will write a font called Helvetica to the output
|
||||
# directory and reference it in all dot files that doxygen generates.
|
||||
# When you want a differently looking font you can specify the font name
|
||||
# using DOT_FONTNAME. You need to make sure dot is able to find the font,
|
||||
# which can be done by putting it in a standard location or by setting the
|
||||
# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
|
||||
# containing the font.
|
||||
# By default doxygen will use the Helvetica font for all dot files that
|
||||
# doxygen generates. When you want a differently looking font you can specify
|
||||
# the font name using DOT_FONTNAME. You need to make sure dot is able to find
|
||||
# the font, which can be done by putting it in a standard location or by setting
|
||||
# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the
|
||||
# directory containing the font.
|
||||
|
||||
DOT_FONTNAME = FreeSans
|
||||
DOT_FONTNAME = Roboto
|
||||
|
||||
# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
|
||||
# The default size is 10pt.
|
||||
|
||||
DOT_FONTSIZE = 10
|
||||
|
||||
# By default doxygen will tell dot to use the output directory to look for the
|
||||
# FreeSans.ttf font (which doxygen will put there itself). If you specify a
|
||||
# different font using DOT_FONTNAME you can set the path where dot
|
||||
# can find it using this tag.
|
||||
# By default doxygen will tell dot to use the Helvetica font.
|
||||
# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to
|
||||
# set the path where dot can find it.
|
||||
|
||||
DOT_FONTPATH =
|
||||
|
||||
# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
|
||||
# will generate a graph for each documented class showing the direct and
|
||||
# indirect inheritance relations. Setting this tag to YES will force the
|
||||
# the CLASS_DIAGRAMS tag to NO.
|
||||
# CLASS_DIAGRAMS tag to NO.
|
||||
|
||||
CLASS_GRAPH = YES
|
||||
|
||||
@@ -1681,10 +1736,21 @@ DIRECTORY_GRAPH = YES
|
||||
|
||||
# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
|
||||
# generated by dot. Possible values are svg, png, jpg, or gif.
|
||||
# If left blank png will be used.
|
||||
# If left blank png will be used. If you choose svg you need to set
|
||||
# HTML_FILE_EXTENSION to xhtml in order to make the SVG files
|
||||
# visible in IE 9+ (other browsers do not have this requirement).
|
||||
|
||||
DOT_IMAGE_FORMAT = png
|
||||
|
||||
# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
|
||||
# enable generation of interactive SVG images that allow zooming and panning.
|
||||
# Note that this requires a modern browser other than Internet Explorer.
|
||||
# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you
|
||||
# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files
|
||||
# visible. Older versions of IE do not have SVG support.
|
||||
|
||||
INTERACTIVE_SVG = NO
|
||||
|
||||
# The tag DOT_PATH can be used to specify the path where the dot tool can be
|
||||
# found. If left blank, it is assumed the dot tool can be found in the path.
|
||||
|
||||
@@ -1735,7 +1801,7 @@ DOT_TRANSPARENT = NO
|
||||
# makes dot run faster, but since only newer versions of dot (>1.8.10)
|
||||
# support this, this feature is disabled by default.
|
||||
|
||||
DOT_MULTI_TARGETS = NO
|
||||
DOT_MULTI_TARGETS = YES
|
||||
|
||||
# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
|
||||
# generate a legend page explaining the meaning of the various boxes and
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
#
|
||||
# CMakeLists.txt for AP203 Minimum
|
||||
#
|
||||
# This file is released to the public domain. Any part of this file may be
|
||||
# freely copied in part or in full for any purpose. No acknowledgment is required
|
||||
# for the use of this file.
|
||||
#
|
||||
project(AP203Minimum)
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
INCLUDE( ExternalProject )
|
||||
|
||||
set(CMAKE_MODULE_PATH ${AP203Minimum_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
|
||||
|
||||
INCLUDE( External_STEPCode )
|
||||
|
||||
#####
|
||||
# Variables ideally set by FindSTEPCode.cmake
|
||||
|
||||
IF(NOT WIN32)
|
||||
set( STEPCODE_LIBRARIES
|
||||
${STEPCODE_INSTALL_DIR}/lib/libbase.a
|
||||
${STEPCODE_INSTALL_DIR}/lib/libstepcore.a
|
||||
${STEPCODE_INSTALL_DIR}/lib/libstepeditor.a
|
||||
${STEPCODE_INSTALL_DIR}/lib/libstepdai.a
|
||||
${STEPCODE_INSTALL_DIR}/lib/libsteputils.a
|
||||
${STEPCODE_INSTALL_DIR}/lib/libsdai_ap203.a
|
||||
)
|
||||
ELSE()
|
||||
set( STEPCODE_LIBRARIES
|
||||
${STEPCODE_INSTALL_DIR}/lib/libbase.lib
|
||||
${STEPCODE_INSTALL_DIR}/lib/libstepcore.lib
|
||||
${STEPCODE_INSTALL_DIR}/lib/libstepeditor.lib
|
||||
${STEPCODE_INSTALL_DIR}/lib/libstepdai.lib
|
||||
${STEPCODE_INSTALL_DIR}/lib/libsteputils.lib
|
||||
${STEPCODE_INSTALL_DIR}/lib/libsdai_ap203.lib
|
||||
${STEPCODE_INSTALL_DIR}/lib/libexpress.lib
|
||||
${STEPCODE_INSTALL_DIR}/lib/libexppp.lib
|
||||
shlwapi.lib
|
||||
)
|
||||
ENDIF()
|
||||
|
||||
MESSAGE( STATUS "STEPCODE_INSTALL_DIR: " ${STEPCODE_INSTALL_DIR} )
|
||||
|
||||
set( STEPCODE_INCLUDE_DIR
|
||||
${STEPCODE_INSTALL_DIR}/include/stepcode
|
||||
${STEPCODE_INSTALL_DIR}/include/stepcode/base
|
||||
${STEPCODE_INSTALL_DIR}/include/stepcode/clstepcore
|
||||
${STEPCODE_INSTALL_DIR}/include/stepcode/cldai
|
||||
${STEPCODE_INSTALL_DIR}/include/stepcode/clutils
|
||||
${STEPCODE_INSTALL_DIR}/include/stepcode/cleditor
|
||||
${STEPCODE_INSTALL_DIR}/include/schemas/sdai_ap203
|
||||
)
|
||||
|
||||
# End of variables ideally set by FindSTEPCode.cmake
|
||||
######
|
||||
|
||||
|
||||
include_directories(
|
||||
${STEPCODE_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
set(SRCS ../ap203min.cpp)
|
||||
|
||||
set(HDRS )
|
||||
|
||||
add_executable( ${PROJECT_NAME} ${SRCS} ${HDRS})
|
||||
|
||||
add_dependencies( ${PROJECT_NAME} STEPCODE )
|
||||
|
||||
target_link_libraries( ${PROJECT_NAME}
|
||||
${STEPCODE_LIBRARIES}
|
||||
)
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 8
|
||||
# mode: cmake
|
||||
# indent-tabs-mode: t
|
||||
# End:
|
||||
# ex: shiftwidth=2 tabstop=8
|
||||
@@ -0,0 +1,29 @@
|
||||
ExternalProject_Add( STEPCODE
|
||||
URL ${CMAKE_CURRENT_SOURCE_DIR}/../../..
|
||||
CMAKE_ARGS -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
||||
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
|
||||
-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
|
||||
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
|
||||
-DSC_BUILD_TYPE=Debug
|
||||
-DSC_BUILD_SCHEMAS=ap203/ap203.exp
|
||||
-DSC_BUILD_STATIC_LIBS=ON
|
||||
-DSC_PYTHON_GENERATOR=OFF
|
||||
-DSC_INSTALL_PREFIX:PATH=<INSTALL_DIR>
|
||||
)
|
||||
ExternalProject_Get_Property( STEPCODE SOURCE_DIR )
|
||||
ExternalProject_Get_Property( STEPCODE BINARY_DIR )
|
||||
ExternalProject_Get_Property( STEPCODE INSTALL_DIR )
|
||||
|
||||
IF( NOT WIN32 )
|
||||
SET( STEPCODE_INSTALL_DIR ${SOURCE_DIR}/../sc-install )
|
||||
ELSE()
|
||||
SET( STEPCODE_INSTALL_DIR ${INSTALL_DIR} )
|
||||
ENDIF()
|
||||
|
||||
SET( STEPCODE_BINARY_DIR ${BINARY_DIR} )
|
||||
|
||||
# SC CMake does not honor -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
|
||||
# Consequently, force Debug so it installs in ../sc-install directory
|
||||
# instead of /usr/local/lib.
|
||||
#
|
||||
# SC's own programs fail to build with -DSC_BUILD_SHARED_LIBS=OFF
|
||||
+14
-19
@@ -68,33 +68,28 @@ typedef struct Statement_ * Statement,
|
||||
|
||||
typedef struct Scope_ * Increment;
|
||||
|
||||
/****************/
|
||||
/* modules used */
|
||||
/****************/
|
||||
|
||||
#include "expr.h"
|
||||
#include "alg.h"
|
||||
|
||||
/***************************/
|
||||
/* hidden type definitions */
|
||||
/***************************/
|
||||
|
||||
#define STMT_ASSIGN 0x1
|
||||
#define STMT_CASE 0x2
|
||||
#define STMT_COMPOUND 0x4
|
||||
#define STMT_COND 0x8
|
||||
#define STMT_LOOP 0x10
|
||||
#define STMT_PCALL 0x20
|
||||
#define STMT_RETURN 0x40
|
||||
#define STMT_ALIAS 0x80
|
||||
#define STMT_SKIP 0x100
|
||||
#define STMT_ESCAPE 0x200
|
||||
typedef enum {
|
||||
STMT_ASSIGN = 0x1,
|
||||
STMT_CASE = 0x2,
|
||||
STMT_COMPOUND = 0x4,
|
||||
STMT_COND = 0x8,
|
||||
STMT_LOOP = 0x10,
|
||||
STMT_PCALL = 0x20,
|
||||
STMT_RETURN = 0x40,
|
||||
STMT_ALIAS = 0x80,
|
||||
STMT_SKIP = 0x100,
|
||||
STMT_ESCAPE = 0x200
|
||||
} Statement_type;
|
||||
|
||||
/* 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 */
|
||||
Statement_type type; /**< one of STMT_XXX above */
|
||||
/* hey, is there nothing in common beside symbol and private data?? */
|
||||
union u_statement {
|
||||
struct Alias_ * alias;
|
||||
@@ -234,7 +229,7 @@ extern SC_EXPRESS_EXPORT Statement CONDcreate PROTO( ( Expression, Linked_Lis
|
||||
extern SC_EXPRESS_EXPORT Statement LOOPcreate PROTO( ( struct Scope_ *, Expression, Expression, Linked_List ) );
|
||||
extern SC_EXPRESS_EXPORT Statement PCALLcreate PROTO( ( Linked_List ) );
|
||||
extern SC_EXPRESS_EXPORT Statement RETcreate PROTO( ( Expression ) );
|
||||
extern SC_EXPRESS_EXPORT void STMTinitialize PROTO( ( void ) );
|
||||
extern SC_EXPRESS_EXPORT void STMTinitialize PROTO( ( void ) );
|
||||
extern SC_EXPRESS_EXPORT struct Scope_ * INCR_CTLcreate PROTO( ( Symbol *, Expression start,
|
||||
Expression end, Expression increment ) );
|
||||
|
||||
|
||||
@@ -24,5 +24,7 @@
|
||||
#cmakedefine HAVE_SSIZE_T 1
|
||||
|
||||
#cmakedefine HAVE_STD_THREAD 1
|
||||
#cmakedefine HAVE_STD_CHRONO 1
|
||||
#cmakedefine HAVE_NULLPTR 1
|
||||
|
||||
#endif /* SCL_CF_H */
|
||||
|
||||
@@ -34,7 +34,7 @@ typedef int _Bool;
|
||||
* and version 15.00.30729.01, which comes with Visual C++ 2008, do not
|
||||
* define _Bool.
|
||||
*/
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(_MSC_VER) && _MSC_VER<1800
|
||||
typedef int _Bool;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -5,13 +5,15 @@
|
||||
|
||||
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="">
|
||||
<language name="EXPRESS" version="0.1" kateversion="2.5" section="3D" 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> xor </item>
|
||||
<item> to </item>
|
||||
<item> where </item>
|
||||
<item> unique </item>
|
||||
<item> subtype </item>
|
||||
<item> supertype </item>
|
||||
<item> abstract </item>
|
||||
|
||||
@@ -0,0 +1,330 @@
|
||||
//summarize MSVC errors from an appveyor log
|
||||
// compile with 'go build summarize-appveyor-log.go'
|
||||
// takes 0 or 1 args; with 0, gets log from latest
|
||||
// build. with 1, uses that file as raw json-like log
|
||||
package main
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"os"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
)
|
||||
|
||||
const (
|
||||
headerKey = "Authorization"
|
||||
headerVal = "Bearer %s"
|
||||
projUrl = "https://ci.appveyor.com/api/projects/mpictor/stepcode"
|
||||
//"https://ci.appveyor.com/api/buildjobs/2rjxdv1rnb8jcg8y/log"
|
||||
logUrl = "https://ci.appveyor.com/api/buildjobs/%s/log"
|
||||
consoleUrl = "https://ci.appveyor.com/api/buildjobs/%s/console"
|
||||
)
|
||||
|
||||
func main() {
|
||||
var rawlog io.ReadCloser
|
||||
var build string
|
||||
var err error
|
||||
if len(os.Args) == 2 {
|
||||
rawlog, build, err = processArgv()
|
||||
} else {
|
||||
rawlog, build, err = getLog()
|
||||
}
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "ERROR: %s\n", err)
|
||||
return
|
||||
}
|
||||
defer rawlog.Close()
|
||||
log := decodeConsole(rawlog)
|
||||
warns, errs := countMessages(log)
|
||||
fi, err := os.Create(fmt.Sprintf("appveyor-%s.smy", build))
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "ERROR: %s\n", err)
|
||||
return
|
||||
}
|
||||
printMessages("error", errs, fi)
|
||||
printMessages("warning", warns, fi)
|
||||
|
||||
fmt.Printf("done\n")
|
||||
|
||||
}
|
||||
|
||||
/* categorizes warnings and errors based upon the MSVC message number (i.e. C4244)
|
||||
* the regex will match lines like
|
||||
c:\projects\stepcode\src\base\sc_benchmark.h(45): warning C4251: 'benchmark::descr' : class 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>' needs to have dll-interface to be used by clients of class 'benchmark' [C:\projects\STEPcode\build\src\base\base.vcxproj]
|
||||
[00:03:48] C:\projects\STEPcode\src\base\sc_benchmark.cc(61): warning C4244: '=' : conversion from 'SIZE_T' to 'long', possible loss of data [C:\projects\STEPcode\build\src\base\base.vcxproj]*
|
||||
*/
|
||||
func countMessages(log []string) (warns, errs map[string][]string) {
|
||||
warns = make(map[string][]string)
|
||||
errs = make(map[string][]string)
|
||||
fname := " *(.*)" // $1
|
||||
fline := `(?:\((\d+)\)| ): ` // $2 - either line number in parenthesis or a space, followed by a colon
|
||||
msgNr := `([A-Z]+\d+): ` // $3 - C4251, LNK2005, etc
|
||||
msgTxt := `([^\[]*) ` // $4
|
||||
tail := `\[[^\[\]]*\]`
|
||||
warnRe := regexp.MustCompile(fname + fline + `warning ` + msgNr + msgTxt + tail)
|
||||
errRe := regexp.MustCompile(fname + fline + `(?:fatal )?error ` + msgNr + msgTxt + tail)
|
||||
for _, line := range log {
|
||||
if warnRe.MatchString(line) {
|
||||
key := warnRe.ReplaceAllString(line, "$3")
|
||||
path := strings.ToLower(warnRe.ReplaceAllString(line, "$1:$2"))
|
||||
arr := warns[key]
|
||||
if arr == nil {
|
||||
arr = make([]string, 5)
|
||||
//detailed text as first string in array
|
||||
text := warnRe.ReplaceAllString(line, "$4")
|
||||
arr[0] = fmt.Sprintf("%s", text)
|
||||
}
|
||||
//eliminate duplicates
|
||||
match := false
|
||||
for _, l := range arr {
|
||||
if l == path {
|
||||
match = true
|
||||
}
|
||||
}
|
||||
if !match {
|
||||
warns[key] = append(arr, path)
|
||||
}
|
||||
} else if errRe.MatchString(line) {
|
||||
key := errRe.ReplaceAllString(line, "$3")
|
||||
path := strings.ToLower(errRe.ReplaceAllString(line, "$1:$2"))
|
||||
arr := errs[key]
|
||||
if arr == nil {
|
||||
arr = make([]string, 5)
|
||||
//detailed text as first string in array
|
||||
text := errRe.ReplaceAllString(line, "$4")
|
||||
arr[0] = fmt.Sprintf("%s", text)
|
||||
}
|
||||
//eliminate duplicates
|
||||
match := false
|
||||
for _, l := range arr {
|
||||
if l == path {
|
||||
match = true
|
||||
}
|
||||
}
|
||||
if !match {
|
||||
errs[key] = append(arr, path)
|
||||
}
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func printMessages(typ string, m map[string][]string, w io.Writer) {
|
||||
//sort keys
|
||||
keys := make([]string, 0, len(m))
|
||||
for key := range m {
|
||||
keys = append(keys, key)
|
||||
}
|
||||
sort.Strings(keys)
|
||||
for _, k := range keys {
|
||||
for i, l := range m[k] {
|
||||
//first string is an example, not a location
|
||||
if i == 0 {
|
||||
fmt.Fprintf(w, "%s %s (i.e. \"%s\")\n", typ, k, l)
|
||||
} else if len(l) > 1 { //not sure where blank lines are coming from...
|
||||
fmt.Fprintf(w, " >> %s\n", l)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//structs from http://json2struct.mervine.net/
|
||||
|
||||
//{"values":[{"i":0,"t":"Specify a project or solution file. The directory does not contain a project or solution file.\r\n","dt":"00:00:04","bg":12,"fg":15}]}
|
||||
type AppVeyorConsoleLines struct {
|
||||
Values []struct {
|
||||
I int `json:"i"`
|
||||
Text string `json:"t"`
|
||||
DateTime string `json:"dt"`
|
||||
BgColor int `json:"bg"`
|
||||
FgColor int `json:"fg"`
|
||||
}
|
||||
}
|
||||
type AppVeyorBuild struct {
|
||||
Build struct {
|
||||
/*BuildNumber int `json:"buildNumber"`*/
|
||||
Version string `json:"version"`
|
||||
Jobs []struct {
|
||||
JobID string `json:"jobId"`
|
||||
} `json:"jobs"`
|
||||
} `json:"build"`
|
||||
}
|
||||
|
||||
func splitAppend(log *[]string, blob string) {
|
||||
//blob = strings.Replace(blob,"\r\n", "\n",-1)
|
||||
blob = strings.Replace(blob, "\\", "/", -1)
|
||||
r := strings.NewReader(blob)
|
||||
unwrapScanner := bufio.NewScanner(r)
|
||||
for unwrapScanner.Scan() {
|
||||
txt := unwrapScanner.Text()
|
||||
//fmt.Printf("%s\n", txt)
|
||||
*log = append(*log, txt)
|
||||
}
|
||||
}
|
||||
|
||||
//calculate length of string without escape chars
|
||||
// func escapeLen(s string)(l int) {
|
||||
// //s = strings.Replace(s,"\\\\", "/",-1)
|
||||
// s = strings.Replace(s,"\\\"", "",-1)
|
||||
// s = strings.Replace(s,"\r\n", "RN",-1)
|
||||
// return len(s)
|
||||
// }
|
||||
|
||||
|
||||
//decode the almost-JSON console data from appveyor
|
||||
func decodeConsole(r io.Reader) (log []string) {
|
||||
wrapper := Wrap(r)
|
||||
dec := json.NewDecoder(wrapper)
|
||||
var consoleLines AppVeyorConsoleLines
|
||||
var err error
|
||||
var txtBlob string
|
||||
err = dec.Decode(&consoleLines)
|
||||
if err == io.EOF {
|
||||
err = nil
|
||||
}
|
||||
if err == nil {
|
||||
for _, l := range consoleLines.Values {
|
||||
txtBlob += l.Text
|
||||
//el := escapeLen(l.Text)
|
||||
//something inserts newlines at 229 chars (+\n\r == 231) (found in CMake output)
|
||||
lenTwoThreeOne := len(l.Text) == 231
|
||||
if lenTwoThreeOne {
|
||||
txtBlob = strings.TrimSuffix(txtBlob, "\r\n")
|
||||
}
|
||||
//something else starts new log lines at 1024 chars without inserting newlines (found in CTest error output)
|
||||
if len(l.Text) != 1024 && !lenTwoThreeOne {
|
||||
//fmt.Printf("sa for l %d, el %d\n", len(l.Text),el)
|
||||
splitAppend(&log, txtBlob)
|
||||
txtBlob = ""
|
||||
}
|
||||
}
|
||||
} else {
|
||||
fmt.Printf("decode err %s\n", err)
|
||||
}
|
||||
if len(txtBlob) > 0 {
|
||||
splitAppend(&log, txtBlob)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func processArgv() (log io.ReadCloser, build string, err error) {
|
||||
fname := os.Args[1]
|
||||
if len(fname) < 14 {
|
||||
err = fmt.Errorf("Name arg '%s' too short. Run as '%s appveyor-NNN.log'", fname, os.Args[0])
|
||||
return
|
||||
}
|
||||
buildRe := regexp.MustCompile(`appveyor-(.+).log`)
|
||||
build = buildRe.ReplaceAllString(fname, "$1")
|
||||
if len(build) == 0 {
|
||||
err = fmt.Errorf("No build id in %s", fname)
|
||||
return
|
||||
}
|
||||
log, err = os.Open(fname)
|
||||
return
|
||||
}
|
||||
|
||||
func getLog() (log io.ReadCloser, build string, err error) {
|
||||
client := &http.Client{}
|
||||
req, err := http.NewRequest("GET", projUrl, nil)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
apikey := os.Getenv("APPVEYOR_API_KEY")
|
||||
//api key isn't necessary for read-only queries on public projects
|
||||
if len(apikey) > 0 {
|
||||
req.Header.Add(headerKey, fmt.Sprintf(headerVal, apikey))
|
||||
} //else {
|
||||
// fmt.Printf("Env var APPVEYOR_API_KEY is not set.")
|
||||
//}
|
||||
resp, err := client.Do(req)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
build, job := decodeProjInfo(resp.Body)
|
||||
fmt.Printf("build #%s, jobId %s\n", build, job)
|
||||
resp, err = http.Get(fmt.Sprintf(consoleUrl, job))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
logName := fmt.Sprintf("appveyor-%s.log", build)
|
||||
fi, err := os.Create(logName)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
_, err = io.Copy(fi, resp.Body)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
log, err = os.Open(logName)
|
||||
if err != nil {
|
||||
log = nil
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func decodeProjInfo(r io.Reader) (vers string, job string) {
|
||||
dec := json.NewDecoder(r)
|
||||
var av AppVeyorBuild
|
||||
err := dec.Decode(&av)
|
||||
if err != io.EOF && err != nil {
|
||||
fmt.Printf("err %s\n", err)
|
||||
return
|
||||
}
|
||||
if len(av.Build.Jobs) != 1 {
|
||||
return
|
||||
}
|
||||
vers = av.Build.Version
|
||||
job = av.Build.Jobs[0].JobID
|
||||
return
|
||||
}
|
||||
|
||||
//wrap a reader, modifying content to make the json decoder happy
|
||||
//only tested with data from appveyor console
|
||||
type jsonWrapper struct {
|
||||
source io.Reader
|
||||
begin bool
|
||||
end bool
|
||||
}
|
||||
|
||||
func Wrap(r io.Reader) *jsonWrapper {
|
||||
return &jsonWrapper{
|
||||
source: r,
|
||||
begin: true,
|
||||
}
|
||||
}
|
||||
|
||||
// func nonNeg(n int) (int) {
|
||||
// if n < 0 {
|
||||
// return 0
|
||||
// }
|
||||
// return n
|
||||
// }
|
||||
|
||||
func (w *jsonWrapper) Read(p []byte) (n int, err error) {
|
||||
if w.end {
|
||||
return 0, io.EOF
|
||||
}
|
||||
if w.begin {
|
||||
w.begin = false
|
||||
n = copy(p, []byte(`{"values":[`))
|
||||
}
|
||||
m, err := w.source.Read(p[n:])
|
||||
n += m
|
||||
if err == io.EOF {
|
||||
w.end = true
|
||||
if n < len(p) {
|
||||
n = copy(p, []byte(`{"dummy":"data"}]}`))
|
||||
} else {
|
||||
err = fmt.Errorf("No room to terminate JSON struct with '}'\n")
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// kate: indent-width 8; space-indent off; replace-tabs off; replace-tabs-save off; replace-trailing-space-save on; remove-trailing-space on; tab-intent on; tab-width 8; show-tabs off;
|
||||
+14
-1
@@ -5,6 +5,8 @@ set(SC_BASE_SOURCES
|
||||
sc_getopt.cc
|
||||
sc_benchmark.cc
|
||||
sc_mkdir.c
|
||||
path2str.c
|
||||
judy/src/judy.c
|
||||
)
|
||||
|
||||
set(SC_BASE_HDRS
|
||||
@@ -12,10 +14,21 @@ set(SC_BASE_HDRS
|
||||
sc_memmgr.h
|
||||
sc_getopt.h
|
||||
sc_trace_fprintf.h
|
||||
sc_stdbool.h
|
||||
sc_mkdir.h
|
||||
sc_nullptr.h
|
||||
path2str.h
|
||||
judy/src/judy.h
|
||||
judy/src/judyLArray.h
|
||||
judy/src/judyL2Array.h
|
||||
judy/src/judySArray.h
|
||||
judy/src/judyS2Array.h
|
||||
)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/judy/src
|
||||
)
|
||||
|
||||
if(MINGW OR MSVC OR BORLAND)
|
||||
add_definitions(-DSC_BASE_DLL_EXPORTS)
|
||||
endif()
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
#ifndef GDB_SCRIPT_AUTOLOAD_H
|
||||
#define GDB_SCRIPT_AUTOLOAD_H
|
||||
|
||||
|
||||
// https://sourceware.org/gdb/onlinedocs/gdb/dotdebug_005fgdb_005fscripts-section.html, section 23.4.2.1 Script File Entries
|
||||
|
||||
/* Embed a section that tells gdb to auto-load a python script.
|
||||
* In spite of sourceware documentation to the contrary, it appears that gdb
|
||||
* only tries the file name as absolute path and as something relative to the
|
||||
* CWD - thus, script_name is practically useless if it isn't an absolute path.
|
||||
*
|
||||
* Note: The "MS" section flags are to remove duplicates. */
|
||||
#define DEFINE_GDB_PY_SCRIPT(script_name) \
|
||||
asm("\
|
||||
.pushsection \".debug_gdb_scripts\", \"MS\",@progbits,1\n\
|
||||
.byte 1 /* Python */\n\
|
||||
.asciz \"" script_name "\"\n\
|
||||
.popsection \n\
|
||||
");
|
||||
|
||||
#endif //GDB_SCRIPT_AUTOLOAD_H
|
||||
@@ -62,10 +62,11 @@
|
||||
|
||||
#include "judy.h"
|
||||
|
||||
#if defined(STANDALONE) || defined(ASKITIS)
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#if defined(STANDALONE) || defined(ASKITIS)
|
||||
|
||||
extern unsigned int MaxMem;
|
||||
|
||||
// void judy_abort (char *msg) __attribute__ ((noreturn)); // Tell static analyser that this function will not return
|
||||
|
||||
@@ -166,7 +166,7 @@ class judyL2Array {
|
||||
kv.value = *_lastSlot;
|
||||
_success = true;
|
||||
} else {
|
||||
kv.value = ( JudyValue ) 0;
|
||||
kv.value = NULL;
|
||||
_success = false;
|
||||
}
|
||||
kv.key = _buff[0];
|
||||
|
||||
@@ -191,7 +191,7 @@ class judyS2Array {
|
||||
kv.value = *_lastSlot;
|
||||
_success = true;
|
||||
} else {
|
||||
kv.value = ( JudyValue ) 0;
|
||||
kv.value = NULL;
|
||||
_success = false;
|
||||
}
|
||||
kv.key = _buff;
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
|
||||
#include "path2str.h"
|
||||
#include "sc_memmgr.h"
|
||||
#include <string.h>
|
||||
|
||||
/* for windows, rewrite backslashes in paths
|
||||
* that will be written to generated code
|
||||
*/
|
||||
const char * path2str_fn( const char * fileMacro ) {
|
||||
static char * result = 0;
|
||||
static size_t rlen = 0;
|
||||
char * p;
|
||||
if( rlen < strlen( fileMacro ) ) {
|
||||
if( result ) {
|
||||
sc_free( result );
|
||||
}
|
||||
rlen = strlen( fileMacro );
|
||||
result = ( char * )sc_malloc( rlen * sizeof( char ) + 1 );
|
||||
}
|
||||
strcpy( result, fileMacro );
|
||||
p = result;
|
||||
while( *p ) {
|
||||
if( *p == '\\' ) {
|
||||
*p = '/';
|
||||
}
|
||||
p++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
#ifndef PATH2STR_H
|
||||
#define PATH2STR_H
|
||||
|
||||
#include <sc_export.h>
|
||||
|
||||
/** windows only: rewrite backslashes in paths as forward slashes
|
||||
* call as path2str(__FILE__) to take advantage of macro
|
||||
*
|
||||
* silence "unknown escape sequence" warning when contents of __FILE__
|
||||
* are fprintf'd into string in generated code
|
||||
*/
|
||||
SC_BASE_EXPORT const char * path2str_fn( const char * fileMacro );
|
||||
|
||||
#if defined( _WIN32 ) || defined ( __WIN32__ )
|
||||
# define path2str(path) path2str_fn(path)
|
||||
#else
|
||||
# define path2str(path) path
|
||||
#endif /* defined( _WIN32 ) || defined ( __WIN32__ ) */
|
||||
|
||||
#endif /* PATH2STR_H */
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include <iostream>
|
||||
#include <iosfwd>
|
||||
#include <string>
|
||||
|
||||
#include "sc_memmgr.h"
|
||||
|
||||
+31
-31
@@ -51,8 +51,8 @@
|
||||
// SYNOPSIS
|
||||
// int sc_getopt(int argc, char *argv[], char *optstring)
|
||||
//
|
||||
// extern char *optarg;
|
||||
// extern int optind;
|
||||
// extern char *sc_optarg;
|
||||
// extern int sc_optind;
|
||||
//
|
||||
// DESCRIPTION
|
||||
// The sc_getopt() function parses the command line arguments. Its
|
||||
@@ -67,21 +67,21 @@
|
||||
//
|
||||
// optstring is a string of recognized option letters; if a letter
|
||||
// is followed by a colon, the option is expected to have an argument
|
||||
// that may or may not be separated from it by white space. optarg
|
||||
// that may or may not be separated from it by white space. sc_optarg
|
||||
// is set to point to the start of the option argument on return from
|
||||
// sc_getopt.
|
||||
//
|
||||
// Option letters may be combined, e.g., "-ab" is equivalent to
|
||||
// "-a -b". Option letters are case sensitive.
|
||||
//
|
||||
// sc_getopt places in the external variable optind the argv index
|
||||
// of the next argument to be processed. optind is initialized
|
||||
// sc_getopt places in the external variable sc_optind the argv index
|
||||
// of the next argument to be processed. sc_optind is initialized
|
||||
// to 0 before the first call to sc_getopt.
|
||||
//
|
||||
// When all options have been processed (i.e., up to the first
|
||||
// non-option argument), sc_getopt returns EOF, optarg will point
|
||||
// to the argument, and optind will be set to the argv index of
|
||||
// the argument. If there are no non-option arguments, optarg
|
||||
// non-option argument), sc_getopt returns EOF, sc_optarg will point
|
||||
// to the argument, and sc_optind will be set to the argv index of
|
||||
// the argument. If there are no non-option arguments, sc_optarg
|
||||
// will be set to NULL.
|
||||
//
|
||||
// The special option "--" may be used to delimit the end of the
|
||||
@@ -127,14 +127,14 @@
|
||||
// break;
|
||||
//
|
||||
// case _T('n'):
|
||||
// TRACE(_T("option n: value=%d\n"), atoi(optarg));
|
||||
// TRACE(_T("option n: value=%d\n"), atoi(sc_optarg));
|
||||
// //
|
||||
// // do something with value here
|
||||
// //
|
||||
// break;
|
||||
//
|
||||
// case _T('?'):
|
||||
// TRACE(_T("ERROR: illegal option %s\n"), argv[optind-1]);
|
||||
// TRACE(_T("ERROR: illegal option %s\n"), argv[sc_optind-1]);
|
||||
// return FALSE;
|
||||
// break;
|
||||
//
|
||||
@@ -152,42 +152,42 @@
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
char * optarg; // global argument pointer
|
||||
int optind = 0; // global argv index
|
||||
char * sc_optarg; // global argument pointer
|
||||
int sc_optind = 0; // global argv index
|
||||
|
||||
int sc_getopt( int argc, char * argv[], char * optstring ) {
|
||||
static char * next = NULL;
|
||||
if( optind == 0 ) {
|
||||
if( sc_optind == 0 ) {
|
||||
next = NULL;
|
||||
}
|
||||
|
||||
optarg = NULL;
|
||||
sc_optarg = NULL;
|
||||
|
||||
if( next == NULL || *next == '\0' ) {
|
||||
if( optind == 0 ) {
|
||||
optind++;
|
||||
if( sc_optind == 0 ) {
|
||||
sc_optind++;
|
||||
}
|
||||
|
||||
if( optind >= argc || argv[optind][0] != '-' || argv[optind][1] == '\0' ) {
|
||||
optarg = NULL;
|
||||
if( optind < argc ) {
|
||||
optarg = argv[optind];
|
||||
if( sc_optind >= argc || argv[sc_optind][0] != '-' || argv[sc_optind][1] == '\0' ) {
|
||||
sc_optarg = NULL;
|
||||
if( sc_optind < argc ) {
|
||||
sc_optarg = argv[sc_optind];
|
||||
}
|
||||
return EOF;
|
||||
}
|
||||
|
||||
if( strcmp( argv[optind], "--" ) == 0 ) {
|
||||
optind++;
|
||||
optarg = NULL;
|
||||
if( optind < argc ) {
|
||||
optarg = argv[optind];
|
||||
if( strcmp( argv[sc_optind], "--" ) == 0 ) {
|
||||
sc_optind++;
|
||||
sc_optarg = NULL;
|
||||
if( sc_optind < argc ) {
|
||||
sc_optarg = argv[sc_optind];
|
||||
}
|
||||
return EOF;
|
||||
}
|
||||
|
||||
next = argv[optind];
|
||||
next = argv[sc_optind];
|
||||
next++; // skip past -
|
||||
optind++;
|
||||
sc_optind++;
|
||||
}
|
||||
|
||||
char c = *next++;
|
||||
@@ -200,11 +200,11 @@ int sc_getopt( int argc, char * argv[], char * optstring ) {
|
||||
cp++;
|
||||
if( *cp == ':' ) {
|
||||
if( *next != '\0' ) {
|
||||
optarg = next;
|
||||
sc_optarg = next;
|
||||
next = NULL;
|
||||
} else if( optind < argc ) {
|
||||
optarg = argv[optind];
|
||||
optind++;
|
||||
} else if( sc_optind < argc ) {
|
||||
sc_optarg = argv[sc_optind];
|
||||
sc_optind++;
|
||||
} else {
|
||||
return '?';
|
||||
}
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern SC_BASE_EXPORT int optind, opterr;
|
||||
extern SC_BASE_EXPORT char * optarg;
|
||||
extern SC_BASE_EXPORT int sc_optind, sc_opterr;
|
||||
extern SC_BASE_EXPORT char * sc_optarg;
|
||||
|
||||
int SC_BASE_EXPORT sc_getopt( int argc, char * argv[], char * optstring );
|
||||
|
||||
|
||||
@@ -168,7 +168,7 @@ sc_memmgr::~sc_memmgr( void ) {
|
||||
// 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( "sc_memmgr warning: Possible memory leaks detected (%d of %d bytes)\n", _allocated_total - _deallocated_total, _allocated_total );
|
||||
fprintf( stderr, "sc_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.
|
||||
@@ -193,7 +193,7 @@ sc_memmgr::~sc_memmgr( void ) {
|
||||
ierror != errors.end();
|
||||
ierror ++ ) {
|
||||
// todo: generate error for memory leak
|
||||
printf( "sc_memmgr warning: Possible memory leak in %s line %d\n", ierror->getsrcfile().c_str(), ierror->getsrcline() );
|
||||
fprintf( stderr, "sc_memmgr warning: Possible memory leak in %s line %d\n", ierror->getsrcfile().c_str(), ierror->getsrcline() );
|
||||
}
|
||||
|
||||
// Clear remaining records
|
||||
@@ -211,7 +211,7 @@ void * sc_memmgr::allocate( size_t size, const char * file, const int line ) {
|
||||
addr = malloc( size );
|
||||
if( addr == NULL ) {
|
||||
// todo: error allocation failed
|
||||
printf( "sc_memmgr error: Memory allocation failed in %s line %d\n", file, line );
|
||||
fprintf( stderr, "sc_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
|
||||
@@ -246,7 +246,7 @@ void * sc_memmgr::reallocate( void * addr, size_t size, const char * file, const
|
||||
record = _records.find( sc_memmgr_record( addr ) );
|
||||
if( record == _records.end() ) {
|
||||
// todo: error reallocating memory not allocated?
|
||||
printf( "sc_memmgr warning: Reallocation of not allocated memory at %s line %d\n", file, line );
|
||||
fprintf( stderr, "sc_memmgr warning: Reallocation of not allocated memory at %s line %d\n", file, line );
|
||||
} else {
|
||||
// Update stats
|
||||
_allocated -= record->getsize();
|
||||
@@ -264,7 +264,7 @@ void * sc_memmgr::reallocate( void * addr, size_t size, const char * file, const
|
||||
addr = realloc( addr, size );
|
||||
if( addr == NULL ) {
|
||||
// todo: error reallocation failed
|
||||
printf( "sc_memmgr error: Reallocation failed at %s line %d\n", file, line );
|
||||
fprintf( stderr, "sc_memmgr error: Reallocation failed at %s line %d\n", file, line );
|
||||
}
|
||||
|
||||
#ifdef SC_MEMMGR_ENABLE_CHECKS
|
||||
@@ -296,7 +296,7 @@ void sc_memmgr::deallocate( void * addr, const char * file, const int line ) {
|
||||
record = _records.find( sc_memmgr_record( addr ) );
|
||||
if( record == _records.end() ) {
|
||||
// todo: error free called for not allocated memory?
|
||||
printf( "sc_memmgr warning: Deallocate of not allocated memory at %s line %d\n", file, line );
|
||||
fprintf( stderr, "sc_memmgr warning: Deallocate of not allocated memory at %s line %d\n", file, line );
|
||||
} else {
|
||||
// Update stats
|
||||
_allocated -= record->getsize();
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
#ifndef NULLPTR_H
|
||||
#define NULLPTR_H
|
||||
|
||||
#include <sc_cf.h>
|
||||
|
||||
#ifdef HAVE_NULLPTR
|
||||
#include <cstddef>
|
||||
#else
|
||||
# define nullptr_t void*
|
||||
# define nullptr NULL
|
||||
#endif //HAVE_NULLPTR
|
||||
|
||||
#endif //NULLPTR_H
|
||||
@@ -1,12 +0,0 @@
|
||||
#ifndef SC_STDBOOL_H
|
||||
#define SC_STDBOOL_H
|
||||
|
||||
#ifdef _WIN32
|
||||
typedef int bool;
|
||||
# define false 0
|
||||
# define true 1
|
||||
#else
|
||||
# include <stdbool.h>
|
||||
#endif
|
||||
|
||||
#endif /* SC_STDBOOL_H */
|
||||
@@ -9,17 +9,17 @@
|
||||
*
|
||||
* This header must be included *after* all other headers, otherwise the compiler will
|
||||
* report errors in system headers.
|
||||
* \sa trace_fprintf
|
||||
* \sa trace_fprintf()
|
||||
**/
|
||||
|
||||
#include "sc_export.h"
|
||||
|
||||
/** used to find where generated c++ originates from in exp2cxx
|
||||
* To enable, configure with 'cmake .. -DSC_TRACE_FPRINTF=ON'
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
/** Used to find where generated c++ originates from in exp2cxx.
|
||||
* To enable, configure with 'cmake .. -DSC_TRACE_FPRINTF=ON'
|
||||
*/
|
||||
SC_BASE_EXPORT void trace_fprintf( char const * sourcefile, int line, FILE * file, const char * format, ... );
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
#include <math.h>
|
||||
#include "sc_memmgr.h"
|
||||
|
||||
#include "sdaiApplication_instance.h"
|
||||
|
||||
// to help ObjectCenter
|
||||
#ifndef HAVE_MEMMOVE
|
||||
extern "C"
|
||||
|
||||
@@ -9,17 +9,11 @@
|
||||
|
||||
typedef char * SDAI_DAObjectID;
|
||||
|
||||
// interface PID (ISO/DIS 10303-23:1996(E) 5.3.10.1)
|
||||
// Also, CORBA POS specification, Section 5.4
|
||||
//
|
||||
// The PID class maintains the persistent object identifier for every
|
||||
// persistent object, objects of class DAObject, and objects of any class
|
||||
// derived directly or indirectly from DAObject.
|
||||
//
|
||||
// POS: The PID identifies one or more locations within a Datastore that
|
||||
// represent the persistent data of an object and generates a string
|
||||
// identifier for that data. An object must have a PID in order to store
|
||||
// its data persistently.
|
||||
//
|
||||
/*
|
||||
The EXPRESS ENTITY application_instance from the SDAI_data_type_schema from
|
||||
@@ -29,7 +23,7 @@ typedef char * SDAI_DAObjectID;
|
||||
The class DAObject is supported by the classes PID, PID_SDAI and the type
|
||||
SDAI_DAObjectID as follows:
|
||||
*/
|
||||
|
||||
/// interface PID (ISO/DIS 10303-23:1996(E) 5.3.10.1)
|
||||
class SC_DAI_EXPORT SDAI_PID : public SDAI_sdaiObject {
|
||||
public:
|
||||
|
||||
@@ -67,8 +61,6 @@ typedef SDAI_PID * SDAI_PID_ptr;
|
||||
typedef SDAI_PID_ptr SDAI_PID_var;
|
||||
|
||||
|
||||
// interface PID_DA (ISO/DIS 10303-23:1996(E) 5.3.10.3)
|
||||
// Also, CORBA POS specification, Direct Access Protocol, Section 5.10.1
|
||||
//
|
||||
// The Direct Access Protocol supports direct access to persistent data
|
||||
// through typed attributes organized in data objects that are defined
|
||||
@@ -88,7 +80,7 @@ typedef SDAI_PID_ptr SDAI_PID_var;
|
||||
// may be accessed through this extension to the CosPersistencePID
|
||||
// interface.
|
||||
//
|
||||
|
||||
/// interface PID_DA (ISO/DIS 10303-23:1996(E) 5.3.10.3)
|
||||
class SC_DAI_EXPORT SDAI_PID_DA: public SDAI_PID {
|
||||
public:
|
||||
|
||||
@@ -120,11 +112,11 @@ class SC_DAI_EXPORT SDAI_PID_DA: public SDAI_PID {
|
||||
typedef SDAI_PID_DA * SDAI_PID_DA_ptr;
|
||||
typedef SDAI_PID_DA_ptr SDAI_PID_DA_var;
|
||||
|
||||
// interface PID_SDAI (ISO/DIS 10303-23:1996(E) 5.3.10.2)
|
||||
//
|
||||
// The PID_SDAI class maintains the persistent object identifier for
|
||||
// a Model_contents object.
|
||||
//
|
||||
/// interface PID_SDAI (ISO/DIS 10303-23:1996(E) 5.3.10.2)
|
||||
class SC_DAI_EXPORT SDAI_PID_SDAI : public SDAI_PID {
|
||||
public:
|
||||
SDAI_String _modelid;
|
||||
@@ -150,8 +142,6 @@ class SC_DAI_EXPORT SDAI_PID_SDAI : public SDAI_PID {
|
||||
typedef SDAI_PID_SDAI * SDAI_PID_SDAI_ptr;
|
||||
typedef SDAI_PID_SDAI_ptr SDAI_PID_SDAI_var;
|
||||
|
||||
// interface DAObject (ISO/DIS 10303-23:1996(E) 5.3.10.5)
|
||||
// Also, CORBA POS Section 5.10.2, Direct Access Protocol.
|
||||
//
|
||||
// From POS: The DAObject interface provides operations that many data
|
||||
// object clients need. A Datastore implementation may provide support
|
||||
@@ -166,6 +156,7 @@ class SDAI_DAObject;
|
||||
typedef SDAI_DAObject * SDAI_DAObject_ptr;
|
||||
typedef SDAI_DAObject_ptr SDAI_DAObject_var;
|
||||
|
||||
/// interface DAObject (ISO/DIS 10303-23:1996(E) 5.3.10.5)
|
||||
class SC_DAI_EXPORT SDAI_DAObject : public SDAI_sdaiObject {
|
||||
public:
|
||||
|
||||
@@ -262,7 +253,7 @@ class SC_DAI_EXPORT SDAI_DAObject : public SDAI_sdaiObject {
|
||||
void dado_free() { }
|
||||
};
|
||||
|
||||
/*
|
||||
/**
|
||||
5.3.10.1 DAObject_SDAI
|
||||
*/
|
||||
|
||||
|
||||
@@ -357,6 +357,7 @@ int SDAI_Enum::put( const char * n ) {
|
||||
}
|
||||
|
||||
/// return 0 if unset otherwise return 1
|
||||
/// WARNING it appears that exists() will return true after a call to nullify(). is this intended?
|
||||
int SDAI_Enum::exists() const {
|
||||
return !( v > no_elements() );
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <sc_export.h>
|
||||
|
||||
class SC_DAI_EXPORT SDAI_Enum {
|
||||
@@ -27,7 +28,7 @@ class SC_DAI_EXPORT SDAI_Enum {
|
||||
public:
|
||||
virtual ~SDAI_Enum() {};
|
||||
|
||||
void PrintContents( ostream & out = cout ) const {
|
||||
void PrintContents( ostream & out = std::cout ) const {
|
||||
DebugDisplay( out );
|
||||
}
|
||||
|
||||
@@ -51,7 +52,7 @@ class SC_DAI_EXPORT SDAI_Enum {
|
||||
}
|
||||
|
||||
const char * asStr( std::string & s ) const;
|
||||
void STEPwrite( ostream & out = cout ) const;
|
||||
void STEPwrite( ostream & out = std::cout ) const;
|
||||
const char * STEPwrite( std::string & s ) const;
|
||||
|
||||
Severity StrToVal( const char * s, ErrorDescriptor * err, int optional = 1 );
|
||||
@@ -60,8 +61,8 @@ class SC_DAI_EXPORT SDAI_Enum {
|
||||
|
||||
virtual int put( int val );
|
||||
virtual int put( const char * n );
|
||||
int is_null() const {
|
||||
return !( exists() );
|
||||
bool is_null() const {
|
||||
return ( exists() == 0 );
|
||||
}
|
||||
void set_null() {
|
||||
nullify();
|
||||
@@ -69,9 +70,11 @@ class SC_DAI_EXPORT SDAI_Enum {
|
||||
SDAI_Enum & operator= ( const int );
|
||||
SDAI_Enum & operator= ( const SDAI_Enum & );
|
||||
|
||||
/// WARNING it appears that exists() will return true after a call to nullify(). is this intended?
|
||||
///FIXME need to rewrite this function, but strange implementation...
|
||||
virtual int exists() const;
|
||||
virtual void nullify();
|
||||
void DebugDisplay( ostream & out = cout ) const;
|
||||
void DebugDisplay( ostream & out = std::cout ) const;
|
||||
|
||||
protected:
|
||||
virtual Severity ReadEnum( istream & in, ErrorDescriptor * err,
|
||||
|
||||
@@ -198,14 +198,14 @@ Severity STEPfile::ReadHeader( istream & in ) {
|
||||
} else { //not ENTITY_NULL
|
||||
//read the header instance
|
||||
|
||||
//check obj's Error Descriptor
|
||||
objsev = AppendEntityErrorMsg( &( obj->Error() ) );
|
||||
AppendEntityErrorMsg( &( obj->Error() ) );
|
||||
|
||||
//set file_id to reflect the appropriate Header Section Entity
|
||||
fileid = HeaderId( const_cast<char *>( keywd.c_str() ) );
|
||||
|
||||
//read the values from the istream
|
||||
objsev = obj->STEPread( fileid, 0, ( InstMgr * )0, in, NULL, true, _strict );
|
||||
_error.GreaterSeverity( objsev );
|
||||
if( !cmtStr.empty() ) {
|
||||
obj->PrependP21Comment( cmtStr );
|
||||
}
|
||||
@@ -1307,7 +1307,7 @@ SDAI_Application_instance * STEPfile::ReadInstance( istream & in, ostream & out,
|
||||
case SEVERITY_BUG:
|
||||
|
||||
case SEVERITY_INCOMPLETE:
|
||||
if( ( _fileType == VERSION_CURRENT ) ) {
|
||||
if( _fileType == VERSION_CURRENT ) {
|
||||
cerr << "ERROR in EXCHANGE FILE: incomplete instance #"
|
||||
<< obj -> STEPfile_id << ".\n";
|
||||
if( _fileType != WORKING_SESSION ) {
|
||||
|
||||
@@ -6,9 +6,6 @@ set( clLazyFile_SRCS
|
||||
p21HeaderSectionReader.cc
|
||||
sectionReader.cc
|
||||
lazyP21DataSectionReader.cc
|
||||
../base/judy/src/judy.c
|
||||
../base/judy/src/judyLArray.h
|
||||
../base/judy/src/judySArray.h
|
||||
)
|
||||
|
||||
set( SC_CLLAZYFILE_HDRS
|
||||
@@ -33,11 +30,11 @@ include_directories(
|
||||
${SC_SOURCE_DIR}/src/base/judy/src
|
||||
)
|
||||
|
||||
SC_ADDLIB(steplazyfile "${clLazyFile_SRCS};${clLazyFile_HDRS}" "stepcore;stepdai;steputils;base")
|
||||
SC_ADDEXEC(lazy_test "lazy_test.cc" "steplazyfile;stepeditor" )
|
||||
set_target_properties(lazy_test PROPERTIES COMPILE_FLAGS "-DNO_REGISTRY" )
|
||||
SC_ADDLIB(steplazyfile "${clLazyFile_SRCS};${clLazyFile_HDRS}" "stepcore;stepdai;steputils;base;stepeditor")
|
||||
SC_ADDEXEC(lazy_test "lazy_test.cc" "steplazyfile;stepeditor" NO_INSTALL)
|
||||
set_property(TARGET lazy_test APPEND PROPERTY COMPILE_DEFINITIONS "NO_REGISTRY")
|
||||
if(TARGET lazy_test-static)
|
||||
set_target_properties(lazy_test-static PROPERTIES COMPILE_FLAGS "-DNO_REGISTRY" )
|
||||
set_property(TARGET lazy_test-static APPEND PROPERTY COMPILE_DEFINITIONS "NO_REGISTRY")
|
||||
endif(TARGET lazy_test-static)
|
||||
|
||||
install(FILES ${SC_CLLAZYFILE_HDRS}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
#ifndef INSTMGRHELPER_H
|
||||
#define INSTMGRHELPER_H
|
||||
|
||||
#include <sc_export.h>
|
||||
|
||||
#include <mgrnode.h>
|
||||
#include <lazyInstMgr.h>
|
||||
#include <instmgr.h>
|
||||
|
||||
@@ -14,7 +17,7 @@
|
||||
* This class is used when creating SDAI_Application_instance's and using a lazyInstMgr. It is returned
|
||||
* by instMgrAdapter. SDAI_Application_instance only uses the GetSTEPentity function.
|
||||
*/
|
||||
class mgrNodeHelper: public MgrNodeBase {
|
||||
class SC_LAZYFILE_EXPORT mgrNodeHelper: public MgrNodeBase {
|
||||
protected:
|
||||
lazyInstMgr * _lim;
|
||||
instanceID _id;
|
||||
@@ -40,7 +43,7 @@ class mgrNodeHelper: public MgrNodeBase {
|
||||
* when an instance is looked up, this uses lazyInstMgr to load it, and then returns a pointer to it.
|
||||
*/
|
||||
|
||||
class instMgrAdapter: public InstMgrBase {
|
||||
class SC_LAZYFILE_EXPORT instMgrAdapter: public InstMgrBase {
|
||||
protected:
|
||||
mgrNodeHelper _mn;
|
||||
public:
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* \sa lazyP21DataSectionReader
|
||||
* \sa lazyP28DataSectionReader
|
||||
*/
|
||||
class lazyDataSectionReader: public sectionReader {
|
||||
class SC_LAZYFILE_EXPORT lazyDataSectionReader: public sectionReader {
|
||||
protected:
|
||||
bool _error, _completelyLoaded;
|
||||
std::string _sectionIdentifier;
|
||||
|
||||
@@ -50,7 +50,7 @@ instancesLoaded_t * lazyFileReader::getHeaderInstances() {
|
||||
}
|
||||
|
||||
lazyFileReader::lazyFileReader( std::string fname, lazyInstMgr * i, fileID fid ): _fileName( fname ), _parent( i ), _fileID( fid ) {
|
||||
_file.open( _fileName.c_str() );
|
||||
_file.open( _fileName.c_str(), std::ios::binary );
|
||||
_file.imbue( std::locale::classic() );
|
||||
_file.unsetf( std::ios_base::skipws );
|
||||
assert( _file.is_open() && _file.good() );
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#include "instMgrHelper.h"
|
||||
#include "lazyRefs.h"
|
||||
|
||||
#include "sdaiApplication_instance.h"
|
||||
|
||||
lazyInstMgr::lazyInstMgr() {
|
||||
_headerRegistry = new Registry( HeaderSchemaInit );
|
||||
_instanceTypes = new instanceTypes_t( 255 ); //NOTE arbitrary max of 255 chars for a type name
|
||||
@@ -137,7 +139,7 @@ SDAI_Application_instance * lazyInstMgr::loadInstance( instanceID id, bool reSee
|
||||
std::cerr << "Instance #" << id << " exists in multiple sections. This is not yet supported." << std::endl;
|
||||
break;
|
||||
}
|
||||
if( ( inst ) && ( inst != & NilSTEPentity ) ) {
|
||||
if( !isNilSTEPentity( inst ) ) {
|
||||
_instancesLoaded.insert( id, inst );
|
||||
_loadedInstanceCount++;
|
||||
lazyRefs lr( this, inst );
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
#include "Registry.h"
|
||||
#include "sc_memmgr.h"
|
||||
#include "sc_export.h"
|
||||
|
||||
#include "judyLArray.h"
|
||||
#include "judySArray.h"
|
||||
@@ -20,7 +21,7 @@
|
||||
class Registry;
|
||||
class instMgrAdapter;
|
||||
|
||||
class lazyInstMgr {
|
||||
class SC_LAZYFILE_EXPORT lazyInstMgr {
|
||||
protected:
|
||||
/** multimap from instance number to instances that it refers to
|
||||
* \sa instanceRefs_pair
|
||||
@@ -72,8 +73,8 @@ class lazyInstMgr {
|
||||
void openFile( std::string fname );
|
||||
|
||||
void addLazyInstance( namedLazyInstance inst );
|
||||
instMgrAdapter * getAdapter() {
|
||||
return _ima;
|
||||
InstMgrBase * getAdapter() {
|
||||
return ( InstMgrBase * ) _ima;
|
||||
}
|
||||
|
||||
instanceRefs_t * getFwdRefs() {
|
||||
|
||||
@@ -6,14 +6,19 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "sc_export.h"
|
||||
#include "lazyTypes.h"
|
||||
#include "lazyInstMgr.h"
|
||||
#include "ExpDict.h"
|
||||
#include "sdaiApplication_instance.h"
|
||||
#include "SubSuperIterators.h"
|
||||
#include <STEPattribute.h>
|
||||
#include <STEPaggregate.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#define strcasecmp _strcmpi
|
||||
#endif // _WIN32
|
||||
|
||||
class SDAI_Application_instance;
|
||||
/*
|
||||
* given inverted attr ia:
|
||||
* attr method value
|
||||
@@ -48,7 +53,7 @@
|
||||
//TODO what about complex instances? scanning each on disk could be a bitch; should the compositional types be scanned during lazy loading?
|
||||
|
||||
//TODO/FIXME in generated code, store ia data in map and eliminate data members that are currently used. modify accessors to use map.
|
||||
class lazyRefs {
|
||||
class SC_LAZYFILE_EXPORT lazyRefs {
|
||||
public:
|
||||
typedef std::set< instanceID > referentInstances_t;
|
||||
protected:
|
||||
@@ -103,7 +108,7 @@ class lazyRefs {
|
||||
if( !ai ) {
|
||||
ias.i = rinst;
|
||||
_inst->setInvAttr( ia, ias );
|
||||
} else if( ai->GetFileId() != inst ) {
|
||||
} else if( ai->GetFileId() != (int)inst ) {
|
||||
std::cerr << "ERROR: two instances (" << rinst << ", #" << rinst->GetFileId() << "=" << rinst->getEDesc()->Name();
|
||||
std::cerr << " and " << ai << ", #" << ai->GetFileId() <<"=" << ai->getEDesc()->Name() << ") refer to inst ";
|
||||
std::cerr << _inst->GetFileId() << ", but its inverse attribute is not an aggregation type!" << std::endl;
|
||||
@@ -126,7 +131,7 @@ class lazyRefs {
|
||||
bool found = false;
|
||||
if( sa.getADesc()->IsAggrType() ) {
|
||||
//aggregate - search for current inst id
|
||||
EntityAggregate * aggr = dynamic_cast< EntityAggregate * >( sa.Aggregate());
|
||||
EntityAggregate * aggr = dynamic_cast< EntityAggregate * >( sa.Aggregate() );
|
||||
assert( aggr );
|
||||
EntityNode * en = ( EntityNode * ) aggr->GetHead();
|
||||
while( en ) {
|
||||
@@ -174,7 +179,7 @@ class lazyRefs {
|
||||
}
|
||||
std::cerr << "Error! inverse attr " << ia->Name() << " (" << ia << ") not found in iAMap for entity " << inst->getEDesc()->Name() << std::endl;
|
||||
abort();
|
||||
iAstruct nil;
|
||||
iAstruct nil = {nullptr};
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#include "lazyFileReader.h"
|
||||
#include "lazyInstMgr.h"
|
||||
#include "lazyTypes.h"
|
||||
#include "instMgrHelper.h"
|
||||
|
||||
#include "current_function.hpp"
|
||||
|
||||
@@ -48,7 +47,7 @@ std::streampos sectionReader::findNormalString( const std::string & str, bool se
|
||||
}
|
||||
if( c == '\'' ) {
|
||||
//push past string
|
||||
_file.unget();
|
||||
_file.seekg( _file.tellg() - std::streampos(1) );
|
||||
GetLiteralStr( _file, _lazyFile->getInstMgr()->getErrorDesc() );
|
||||
}
|
||||
if( ( c == '/' ) && ( _file.peek() == '*' ) ) {
|
||||
@@ -130,7 +129,7 @@ std::streampos sectionReader::seekInstanceEnd( instanceRefs ** refs ) {
|
||||
}
|
||||
break;
|
||||
case '\'':
|
||||
_file.unget();
|
||||
_file.seekg( _file.tellg() - std::streampos(1) );
|
||||
GetLiteralStr( _file, _lazyFile->getInstMgr()->getErrorDesc() );
|
||||
break;
|
||||
case '=':
|
||||
@@ -156,7 +155,7 @@ std::streampos sectionReader::seekInstanceEnd( instanceRefs ** refs ) {
|
||||
if( _file.get() == ';' ) {
|
||||
return _file.tellg();
|
||||
} else {
|
||||
_file.unget();
|
||||
_file.seekg( _file.tellg() - std::streampos(1) );
|
||||
}
|
||||
}
|
||||
default:
|
||||
@@ -187,7 +186,7 @@ instanceID sectionReader::readInstanceNumber() {
|
||||
if( ( c == '/' ) && ( _file.peek() == '*' ) ) {
|
||||
findNormalString( "*/" );
|
||||
} else {
|
||||
_file.unget();
|
||||
_file.seekg( _file.tellg() - std::streampos(1) );
|
||||
}
|
||||
skipWS();
|
||||
c = _file.get();
|
||||
@@ -200,7 +199,7 @@ instanceID sectionReader::readInstanceNumber() {
|
||||
assert( std::numeric_limits<instanceID>::max() <= std::numeric_limits<unsigned long long int>::max() );
|
||||
|
||||
size_t instanceIDLength = std::numeric_limits<instanceID>::digits10 + 1;
|
||||
char * buffer = new char( instanceIDLength + 1 ); // +1 for the terminating character
|
||||
char * buffer = new char[ instanceIDLength + 1 ]; // +1 for the terminating character
|
||||
|
||||
std::stringstream errorMsg;
|
||||
|
||||
@@ -211,7 +210,7 @@ instanceID sectionReader::readInstanceNumber() {
|
||||
digits++;
|
||||
|
||||
} else {
|
||||
_file.unget();
|
||||
_file.seekg( _file.tellg() - std::streampos(1) );
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -243,7 +242,7 @@ instanceID sectionReader::readInstanceNumber() {
|
||||
|
||||
assert( id > 0 );
|
||||
}
|
||||
delete buffer;
|
||||
delete [] buffer;
|
||||
return id;
|
||||
}
|
||||
|
||||
@@ -303,15 +302,14 @@ SDAI_Application_instance * sectionReader::getRealInstance( const Registry * reg
|
||||
inst = reg->ObjCreate( tName, sName );
|
||||
break;
|
||||
}
|
||||
|
||||
if( inst != & NilSTEPentity ) {
|
||||
if( !isNilSTEPentity( inst ) ) {
|
||||
if( !comment.empty() ) {
|
||||
inst->AddP21Comment( comment );
|
||||
}
|
||||
assert( inst->getEDesc() );
|
||||
_file.seekg( begin );
|
||||
findNormalString( "(" );
|
||||
_file.unget();
|
||||
_file.seekg( _file.tellg() - std::streampos(1) );
|
||||
sev = inst->STEPread( instance, 0, _lazyFile->getInstMgr()->getAdapter(), _file, sName, true, false );
|
||||
//TODO do something with 'sev'
|
||||
inst->InitIAttrs();
|
||||
@@ -319,7 +317,7 @@ SDAI_Application_instance * sectionReader::getRealInstance( const Registry * reg
|
||||
return inst;
|
||||
}
|
||||
|
||||
STEPcomplex * sectionReader::CreateSubSuperInstance( const Registry * reg, instanceID fileid, Severity & sev ) {
|
||||
STEPcomplex * sectionReader::CreateSubSuperInstance( const Registry * reg, instanceID fileid, Severity & ) {
|
||||
std::string buf;
|
||||
ErrorDescriptor err;
|
||||
std::vector<std::string *> typeNames;
|
||||
|
||||
+101
-40
@@ -1,66 +1,127 @@
|
||||
|
||||
set(LIBSTEPCORE_SRCS
|
||||
sdaiApplication_instance.cc
|
||||
STEPcomplex.cc
|
||||
STEPaggregate.cc
|
||||
STEPattribute.cc
|
||||
STEPattribute.inline.cc
|
||||
STEPattributeList.cc
|
||||
STEPinvAttrList.cc
|
||||
STEPundefined.cc
|
||||
sdai.cc
|
||||
sdaiSelect.cc
|
||||
SingleLinkList.cc
|
||||
SingleLinkList.inline.cc
|
||||
Registry.inline.cc
|
||||
ExpDict.cc
|
||||
ExpDict.inline.cc
|
||||
read_func.cc
|
||||
aggrTypeDescriptor.cc
|
||||
attrDescriptor.cc
|
||||
attrDescriptorList.cc
|
||||
collect.cc
|
||||
complexlist.cc
|
||||
create_Aggr.cc
|
||||
derivedAttribute.cc
|
||||
dictSchema.cc
|
||||
dispnode.cc
|
||||
dispnodelist.cc
|
||||
entityDescriptor.cc
|
||||
entityDescriptorList.cc
|
||||
entlist.cc
|
||||
multlist.cc
|
||||
orlist.cc
|
||||
entnode.cc
|
||||
non-ors.cc
|
||||
match-ors.cc
|
||||
trynext.cc
|
||||
print.cc
|
||||
enumTypeDescriptor.cc
|
||||
explicitItemId.cc
|
||||
globalRule.cc
|
||||
implicitItemId.cc
|
||||
instmgr.cc
|
||||
interfaceSpec.cc
|
||||
interfacedItem.cc
|
||||
inverseAttribute.cc
|
||||
inverseAttributeList.cc
|
||||
match-ors.cc
|
||||
mgrnode.cc
|
||||
mgrnodearray.cc
|
||||
mgrnodelist.cc
|
||||
dispnode.cc
|
||||
dispnodelist.cc
|
||||
multlist.cc
|
||||
needFunc.cc
|
||||
)
|
||||
non-ors.cc
|
||||
orlist.cc
|
||||
print.cc
|
||||
read_func.cc
|
||||
Registry.cc
|
||||
schRename.cc
|
||||
sdai.cc
|
||||
sdaiApplication_instance.cc
|
||||
sdaiSelect.cc
|
||||
selectTypeDescriptor.cc
|
||||
SingleLinkList.cc
|
||||
STEPaggregate.cc
|
||||
STEPaggrBinary.cc
|
||||
STEPaggrEntity.cc
|
||||
STEPaggrEnum.cc
|
||||
STEPaggrGeneric.cc
|
||||
STEPaggrInt.cc
|
||||
STEPaggrReal.cc
|
||||
STEPaggrSelect.cc
|
||||
STEPaggrString.cc
|
||||
STEPattribute.cc
|
||||
STEPattributeList.cc
|
||||
STEPcomplex.cc
|
||||
STEPinvAttrList.cc
|
||||
STEPundefined.cc
|
||||
trynext.cc
|
||||
typeDescriptor.cc
|
||||
typeDescriptorList.cc
|
||||
typeOrRuleVar.cc
|
||||
uniquenessRule.cc
|
||||
whereRule.cc
|
||||
)
|
||||
|
||||
set(SC_CLSTEPCORE_HDRS
|
||||
aggrTypeDescriptor.h
|
||||
attrDescriptor.h
|
||||
attrDescriptorList.h
|
||||
baseType.h
|
||||
complexSupport.h
|
||||
create_Aggr.h
|
||||
derivedAttribute.h
|
||||
dictSchema.h
|
||||
dictdefs.h
|
||||
dictionaryInstance.h
|
||||
dispnode.h
|
||||
dispnodelist.h
|
||||
entityDescriptor.h
|
||||
entityDescriptorList.h
|
||||
enumTypeDescriptor.h
|
||||
ExpDict.h
|
||||
read_func.h
|
||||
Registry.h
|
||||
sdaiApplication_instance.h
|
||||
sdai.h
|
||||
sdaiSelect.h
|
||||
SingleLinkList.h
|
||||
STEPaggregate.h
|
||||
STEPattribute.h
|
||||
STEPattributeList.h
|
||||
STEPinvAttrList.h
|
||||
STEPcomplex.h
|
||||
STEPundefined.h
|
||||
explicitItemId.h
|
||||
globalRule.h
|
||||
implicitItemId.h
|
||||
instmgr.h
|
||||
interfaceSpec.h
|
||||
interfacedItem.h
|
||||
inverseAttribute.h
|
||||
inverseAttributeList.h
|
||||
mgrnode.h
|
||||
mgrnodearray.h
|
||||
mgrnodelist.h
|
||||
dispnode.h
|
||||
dispnodelist.h
|
||||
needFunc.h
|
||||
read_func.h
|
||||
realTypeDescriptor.h
|
||||
Registry.h
|
||||
schRename.h
|
||||
sdai.h
|
||||
sdaiApplication_instance.h
|
||||
sdaiSelect.h
|
||||
selectTypeDescriptor.h
|
||||
SingleLinkList.h
|
||||
STEPaggregate.h
|
||||
STEPaggrBinary.h
|
||||
STEPaggrEntity.h
|
||||
STEPaggrEnum.h
|
||||
STEPaggrGeneric.h
|
||||
STEPaggrInt.h
|
||||
STEPaggrReal.h
|
||||
STEPaggrSelect.h
|
||||
STEPaggrString.h
|
||||
STEPattribute.h
|
||||
STEPattributeList.h
|
||||
STEPcomplex.h
|
||||
STEPinvAttrList.h
|
||||
STEPundefined.h
|
||||
stringTypeDescriptor.h
|
||||
SubSuperIterators.h
|
||||
)
|
||||
typeDescriptor.h
|
||||
typeDescriptorList.h
|
||||
typeOrRuleVar.h
|
||||
uniquenessRule.h
|
||||
whereRule.h
|
||||
)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
|
||||
+8
-1838
File diff suppressed because it is too large
Load Diff
+45
-1986
File diff suppressed because it is too large
Load Diff
@@ -1,414 +0,0 @@
|
||||
|
||||
/*
|
||||
* NIST STEP Core Class Library
|
||||
* clstepcore/ExpDict.inline.cc
|
||||
* April 1997
|
||||
* K. C. Morris
|
||||
* David Sauder
|
||||
|
||||
* Development of this software was funded by the United States Government,
|
||||
* and is not subject to copyright.
|
||||
*/
|
||||
|
||||
#include <ExpDict.h>
|
||||
#include "sc_memmgr.h"
|
||||
|
||||
Dictionary_instance::~Dictionary_instance() {
|
||||
}
|
||||
|
||||
|
||||
Schema::Schema( const char * schemaName )
|
||||
: _use_interface_list( new Interface_spec__set ),
|
||||
_ref_interface_list( new Interface_spec__set ),
|
||||
_function_list( 0 ), _procedure_list( 0 ), _global_rules( 0 ) {
|
||||
_name = schemaName;
|
||||
}
|
||||
|
||||
Schema::~Schema() {
|
||||
TypeDescLinkNode * node;
|
||||
|
||||
if( _use_interface_list != 0 ) {
|
||||
delete _use_interface_list;
|
||||
}
|
||||
if( _ref_interface_list != 0 ) {
|
||||
delete _ref_interface_list;
|
||||
}
|
||||
if( _global_rules != 0 ) {
|
||||
delete _global_rules;
|
||||
}
|
||||
node = ( TypeDescLinkNode * ) _unnamed_typeList.GetHead();
|
||||
while( node ) {
|
||||
delete node->TypeDesc();
|
||||
node = ( TypeDescLinkNode * ) node->NextNode();
|
||||
}
|
||||
}
|
||||
|
||||
Interfaced_item::Interfaced_item() {
|
||||
}
|
||||
|
||||
Interfaced_item::Interfaced_item( const Interfaced_item & ii ): Dictionary_instance() {
|
||||
_foreign_schema = ii._foreign_schema;
|
||||
}
|
||||
|
||||
Interfaced_item::Interfaced_item( const char * foreign_schema )
|
||||
: _foreign_schema( foreign_schema ) {
|
||||
}
|
||||
|
||||
Interfaced_item::~Interfaced_item() {
|
||||
}
|
||||
|
||||
const Express_id Interfaced_item::foreign_schema_() {
|
||||
return _foreign_schema;
|
||||
}
|
||||
|
||||
void Interfaced_item::foreign_schema_( const Express_id & fs ) {
|
||||
_foreign_schema = fs;
|
||||
}
|
||||
|
||||
Explicit_item_id::Explicit_item_id() {
|
||||
_local_definition = 0;
|
||||
}
|
||||
|
||||
Explicit_item_id::Explicit_item_id( const Explicit_item_id & eii )
|
||||
: Interfaced_item( eii ) {
|
||||
_local_definition = eii._local_definition;
|
||||
_original_id = eii._original_id;
|
||||
_new_id = eii._new_id;
|
||||
}
|
||||
|
||||
Explicit_item_id::~Explicit_item_id() {
|
||||
_local_definition = 0;
|
||||
}
|
||||
|
||||
Used_item::~Used_item() {
|
||||
}
|
||||
|
||||
Referenced_item::~Referenced_item() {
|
||||
}
|
||||
|
||||
Implicit_item_id::Implicit_item_id() {
|
||||
_local_definition = 0;
|
||||
}
|
||||
|
||||
Implicit_item_id::Implicit_item_id( Implicit_item_id & iii )
|
||||
: Interfaced_item( iii ) {
|
||||
_local_definition = iii._local_definition;
|
||||
}
|
||||
|
||||
Implicit_item_id::~Implicit_item_id() {
|
||||
_local_definition = 0;
|
||||
}
|
||||
|
||||
EntityDescLinkNode::EntityDescLinkNode() {
|
||||
_entityDesc = 0;
|
||||
}
|
||||
|
||||
EntityDescLinkNode::~EntityDescLinkNode() {
|
||||
}
|
||||
|
||||
EntityDescriptorList::EntityDescriptorList() {
|
||||
}
|
||||
|
||||
EntityDescriptorList::~EntityDescriptorList() {
|
||||
}
|
||||
|
||||
EntityDescItr::EntityDescItr( const EntityDescriptorList & edList ) : edl( edList ) {
|
||||
cur = ( EntityDescLinkNode * )( edl.GetHead() );
|
||||
}
|
||||
EntityDescItr::~EntityDescItr() {
|
||||
}
|
||||
|
||||
AttrDescLinkNode::AttrDescLinkNode() {
|
||||
_attrDesc = 0;
|
||||
}
|
||||
|
||||
AttrDescLinkNode::~AttrDescLinkNode() {
|
||||
if( _attrDesc ) {
|
||||
delete _attrDesc;
|
||||
}
|
||||
}
|
||||
|
||||
AttrDescItr::AttrDescItr( const AttrDescriptorList & adList ) : adl( adList ) {
|
||||
cur = ( AttrDescLinkNode * )( adl.GetHead() );
|
||||
}
|
||||
|
||||
AttrDescItr::~AttrDescItr() {
|
||||
}
|
||||
|
||||
Inverse_attributeLinkNode::Inverse_attributeLinkNode() {
|
||||
_invAttr = 0;
|
||||
}
|
||||
|
||||
Inverse_attributeLinkNode::~Inverse_attributeLinkNode() {
|
||||
}
|
||||
|
||||
Inverse_attributeList::Inverse_attributeList() {
|
||||
}
|
||||
|
||||
Inverse_attributeList::~Inverse_attributeList() {
|
||||
Inverse_attributeLinkNode * node;
|
||||
|
||||
node = ( Inverse_attributeLinkNode * ) head;
|
||||
while( node ) {
|
||||
delete node->Inverse_attr();
|
||||
node = ( Inverse_attributeLinkNode * ) node->NextNode();
|
||||
}
|
||||
}
|
||||
|
||||
Inverse_attributeLinkNode * Inverse_attributeList::AddNode( Inverse_attribute * ad ) {
|
||||
Inverse_attributeLinkNode * node = ( Inverse_attributeLinkNode * ) NewNode();
|
||||
node->Inverse_attr( ad );
|
||||
SingleLinkList::AppendNode( node );
|
||||
return node;
|
||||
}
|
||||
|
||||
InverseAItr::InverseAItr( const Inverse_attributeList * iaList )
|
||||
: ial( iaList ) {
|
||||
cur = ( Inverse_attributeLinkNode * )( ial->GetHead() );
|
||||
}
|
||||
|
||||
InverseAItr::~InverseAItr() {
|
||||
}
|
||||
|
||||
TypeDescLinkNode::TypeDescLinkNode() {
|
||||
_typeDesc = 0;
|
||||
}
|
||||
|
||||
TypeDescLinkNode::~TypeDescLinkNode() {
|
||||
}
|
||||
|
||||
TypeDescriptorList::TypeDescriptorList() {
|
||||
}
|
||||
|
||||
TypeDescriptorList::~TypeDescriptorList() {
|
||||
}
|
||||
|
||||
TypeDescItr::TypeDescItr( const TypeDescriptorList & tdList ) : tdl( tdList ) {
|
||||
cur = ( TypeDescLinkNode * )( tdl.GetHead() );
|
||||
}
|
||||
|
||||
TypeDescItr::~TypeDescItr() {
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// TypeDescriptor functions
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
AttrDescriptorList::AttrDescriptorList() {
|
||||
}
|
||||
|
||||
AttrDescriptorList::~AttrDescriptorList() {
|
||||
}
|
||||
|
||||
AttrDescLinkNode *
|
||||
AttrDescriptorList::AddNode( AttrDescriptor * ad ) {
|
||||
AttrDescLinkNode * node = ( AttrDescLinkNode * ) NewNode();
|
||||
node->AttrDesc( ad );
|
||||
SingleLinkList::AppendNode( node );
|
||||
return node;
|
||||
}
|
||||
|
||||
TypeDescriptor::TypeDescriptor( )
|
||||
: _name( 0 ), altNames( 0 ), _fundamentalType( UNKNOWN_TYPE ),
|
||||
_originatingSchema( 0 ), _referentType( 0 ), _description( 0 ), _where_rules( 0 ) {
|
||||
}
|
||||
|
||||
TypeDescriptor::TypeDescriptor
|
||||
( const char * nm, PrimitiveType ft, Schema * origSchema,
|
||||
const char * d )
|
||||
: _name( nm ), altNames( 0 ), _fundamentalType( ft ),
|
||||
_originatingSchema( origSchema ), _referentType( 0 ), _description( d ),
|
||||
_where_rules( 0 ) {
|
||||
}
|
||||
|
||||
TypeDescriptor::~TypeDescriptor() {
|
||||
if( _where_rules ) {
|
||||
delete _where_rules;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines the current name of this. Normally, this is simply _name.
|
||||
* If "schnm" is set to a value, however, then this function becomes a
|
||||
* request for our name when referenced by schnm. (This will be diff from
|
||||
* our original name if schnm USEs or REFERENCEs us and renames us (e.g.,
|
||||
* "USE (xx as yy)").) In such a case, this function searches through our
|
||||
* altNames list to see if schema schnm refers to us with a different name
|
||||
* and returns the new name if found. (See header comments to function
|
||||
* SchRename::rename().)
|
||||
*/
|
||||
const char * TypeDescriptor::Name( const char * schnm ) const {
|
||||
if( schnm == NULL ) {
|
||||
return _name;
|
||||
}
|
||||
if( altNames && altNames->rename( schnm, ( char * )_altname ) ) {
|
||||
// If our altNames list has an alternate for schnm, copy it into
|
||||
// _altname, and return it:
|
||||
return _altname;
|
||||
}
|
||||
return _name;
|
||||
}
|
||||
|
||||
const char * TypeDescriptor::BaseTypeName() const {
|
||||
return BaseTypeDescriptor() ? BaseTypeDescriptor() -> Name() : 0;
|
||||
}
|
||||
|
||||
const TypeDescriptor * TypeDescriptor::BaseTypeIsA( const TypeDescriptor * td ) const {
|
||||
switch( NonRefType() ) {
|
||||
case AGGREGATE_TYPE:
|
||||
return AggrElemTypeDescriptor() -> IsA( td );
|
||||
case ENTITY_TYPE:
|
||||
case SELECT_TYPE:
|
||||
default:
|
||||
return IsA( td );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if our "current" name = other. CurrName may be different from
|
||||
* _name if schNm tells us the current schema is a different one from the
|
||||
* one in which we're defined. If so, we may have an alternate name for
|
||||
* that schema (it may be listed in our altNames list). This would be the
|
||||
* case if schNm USEs or REFERENCEs type and renames it in the process
|
||||
* (e.g., "USE (X as Y)".
|
||||
*/
|
||||
bool TypeDescriptor::CurrName( const char * other, const char * schNm ) const {
|
||||
if( !schNm || *schNm == '\0' ) {
|
||||
// If there's no current schema, accept any possible name of this.
|
||||
// (I.e., accept its actual name or any substitute):
|
||||
return ( PossName( other ) );
|
||||
}
|
||||
if( altNames && altNames->rename( schNm, ( char * )_altname ) ) {
|
||||
// If we have a different name when the current schema = schNm, then
|
||||
// other better = the alt name.
|
||||
return ( !StrCmpIns( _altname, other ) );
|
||||
} else {
|
||||
// If we have no desginated alternate name when the current schema =
|
||||
// schNm, other must = our _name.
|
||||
return ( OurName( other ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* return true if nm is either our name or one of the possible alternates.
|
||||
*/
|
||||
bool TypeDescriptor::PossName( const char * nm ) const {
|
||||
return ( OurName( nm ) || AltName( nm ) );
|
||||
}
|
||||
|
||||
bool TypeDescriptor::OurName( const char * nm ) const {
|
||||
return !StrCmpIns( nm, _name );
|
||||
}
|
||||
|
||||
bool TypeDescriptor::AltName( const char * nm ) const {
|
||||
if( altNames ) {
|
||||
return ( altNames->choice( nm ) );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a SchRename consisting of schnm & newnm. Places it in alphabe-
|
||||
* tical order in this's altNames list.
|
||||
*/
|
||||
void TypeDescriptor::addAltName( const char * schnm, const char * newnm ) {
|
||||
SchRename * newpair = new SchRename( schnm, newnm ),
|
||||
*node = ( SchRename * )altNames, *prev = NULL;
|
||||
|
||||
while( node && *node < *newpair ) {
|
||||
prev = node;
|
||||
node = node->next;
|
||||
}
|
||||
newpair->next = node; // node may = NULL
|
||||
if( prev ) {
|
||||
// Will be the case if new node should not be first (and above while
|
||||
// loop was entered).
|
||||
prev->next = newpair;
|
||||
} else {
|
||||
// put newpair first
|
||||
altNames = newpair;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* See if nm = one of our choices (either ours or that of a SchRename
|
||||
* later in the list.
|
||||
*/
|
||||
bool SchRename::choice( const char * nm ) const {
|
||||
if( !StrCmpIns( nm, newName ) ) {
|
||||
return true;
|
||||
}
|
||||
if( next ) {
|
||||
return ( next->choice( nm ) );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if this SchRename represents the rename of its owning TypeDesc for
|
||||
* schema schnm. (This will be the case if schnm = schName.) If so, the
|
||||
* new name is returned and copied into newnm. If not, ::rename is called
|
||||
* on next. Thus, this function will tell us if this or any later SchRe-
|
||||
* name in this list provide a new name for TypeDesc for schema schnm.
|
||||
*/
|
||||
char * SchRename::rename( const char * schnm, char * newnm ) const {
|
||||
if( !StrCmpIns( schnm, schName ) ) {
|
||||
strcpy( newnm, newName );
|
||||
return newnm;
|
||||
}
|
||||
if( next ) {
|
||||
return ( next->rename( schnm, newnm ) );
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// AttrDescriptor functions
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
AttrDescriptor::AttrDescriptor( const char * name, const TypeDescriptor * domainType,
|
||||
Logical optional, Logical unique, AttrType_Enum at,
|
||||
const EntityDescriptor & owner )
|
||||
: _name( name ), _domainType( domainType ), _optional( optional ),
|
||||
_unique( unique ), _attrType( at ), _owner( ( EntityDescriptor & )owner ) {
|
||||
}
|
||||
|
||||
AttrDescriptor::~AttrDescriptor() {
|
||||
}
|
||||
|
||||
Logical AttrDescriptor::Explicit() const {
|
||||
if( _attrType == AttrType_Explicit ) {
|
||||
return LTrue;
|
||||
}
|
||||
return LFalse;
|
||||
}
|
||||
|
||||
Logical AttrDescriptor::Inverse() const {
|
||||
if( _attrType == AttrType_Inverse ) {
|
||||
return LTrue;
|
||||
}
|
||||
return LFalse;
|
||||
}
|
||||
|
||||
Logical AttrDescriptor::Redefining() const {
|
||||
if( _attrType == AttrType_Redefining ) {
|
||||
return LTrue;
|
||||
}
|
||||
return LFalse;
|
||||
}
|
||||
|
||||
Logical AttrDescriptor::Deriving() const {
|
||||
if( _attrType == AttrType_Deriving ) {
|
||||
return LTrue;
|
||||
}
|
||||
return LFalse;
|
||||
}
|
||||
|
||||
Derived_attribute::Derived_attribute( const char * name, const TypeDescriptor * domainType,
|
||||
Logical optional, Logical unique, AttrType_Enum at, const EntityDescriptor & owner )
|
||||
: AttrDescriptor( name, domainType, optional, unique, at, owner ) {
|
||||
_initializer = ( const char * )0;
|
||||
}
|
||||
|
||||
Derived_attribute::~Derived_attribute() {
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* NIST STEP Core Class Library
|
||||
* clstepcore/Registry.inline.cc
|
||||
* clstepcore/Registry.cc
|
||||
* April 1997
|
||||
* K. C. Morris
|
||||
* David Sauder
|
||||
@@ -13,13 +13,15 @@
|
||||
#include <Registry.h>
|
||||
#include "sc_memmgr.h"
|
||||
|
||||
const TypeDescriptor * t_sdaiINTEGER = NULL;
|
||||
const TypeDescriptor * t_sdaiREAL = NULL;
|
||||
const TypeDescriptor * t_sdaiNUMBER = NULL;
|
||||
const TypeDescriptor * t_sdaiSTRING = NULL;
|
||||
const TypeDescriptor * t_sdaiBINARY = NULL;
|
||||
const TypeDescriptor * t_sdaiBOOLEAN = NULL;
|
||||
const TypeDescriptor * t_sdaiLOGICAL = NULL;
|
||||
/* these may be shared between multiple Registry instances, so don't create/destroy in Registry ctor/dtor
|
||||
* Name, FundamentalType, Originating Schema, Description */
|
||||
const TypeDescriptor * const t_sdaiINTEGER = new TypeDescriptor( "INTEGER", sdaiINTEGER, 0, "INTEGER" );
|
||||
const TypeDescriptor * const t_sdaiREAL = new TypeDescriptor( "REAL", sdaiREAL, 0, "Real" );
|
||||
const TypeDescriptor * const t_sdaiNUMBER = new TypeDescriptor( "NUMBER", sdaiNUMBER, 0, "Number" );
|
||||
const TypeDescriptor * const t_sdaiSTRING = new TypeDescriptor( "STRING", sdaiSTRING, 0, "String" );
|
||||
const TypeDescriptor * const t_sdaiBINARY = new TypeDescriptor( "BINARY", sdaiBINARY, 0, "Binary" );
|
||||
const TypeDescriptor * const t_sdaiBOOLEAN = new TypeDescriptor( "BOOLEAN", sdaiBOOLEAN, 0, "Boolean" );
|
||||
const TypeDescriptor * const t_sdaiLOGICAL = new TypeDescriptor( "LOGICAL", sdaiLOGICAL, 0, "Logical" );
|
||||
|
||||
static int uniqueNames( const char *, const SchRename * );
|
||||
|
||||
@@ -30,43 +32,6 @@ Registry::Registry( CF_init initFunct )
|
||||
active_schemas = SC_HASHcreate( 10 );
|
||||
active_types = SC_HASHcreate( 100 );
|
||||
|
||||
if( !t_sdaiINTEGER ) {
|
||||
t_sdaiINTEGER = new TypeDescriptor( "INTEGER", // Name
|
||||
sdaiINTEGER, // FundamentalType
|
||||
0, // Originating Schema
|
||||
"INTEGER" ); // Description;
|
||||
}
|
||||
if( !t_sdaiREAL ) {
|
||||
t_sdaiREAL = new TypeDescriptor( "REAL", sdaiREAL,
|
||||
0, // Originating Schema
|
||||
"Real" );
|
||||
}
|
||||
if( !t_sdaiSTRING ) {
|
||||
t_sdaiSTRING = new TypeDescriptor( "STRING", sdaiSTRING,
|
||||
0, // Originating Schema
|
||||
"String" );
|
||||
}
|
||||
if( !t_sdaiBINARY ) {
|
||||
t_sdaiBINARY = new TypeDescriptor( "BINARY", sdaiBINARY,
|
||||
0, // Originating Schema
|
||||
"Binary" );
|
||||
}
|
||||
if( !t_sdaiBOOLEAN ) {
|
||||
t_sdaiBOOLEAN = new TypeDescriptor( "BOOLEAN", sdaiBOOLEAN,
|
||||
0, // Originating Schema
|
||||
"Boolean" );
|
||||
}
|
||||
if( !t_sdaiLOGICAL ) {
|
||||
t_sdaiLOGICAL = new TypeDescriptor( "LOGICAL", sdaiLOGICAL,
|
||||
0, // Originating Schema
|
||||
"Logical" );
|
||||
}
|
||||
if( !t_sdaiNUMBER ) {
|
||||
t_sdaiNUMBER = new TypeDescriptor( "NUMBER", sdaiNUMBER,
|
||||
0, // Originating Schema
|
||||
"Number" );
|
||||
}
|
||||
|
||||
initFunct( *this );
|
||||
SC_HASHlistinit( active_types, &cur_type );
|
||||
SC_HASHlistinit( primordialSwamp, &cur_entity ); // initialize cur's
|
||||
@@ -80,35 +45,6 @@ Registry::~Registry() {
|
||||
SC_HASHdestroy( active_schemas );
|
||||
SC_HASHdestroy( active_types );
|
||||
delete col;
|
||||
|
||||
if( t_sdaiINTEGER ) {
|
||||
delete t_sdaiINTEGER;
|
||||
t_sdaiINTEGER = NULL;
|
||||
}
|
||||
if( t_sdaiREAL ) {
|
||||
delete t_sdaiREAL;
|
||||
t_sdaiREAL = NULL;
|
||||
}
|
||||
if( t_sdaiSTRING ) {
|
||||
delete t_sdaiSTRING;
|
||||
t_sdaiSTRING = NULL;
|
||||
}
|
||||
if( t_sdaiBINARY ) {
|
||||
delete t_sdaiBINARY;
|
||||
t_sdaiBINARY = NULL;
|
||||
}
|
||||
if( t_sdaiBOOLEAN ) {
|
||||
delete t_sdaiBOOLEAN;
|
||||
t_sdaiBOOLEAN = NULL;
|
||||
}
|
||||
if( t_sdaiLOGICAL ) {
|
||||
delete t_sdaiLOGICAL;
|
||||
t_sdaiLOGICAL = NULL;
|
||||
}
|
||||
if( t_sdaiNUMBER ) {
|
||||
delete t_sdaiNUMBER;
|
||||
t_sdaiNUMBER = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void Registry::DeleteContents() {
|
||||
@@ -19,6 +19,16 @@
|
||||
#include <Str.h>
|
||||
#include <complexSupport.h>
|
||||
|
||||
|
||||
// defined and created in Registry.cc
|
||||
extern SC_CORE_EXPORT const TypeDescriptor * const t_sdaiINTEGER;
|
||||
extern SC_CORE_EXPORT const TypeDescriptor * const t_sdaiREAL;
|
||||
extern SC_CORE_EXPORT const TypeDescriptor * const t_sdaiNUMBER;
|
||||
extern SC_CORE_EXPORT const TypeDescriptor * const t_sdaiSTRING;
|
||||
extern SC_CORE_EXPORT const TypeDescriptor * const t_sdaiBINARY;
|
||||
extern SC_CORE_EXPORT const TypeDescriptor * const t_sdaiBOOLEAN;
|
||||
extern SC_CORE_EXPORT const TypeDescriptor * const t_sdaiLOGICAL;
|
||||
|
||||
typedef struct Hash_Table * HashTable;
|
||||
|
||||
class Registry;
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
#include "STEPaggrBinary.h"
|
||||
#include <sstream>
|
||||
|
||||
/** \file STEPaggrBinary.cc
|
||||
* implement classes BinaryAggregate, BinaryNode
|
||||
*/
|
||||
|
||||
|
||||
BinaryAggregate::BinaryAggregate() {
|
||||
}
|
||||
|
||||
BinaryAggregate::~BinaryAggregate() {
|
||||
}
|
||||
|
||||
STEPaggregate & BinaryAggregate::ShallowCopy( const STEPaggregate & a ) {
|
||||
Empty();
|
||||
|
||||
SingleLinkNode * next = a.GetHead();
|
||||
SingleLinkNode * copy;
|
||||
|
||||
while( next ) {
|
||||
copy = new BinaryNode( *( BinaryNode * )next );
|
||||
AddNode( copy );
|
||||
next = next->NextNode();
|
||||
}
|
||||
if( head ) {
|
||||
_null = 0;
|
||||
} else {
|
||||
_null = 1;
|
||||
}
|
||||
return *this;
|
||||
|
||||
}
|
||||
|
||||
SingleLinkNode * BinaryAggregate::NewNode() {
|
||||
return new BinaryNode();
|
||||
}
|
||||
|
||||
|
||||
BinaryNode::BinaryNode() {
|
||||
value = 0;
|
||||
}
|
||||
|
||||
BinaryNode::~BinaryNode() {
|
||||
}
|
||||
|
||||
BinaryNode::BinaryNode( BinaryNode & bn ) {
|
||||
value = bn.value.c_str();
|
||||
}
|
||||
|
||||
BinaryNode::BinaryNode( const char * sStr ) {
|
||||
// value is an SDAI_Binary (the memory is copied)
|
||||
value = sStr;
|
||||
}
|
||||
|
||||
SingleLinkNode *
|
||||
BinaryNode::NewNode() {
|
||||
return new BinaryNode();
|
||||
}
|
||||
|
||||
/**
|
||||
* non-whitespace chars following s are considered garbage and is an error.
|
||||
* a valid value will still be assigned if it exists before the garbage.
|
||||
*/
|
||||
Severity BinaryNode::StrToVal( const char * s, ErrorDescriptor * err ) {
|
||||
return STEPread( s, err );
|
||||
}
|
||||
|
||||
/**
|
||||
* this function assumes you will check for garbage following input
|
||||
*/
|
||||
Severity BinaryNode::StrToVal( istream & in, ErrorDescriptor * err ) {
|
||||
return value.STEPread( in, err );
|
||||
}
|
||||
|
||||
/**
|
||||
* non-whitespace chars following s are considered garbage and is an error.
|
||||
* a valid value will still be assigned if it exists before the garbage.
|
||||
*/
|
||||
Severity BinaryNode::STEPread( const char * s, ErrorDescriptor * err ) {
|
||||
istringstream in( ( char * )s );
|
||||
|
||||
value.STEPread( in, err );
|
||||
CheckRemainingInput( in, err, "binary", ",)" );
|
||||
return err->severity();
|
||||
}
|
||||
|
||||
/**
|
||||
* this function assumes you will check for garbage following input
|
||||
*/
|
||||
Severity BinaryNode::STEPread( istream & in, ErrorDescriptor * err ) {
|
||||
return value.STEPread( in, err );
|
||||
}
|
||||
|
||||
const char * BinaryNode::asStr( std::string & s ) {
|
||||
s = value.c_str();
|
||||
return const_cast<char *>( s.c_str() );
|
||||
}
|
||||
|
||||
const char * BinaryNode::STEPwrite( std::string & s, const char * ) {
|
||||
value.STEPwrite( s );
|
||||
return const_cast<char *>( s.c_str() );
|
||||
}
|
||||
|
||||
void BinaryNode::STEPwrite( ostream & out ) {
|
||||
value.STEPwrite( out );
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
#ifndef STEPAGGRBINARY_H
|
||||
#define STEPAGGRBINARY_H
|
||||
|
||||
#include "STEPaggregate.h"
|
||||
#include <sc_export.h>
|
||||
|
||||
/** \file STEPaggrBinary.h
|
||||
* classes BinaryAggregate, BinaryNode
|
||||
*/
|
||||
|
||||
/**
|
||||
* * \class BinaryAggregate
|
||||
** This class supports LIST OF BINARY type
|
||||
*/
|
||||
class SC_CORE_EXPORT BinaryAggregate : public STEPaggregate {
|
||||
public:
|
||||
virtual SingleLinkNode * NewNode();
|
||||
virtual STEPaggregate & ShallowCopy( const STEPaggregate & );
|
||||
|
||||
BinaryAggregate();
|
||||
virtual ~BinaryAggregate();
|
||||
};
|
||||
typedef BinaryAggregate * BinaryAggregateH;
|
||||
typedef BinaryAggregate * BinaryAggregate_ptr;
|
||||
typedef const BinaryAggregate * BinaryAggregate_ptr_c;
|
||||
typedef BinaryAggregate_ptr BinaryAggregate_var;
|
||||
|
||||
/**
|
||||
* * \class BinaryNode
|
||||
** This class is for the Nodes of BinaryAggregates
|
||||
*/
|
||||
class SC_CORE_EXPORT BinaryNode : public STEPnode {
|
||||
public:
|
||||
SDAI_Binary value;
|
||||
// INPUT
|
||||
virtual Severity StrToVal( const char * s, ErrorDescriptor * err );
|
||||
virtual Severity StrToVal( istream & in, ErrorDescriptor * err );
|
||||
|
||||
virtual Severity STEPread( const char * s, ErrorDescriptor * err );
|
||||
virtual Severity STEPread( istream & in, ErrorDescriptor * err );
|
||||
|
||||
// OUTPUT
|
||||
virtual const char * asStr( std::string & s );
|
||||
virtual const char * STEPwrite( std::string & s, const char * = 0 );
|
||||
virtual void STEPwrite( ostream & out = cout );
|
||||
|
||||
// CONSTRUCTORS
|
||||
BinaryNode( BinaryNode & bn );
|
||||
BinaryNode( const char * sStr );
|
||||
BinaryNode();
|
||||
~BinaryNode();
|
||||
|
||||
virtual SingleLinkNode * NewNode();
|
||||
};
|
||||
|
||||
|
||||
#endif //STEPAGGRBINARY_H
|
||||
@@ -0,0 +1,241 @@
|
||||
#include "STEPaggrEntity.h"
|
||||
#include "STEPattribute.h"
|
||||
#include "typeDescriptor.h"
|
||||
#include <sstream>
|
||||
|
||||
/** \file STEPaggrEntity.cc
|
||||
* implement classes EntityAggregate, EntityNode
|
||||
*/
|
||||
|
||||
|
||||
EntityAggregate::EntityAggregate() {
|
||||
}
|
||||
|
||||
EntityAggregate::~EntityAggregate() {
|
||||
}
|
||||
|
||||
|
||||
/// if exchangeFileFormat == 1 then delims are required.
|
||||
Severity EntityAggregate::ReadValue( istream & in, ErrorDescriptor * err,
|
||||
const TypeDescriptor * elem_type, InstMgrBase * insts,
|
||||
int addFileId, int assignVal,
|
||||
int exchangeFileFormat, const char * ) {
|
||||
ErrorDescriptor errdesc;
|
||||
char errmsg[BUFSIZ];
|
||||
int value_cnt = 0;
|
||||
std::string buf;
|
||||
|
||||
if( assignVal ) {
|
||||
Empty(); // read new values and discard existing ones
|
||||
}
|
||||
|
||||
char c;
|
||||
|
||||
in >> ws; // skip white space
|
||||
|
||||
c = in.peek(); // does not advance input
|
||||
|
||||
if( in.eof() || ( c == '$' ) ) {
|
||||
_null = 1;
|
||||
err->GreaterSeverity( SEVERITY_INCOMPLETE );
|
||||
return SEVERITY_INCOMPLETE;
|
||||
}
|
||||
|
||||
if( c == '(' ) {
|
||||
in.get( c );
|
||||
} else if( exchangeFileFormat ) {
|
||||
// error did not find opening delim
|
||||
// give up because you do not know where to stop reading.
|
||||
err->GreaterSeverity( SEVERITY_INPUT_ERROR );
|
||||
return SEVERITY_INPUT_ERROR;
|
||||
} else if( !in.good() ) {
|
||||
// this should actually have been caught by skipping white space above
|
||||
err->GreaterSeverity( SEVERITY_INCOMPLETE );
|
||||
return SEVERITY_INCOMPLETE;
|
||||
}
|
||||
|
||||
EntityNode * item = 0;
|
||||
|
||||
in >> ws;
|
||||
// take a peek to see if there are any elements before committing to an
|
||||
// element
|
||||
c = in.peek(); // does not advance input
|
||||
if( c == ')' ) {
|
||||
in.get( c );
|
||||
}
|
||||
// if not assigning values only need one node. So only one node is created.
|
||||
// It is used to read the values
|
||||
else if( !assignVal ) {
|
||||
item = new EntityNode();
|
||||
}
|
||||
|
||||
while( in.good() && ( c != ')' ) ) {
|
||||
value_cnt++;
|
||||
if( assignVal ) { // create a new node each time through the loop
|
||||
item = new EntityNode();
|
||||
}
|
||||
|
||||
errdesc.ClearErrorMsg();
|
||||
|
||||
if( exchangeFileFormat ) {
|
||||
item->STEPread( in, &errdesc, elem_type, insts, addFileId );
|
||||
} else {
|
||||
item->StrToVal( in, &errdesc, elem_type, insts, addFileId );
|
||||
}
|
||||
|
||||
elem_type->AttrTypeName( buf );
|
||||
// read up to the next delimiter and set errors if garbage is
|
||||
// found before specified delims (i.e. comma and quote)
|
||||
CheckRemainingInput( in, &errdesc, buf, ",)" );
|
||||
|
||||
if( errdesc.severity() < SEVERITY_INCOMPLETE ) {
|
||||
sprintf( errmsg, " index: %d\n", value_cnt );
|
||||
errdesc.PrependToDetailMsg( errmsg );
|
||||
err->AppendFromErrorArg( &errdesc );
|
||||
}
|
||||
if( assignVal ) {
|
||||
AddNode( item );
|
||||
}
|
||||
|
||||
in >> ws; // skip white space (although should already be skipped)
|
||||
in.get( c ); // read delim
|
||||
|
||||
// CheckRemainingInput should have left the input right at the delim
|
||||
// so that it would be read in in.get() above. Since it did not find
|
||||
// the delim this does not know how to find it either!
|
||||
if( ( c != ',' ) && ( c != ')' ) ) {
|
||||
// cannot recover so give up and let STEPattribute recover
|
||||
err->GreaterSeverity( SEVERITY_INPUT_ERROR );
|
||||
return SEVERITY_INPUT_ERROR;
|
||||
}
|
||||
}
|
||||
if( c == ')' ) {
|
||||
_null = 0;
|
||||
} else { // expectation for end paren delim has not been met
|
||||
err->GreaterSeverity( SEVERITY_INPUT_ERROR );
|
||||
err->AppendToUserMsg( "Missing close paren for aggregate value" );
|
||||
return SEVERITY_INPUT_ERROR;
|
||||
}
|
||||
return err->severity();
|
||||
}
|
||||
|
||||
|
||||
STEPaggregate & EntityAggregate::ShallowCopy( const STEPaggregate & a ) {
|
||||
const EntityNode * tmp = ( const EntityNode * ) a.GetHead();
|
||||
while( tmp ) {
|
||||
AddNode( new EntityNode( tmp -> node ) );
|
||||
tmp = ( const EntityNode * ) tmp -> NextNode();
|
||||
}
|
||||
if( head ) {
|
||||
_null = 0;
|
||||
} else {
|
||||
_null = 1;
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
SingleLinkNode * EntityAggregate::NewNode() {
|
||||
return new EntityNode();
|
||||
}
|
||||
|
||||
EntityNode::EntityNode() {
|
||||
}
|
||||
|
||||
EntityNode::~EntityNode() {
|
||||
}
|
||||
|
||||
EntityNode::EntityNode( SDAI_Application_instance * e ) : node( e ) {
|
||||
}
|
||||
|
||||
SingleLinkNode * EntityNode::NewNode() {
|
||||
return new EntityNode();
|
||||
}
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Severity EntityNode::StrToVal( const char * s, ErrorDescriptor * err,
|
||||
const TypeDescriptor * elem_type,
|
||||
InstMgrBase * insts, int addFileId ) {
|
||||
SDAI_Application_instance * se = ReadEntityRef( s, err, ",)", insts,
|
||||
addFileId );
|
||||
if( se != S_ENTITY_NULL ) {
|
||||
ErrorDescriptor error;
|
||||
if( EntityValidLevel( se, elem_type, &error ) == SEVERITY_NULL ) {
|
||||
node = se;
|
||||
} else {
|
||||
node = S_ENTITY_NULL;
|
||||
err->AppendToDetailMsg( error.DetailMsg() );
|
||||
err->AppendToUserMsg( error.UserMsg() );
|
||||
err->GreaterSeverity( error.severity() );
|
||||
}
|
||||
} else {
|
||||
node = S_ENTITY_NULL;
|
||||
}
|
||||
return err->severity();
|
||||
}
|
||||
|
||||
Severity EntityNode::StrToVal( istream & in, ErrorDescriptor * err,
|
||||
const TypeDescriptor * elem_type,
|
||||
InstMgrBase * insts, int addFileId ) {
|
||||
return STEPread( in, err, elem_type, insts, addFileId );
|
||||
}
|
||||
|
||||
Severity EntityNode::STEPread( const char * s, ErrorDescriptor * err,
|
||||
const TypeDescriptor * elem_type,
|
||||
InstMgrBase * insts, int addFileId ) {
|
||||
istringstream in( ( char * )s );
|
||||
return STEPread( in, err, elem_type, insts, addFileId );
|
||||
}
|
||||
|
||||
Severity EntityNode::STEPread( istream & in, ErrorDescriptor * err,
|
||||
const TypeDescriptor * elem_type,
|
||||
InstMgrBase * insts, int addFileId ) {
|
||||
SDAI_Application_instance * se = ReadEntityRef( in, err, ",)", insts,
|
||||
addFileId );
|
||||
if( se != S_ENTITY_NULL ) {
|
||||
ErrorDescriptor error;
|
||||
if( EntityValidLevel( se, elem_type, &error ) == SEVERITY_NULL ) {
|
||||
node = se;
|
||||
} else {
|
||||
node = S_ENTITY_NULL;
|
||||
err->AppendToDetailMsg( error.DetailMsg() );
|
||||
err->AppendToUserMsg( error.UserMsg() );
|
||||
err->GreaterSeverity( error.severity() );
|
||||
}
|
||||
} else {
|
||||
node = S_ENTITY_NULL;
|
||||
}
|
||||
return err->severity();
|
||||
}
|
||||
|
||||
const char * EntityNode::asStr( std::string & s ) {
|
||||
s.clear();
|
||||
if( !node || ( node == S_ENTITY_NULL ) ) { // nothing
|
||||
return "";
|
||||
} else { // otherwise return entity id
|
||||
char tmp [64];
|
||||
sprintf( tmp, "#%d", node->STEPfile_id );
|
||||
s = tmp;
|
||||
}
|
||||
return const_cast<char *>( s.c_str() );
|
||||
}
|
||||
|
||||
const char * EntityNode::STEPwrite( std::string & s, const char * ) {
|
||||
if( !node || ( node == S_ENTITY_NULL ) ) { // nothing
|
||||
s = "$";
|
||||
return const_cast<char *>( s.c_str() );
|
||||
}
|
||||
asStr( s );
|
||||
return const_cast<char *>( s.c_str() );
|
||||
}
|
||||
|
||||
void EntityNode::STEPwrite( ostream & out ) {
|
||||
if( !node || ( node == S_ENTITY_NULL ) ) { // nothing
|
||||
out << "$";
|
||||
}
|
||||
std::string s;
|
||||
out << asStr( s );
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
#ifndef STEPAGGRENTITY_H
|
||||
#define STEPAGGRENTITY_H
|
||||
|
||||
/** \file STEPaggrEntity.h
|
||||
* classes EntityAggregate, EntityNode
|
||||
*/
|
||||
|
||||
#include "STEPaggregate.h"
|
||||
#include <sc_export.h>
|
||||
|
||||
class SC_CORE_EXPORT EntityAggregate : public STEPaggregate {
|
||||
public:
|
||||
virtual Severity ReadValue( istream & in, ErrorDescriptor * err,
|
||||
const TypeDescriptor * elem_type,
|
||||
InstMgrBase * insts, int addFileId = 0,
|
||||
int assignVal = 1, int ExchangeFileFormat = 1,
|
||||
const char * currSch = 0 );
|
||||
|
||||
virtual SingleLinkNode * NewNode();
|
||||
virtual STEPaggregate & ShallowCopy( const STEPaggregate & );
|
||||
|
||||
EntityAggregate();
|
||||
virtual ~EntityAggregate();
|
||||
};
|
||||
typedef EntityAggregate * EntityAggregateH;
|
||||
typedef EntityAggregate * EntityAggregate_ptr;
|
||||
typedef const EntityAggregate * EntityAggregate_ptr_c;
|
||||
typedef EntityAggregate_ptr EntityAggregate_var;
|
||||
|
||||
class SC_CORE_EXPORT EntityNode : public STEPnode {
|
||||
public:
|
||||
SDAI_Application_instance * node;
|
||||
|
||||
// INPUT
|
||||
virtual Severity StrToVal( const char * s, ErrorDescriptor * err,
|
||||
const TypeDescriptor * elem_type,
|
||||
InstMgrBase * insts, int addFileId = 0 );
|
||||
virtual Severity StrToVal( istream & in, ErrorDescriptor * err,
|
||||
const TypeDescriptor * elem_type,
|
||||
InstMgrBase * insts, int addFileId = 0 );
|
||||
|
||||
virtual Severity STEPread( const char * s, ErrorDescriptor * err,
|
||||
const TypeDescriptor * elem_type,
|
||||
InstMgrBase * insts, int addFileId = 0 );
|
||||
virtual Severity STEPread( istream & in, ErrorDescriptor * err,
|
||||
const TypeDescriptor * elem_type,
|
||||
InstMgrBase * insts, int addFileId = 0 );
|
||||
// OUTPUT
|
||||
virtual const char * asStr( std::string & s );
|
||||
virtual const char * STEPwrite( std::string & s, const char * = 0 );
|
||||
virtual void STEPwrite( ostream & out = cout );
|
||||
|
||||
// CONSTRUCTORS
|
||||
EntityNode( SDAI_Application_instance * e );
|
||||
EntityNode();
|
||||
~EntityNode();
|
||||
|
||||
virtual SingleLinkNode * NewNode();
|
||||
|
||||
// Calling these funtions is an error.
|
||||
Severity StrToVal( const char * s, ErrorDescriptor * err ) {
|
||||
cerr << "Internal error: " << __FILE__ << __LINE__
|
||||
<< "\n" << _POC_ "\n";
|
||||
return StrToVal( s, err, 0, 0, 0 );
|
||||
}
|
||||
Severity StrToVal( istream & in, ErrorDescriptor * err ) {
|
||||
cerr << "Internal error: " << __FILE__ << __LINE__
|
||||
<< "\n" << _POC_ "\n";
|
||||
return StrToVal( in, err, 0, 0, 0 );
|
||||
}
|
||||
|
||||
Severity STEPread( const char * s, ErrorDescriptor * err ) {
|
||||
cerr << "Internal error: " << __FILE__ << __LINE__
|
||||
<< "\n" << _POC_ "\n";
|
||||
return STEPread( s, err, 0, 0, 0 );
|
||||
}
|
||||
Severity STEPread( istream & in, ErrorDescriptor * err ) {
|
||||
cerr << "Internal error: " << __FILE__ << __LINE__
|
||||
<< "\n" << _POC_ "\n";
|
||||
return STEPread( in, err, 0, 0, 0 );
|
||||
}
|
||||
};
|
||||
|
||||
#endif //STEPAGGRENTITY_H
|
||||
@@ -0,0 +1,145 @@
|
||||
#include "STEPaggrEnum.h"
|
||||
#include <sstream>
|
||||
|
||||
/** \file StepaggrEnum.cc
|
||||
* implement classes EnumAggregate, LOGICALS, BOOLEANS, EnumNode
|
||||
*/
|
||||
|
||||
|
||||
/// COPY
|
||||
STEPaggregate & EnumAggregate::ShallowCopy( const STEPaggregate & a ) {
|
||||
const EnumNode * tmp = ( const EnumNode * ) a.GetHead();
|
||||
EnumNode * to;
|
||||
|
||||
while( tmp ) {
|
||||
to = ( EnumNode * ) NewNode();
|
||||
to -> node -> put( tmp -> node ->asInt() );
|
||||
AddNode( to );
|
||||
tmp = ( const EnumNode * ) tmp -> NextNode();
|
||||
}
|
||||
if( head ) {
|
||||
_null = 0;
|
||||
} else {
|
||||
_null = 1;
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
EnumAggregate::EnumAggregate() {
|
||||
|
||||
}
|
||||
|
||||
EnumAggregate::~EnumAggregate() {
|
||||
|
||||
}
|
||||
|
||||
/******************************************************************
|
||||
* * \returns a new EnumNode which is of the correct derived type
|
||||
** \details creates a node to put in an list of enumerated values
|
||||
** function is virtual so that the right node will be
|
||||
** created
|
||||
** Status: ok 2/91
|
||||
******************************************************************/
|
||||
SingleLinkNode * EnumAggregate::NewNode() {
|
||||
// defined in subclass
|
||||
cerr << "Internal error: " << __FILE__ << ": " << __LINE__ << "\n" ;
|
||||
cerr << "function: EnumAggregate::NewNode () called instead of virtual function. \n"
|
||||
<< _POC_ << "\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
LOGICALS::LOGICALS() {
|
||||
}
|
||||
|
||||
LOGICALS::~LOGICALS() {
|
||||
}
|
||||
|
||||
SingleLinkNode * LOGICALS::NewNode() {
|
||||
return new EnumNode( new SDAI_LOGICAL );
|
||||
}
|
||||
|
||||
LOGICALS * create_LOGICALS() {
|
||||
return new LOGICALS;
|
||||
}
|
||||
|
||||
BOOLEANS::BOOLEANS() {
|
||||
}
|
||||
|
||||
BOOLEANS::~BOOLEANS() {
|
||||
}
|
||||
|
||||
SingleLinkNode * BOOLEANS::NewNode() {
|
||||
return new EnumNode( new SDAI_BOOLEAN );
|
||||
}
|
||||
|
||||
BOOLEANS * create_BOOLEANS() {
|
||||
return new BOOLEANS ;
|
||||
}
|
||||
|
||||
EnumNode::EnumNode( SDAI_Enum * e ) : node( e ) {
|
||||
}
|
||||
|
||||
EnumNode::EnumNode() {
|
||||
}
|
||||
|
||||
EnumNode::~EnumNode() {
|
||||
}
|
||||
|
||||
/// defined in subclass
|
||||
SingleLinkNode * EnumNode::NewNode() {
|
||||
cerr << "Internal error: " << __FILE__ << ": " << __LINE__ << "\n" ;
|
||||
cerr << "function: EnumNode::NewNode () called instead of virtual function. \n"
|
||||
<< _POC_ << "\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* non-whitespace chars following s are considered garbage and is an error.
|
||||
* a valid value will still be assigned if it exists before the garbage.
|
||||
*/
|
||||
Severity EnumNode::StrToVal( const char * s, ErrorDescriptor * err ) {
|
||||
return STEPread( s, err );
|
||||
}
|
||||
/**
|
||||
* this function assumes you will check for garbage following input
|
||||
*/
|
||||
Severity EnumNode::StrToVal( istream & in, ErrorDescriptor * err ) {
|
||||
return node->STEPread( in, err );
|
||||
}
|
||||
|
||||
/**
|
||||
* non-whitespace chars following s are considered garbage and is an error.
|
||||
* a valid value will still be assigned if it exists before the garbage.
|
||||
*/
|
||||
Severity EnumNode::STEPread( const char * s, ErrorDescriptor * err ) {
|
||||
istringstream in( ( char * )s ); // sz defaults to length of s
|
||||
|
||||
int nullable = 0;
|
||||
node->STEPread( in, err, nullable );
|
||||
CheckRemainingInput( in, err, "enumeration", ",)" );
|
||||
return err->severity();
|
||||
}
|
||||
|
||||
/**
|
||||
* this function assumes you will check for garbage following input
|
||||
*/
|
||||
Severity EnumNode::STEPread( istream & in, ErrorDescriptor * err ) {
|
||||
int nullable = 0;
|
||||
node->STEPread( in, err, nullable );
|
||||
return err->severity();
|
||||
}
|
||||
|
||||
const char * EnumNode::asStr( std::string & s ) {
|
||||
node -> asStr( s );
|
||||
return const_cast<char *>( s.c_str() );
|
||||
}
|
||||
|
||||
const char * EnumNode::STEPwrite( std::string & s, const char * ) {
|
||||
node->STEPwrite( s );
|
||||
return const_cast<char *>( s.c_str() );
|
||||
}
|
||||
|
||||
void EnumNode::STEPwrite( ostream & out ) {
|
||||
node->STEPwrite( out );
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
#ifndef STEPAGGRENUM_H
|
||||
#define STEPAGGRENUM_H
|
||||
|
||||
#include "STEPaggregate.h"
|
||||
#include "sc_export.h"
|
||||
/** \file StepaggrEnum.h
|
||||
* classes EnumAggregate, LOGICALS, BOOLEANS, EnumNode
|
||||
*/
|
||||
|
||||
/**
|
||||
* \class EnumAggregate
|
||||
* This is a minimal representions for a collection of SDAI_Enum
|
||||
*/
|
||||
class SC_CORE_EXPORT EnumAggregate : public STEPaggregate {
|
||||
public:
|
||||
virtual SingleLinkNode * NewNode();
|
||||
virtual STEPaggregate & ShallowCopy( const STEPaggregate & );
|
||||
|
||||
EnumAggregate();
|
||||
virtual ~EnumAggregate();
|
||||
};
|
||||
typedef EnumAggregate * EnumAggregateH;
|
||||
typedef EnumAggregate * EnumAggregate_ptr;
|
||||
typedef const EnumAggregate * EnumAggregate_ptr_c;
|
||||
typedef EnumAggregate_ptr EnumAggregate_var;
|
||||
|
||||
class SC_CORE_EXPORT LOGICALS : public EnumAggregate {
|
||||
public:
|
||||
virtual SingleLinkNode * NewNode();
|
||||
|
||||
LOGICALS();
|
||||
virtual ~LOGICALS();
|
||||
};
|
||||
typedef LOGICALS * LogicalsH;
|
||||
typedef LOGICALS * LOGICALS_ptr;
|
||||
typedef const LOGICALS * LOGICALS_ptr_c;
|
||||
typedef LOGICALS_ptr LOGICALS_var;
|
||||
SC_CORE_EXPORT LOGICALS * create_LOGICALS();
|
||||
|
||||
|
||||
class SC_CORE_EXPORT BOOLEANS : public EnumAggregate {
|
||||
public:
|
||||
virtual SingleLinkNode * NewNode();
|
||||
|
||||
BOOLEANS();
|
||||
virtual ~BOOLEANS();
|
||||
};
|
||||
|
||||
typedef BOOLEANS * BOOLEANS_ptr;
|
||||
typedef const BOOLEANS * BOOLEANS_ptr_c;
|
||||
typedef BOOLEANS_ptr BOOLEANS_var;
|
||||
|
||||
SC_CORE_EXPORT BOOLEANS * create_BOOLEANS();
|
||||
|
||||
|
||||
/**
|
||||
* * \class EnumNode
|
||||
** This is a minimal representions for node in lists of SDAI_Enum
|
||||
*/
|
||||
class SC_CORE_EXPORT EnumNode : public STEPnode {
|
||||
public:
|
||||
SDAI_Enum * node;
|
||||
// INPUT
|
||||
virtual Severity StrToVal( const char * s, ErrorDescriptor * err );
|
||||
virtual Severity StrToVal( istream & in, ErrorDescriptor * err );
|
||||
|
||||
virtual Severity STEPread( const char * s, ErrorDescriptor * err );
|
||||
virtual Severity STEPread( istream & in, ErrorDescriptor * err );
|
||||
|
||||
// OUTPUT
|
||||
virtual const char * asStr( std::string & s );
|
||||
virtual const char * STEPwrite( std::string & s, const char * = 0 );
|
||||
virtual void STEPwrite( ostream & out = cout );
|
||||
|
||||
// CONSTRUCTORS
|
||||
EnumNode( SDAI_Enum * e );
|
||||
EnumNode();
|
||||
~EnumNode();
|
||||
|
||||
virtual SingleLinkNode * NewNode();
|
||||
};
|
||||
|
||||
|
||||
#endif //STEPAGGRENUM_H
|
||||
@@ -0,0 +1,87 @@
|
||||
#include "STEPaggrGeneric.h"
|
||||
#include <sstream>
|
||||
|
||||
/** \file STEPaggrGeneric.cc
|
||||
* implement classes GenericAggregate, GenericAggrNode
|
||||
*/
|
||||
|
||||
GenericAggregate::GenericAggregate() {
|
||||
}
|
||||
|
||||
GenericAggregate::~GenericAggregate() {
|
||||
}
|
||||
|
||||
SingleLinkNode * GenericAggregate::NewNode() {
|
||||
return new GenericAggrNode();
|
||||
}
|
||||
|
||||
STEPaggregate & GenericAggregate::ShallowCopy( const STEPaggregate & a ) {
|
||||
Empty();
|
||||
|
||||
SingleLinkNode * next = a.GetHead();
|
||||
SingleLinkNode * copy;
|
||||
|
||||
while( next ) {
|
||||
copy = new GenericAggrNode( *( GenericAggrNode * )next );
|
||||
AddNode( copy );
|
||||
next = next->NextNode();
|
||||
}
|
||||
if( head ) {
|
||||
_null = 0;
|
||||
} else {
|
||||
_null = 1;
|
||||
}
|
||||
return *this;
|
||||
|
||||
}
|
||||
|
||||
GenericAggrNode::GenericAggrNode( const char * str ) {
|
||||
value = str;
|
||||
}
|
||||
|
||||
GenericAggrNode::GenericAggrNode( GenericAggrNode & gan ) {
|
||||
value = gan.value;
|
||||
}
|
||||
|
||||
GenericAggrNode::GenericAggrNode() {
|
||||
}
|
||||
|
||||
GenericAggrNode::~GenericAggrNode() {
|
||||
}
|
||||
|
||||
SingleLinkNode * GenericAggrNode::NewNode() {
|
||||
return new GenericAggrNode();
|
||||
}
|
||||
|
||||
Severity GenericAggrNode::StrToVal( const char * s, ErrorDescriptor * err ) {
|
||||
return value.STEPread( s, err );
|
||||
}
|
||||
|
||||
//TODO
|
||||
Severity GenericAggrNode::StrToVal( istream & in, ErrorDescriptor * err ) {
|
||||
return value.STEPread( in, err );
|
||||
}
|
||||
|
||||
Severity GenericAggrNode::STEPread( const char * s, ErrorDescriptor * err ) {
|
||||
istringstream in( ( char * ) s );
|
||||
return value.STEPread( in, err );
|
||||
}
|
||||
|
||||
Severity GenericAggrNode::STEPread( istream & in, ErrorDescriptor * err ) {
|
||||
return value.STEPread( in, err );
|
||||
}
|
||||
|
||||
const char * GenericAggrNode::asStr( std::string & s ) {
|
||||
s.clear();
|
||||
value.asStr( s );
|
||||
return const_cast<char *>( s.c_str() );
|
||||
}
|
||||
|
||||
const char * GenericAggrNode::STEPwrite( std::string & s, const char * currSch ) {
|
||||
(void) currSch; //unused
|
||||
return value.STEPwrite( s );
|
||||
}
|
||||
|
||||
void GenericAggrNode::STEPwrite( ostream & out ) {
|
||||
value.STEPwrite( out );
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
#ifndef STEPAGGRGENERIC_H
|
||||
#define STEPAGGRGENERIC_H
|
||||
|
||||
#include "STEPaggregate.h"
|
||||
#include <sc_export.h>
|
||||
|
||||
/** \file STEPaggrGeneric.h
|
||||
* classes GenericAggregate, GenericAggrNode
|
||||
*/
|
||||
|
||||
/**
|
||||
* This class supports LIST OF:
|
||||
* SELECT_TYPE, BINARY_TYPE, GENERIC_TYPE, ENUM_TYPE, UNKNOWN_TYPE type
|
||||
* FIXME this class, as well as SelectAggregate, for SELECTs?!
|
||||
*/
|
||||
class SC_CORE_EXPORT GenericAggregate : public STEPaggregate {
|
||||
public:
|
||||
virtual SingleLinkNode * NewNode();
|
||||
virtual STEPaggregate & ShallowCopy( const STEPaggregate & );
|
||||
|
||||
GenericAggregate();
|
||||
virtual ~GenericAggregate();
|
||||
};
|
||||
typedef GenericAggregate * GenericAggregateH;
|
||||
typedef GenericAggregate * GenericAggregate_ptr;
|
||||
typedef const GenericAggregate * GenericAggregate_ptr_c;
|
||||
typedef GenericAggregate_ptr GenericAggregate_var;
|
||||
|
||||
/**
|
||||
* This class is for the Nodes of GenericAggregates
|
||||
*/
|
||||
class SC_CORE_EXPORT GenericAggrNode : public STEPnode {
|
||||
public:
|
||||
SCLundefined value;
|
||||
// INPUT
|
||||
virtual Severity StrToVal( const char * s, ErrorDescriptor * err );
|
||||
virtual Severity StrToVal( istream & in, ErrorDescriptor * err );
|
||||
|
||||
virtual Severity STEPread( const char * s, ErrorDescriptor * err );
|
||||
virtual Severity STEPread( istream & in, ErrorDescriptor * err );
|
||||
|
||||
// OUTPUT
|
||||
virtual const char * asStr( std::string & s );
|
||||
virtual const char * STEPwrite( std::string & s, const char * = 0 );
|
||||
virtual void STEPwrite( ostream & out = cout );
|
||||
|
||||
// CONSTRUCTORS
|
||||
GenericAggrNode( const char * str );
|
||||
GenericAggrNode( GenericAggrNode & gan );
|
||||
GenericAggrNode();
|
||||
~GenericAggrNode();
|
||||
|
||||
virtual SingleLinkNode * NewNode();
|
||||
};
|
||||
|
||||
|
||||
#endif //STEPAGGRGENERIC_H
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user