Compare commits

...
Author SHA1 Message Date
Mark Pictor 4a76e58f2c caught by cppcheck 2017-08-22 00:03:07 -04:00
Mark Pictor d042c5a6dc add a few keywords to syntax highlighting file 2017-08-22 00:03:07 -04:00
Mark Pictor 33a903b9ef statement type converted from defines to enum so gdb can print types nicely 2017-08-22 00:03:07 -04:00
Mark Pictor 066d4d7809 initial work on pretty printers for libexpress 2017-08-22 00:03:07 -04:00
Mark 8a82142e1b Merge pull request #358 from jepler/sanitize
Fix problems detected by "-fsanitize=address"
2017-08-21 22:31:45 -04:00
Mark 20d72fb6d5 Merge pull request #363 from jepler/inverse_attr3_windows
fix test_inverse_attr3 failures on appveyor (windows)
2017-08-21 22:28:58 -04:00
Mark ab9bd3ae8d Merge pull request #362 from jepler/mac-inverse-attr3-failure
Fix test_inverse_attr3 failure on macos
2017-08-21 22:25:55 -04:00
Mark 81a0362c30 Merge pull request #360 from jepler/test-parallelism-failures
Fix test parallelism failures
2017-08-21 22:25:21 -04:00
Jeff Epler 84472921c1 Don't open part 21 files as text files
On Windows, when a file is opened in "text" mode, but it actually
contains Unix-style line endings, the behavior of tellg() is
unexpected.

Consider this program which puts the (binary) contents "a\nb\n" in a
file, then opens it in text mode for reading.  It prints each
character read, along with the value returned by tellg():

    #include <iostream>
    #include <fstream>

    int main()
    {
        {
            std::ofstream f("myfile.txt", std::ios::binary);
            f << "a\nb\n";
        }

        std::ifstream f("myfile.txt");

        for (char c=0; f.get(c);)
            std::cout << f.tellg() << ' ' << int(c) << '\n';
    }

On a UNIX platform which does not have a distinction between "text"
and "binary" files, the output will read
    1 97
    2 10
    3 98
    4 10
because the file position simply advances one position after each
byte is read.

On Windows with the Visual Studio C and C++ runtime, the result is
instead
    -1 97
    1 10
    2 98
    4 10
While it is impossible to say exactly what the Windows runtime is
doing here, it appears that it is trying to adjust for the mismatch
between "number of bytes read in byte oriented mode and "number of
bytes read in text mode".

Since "part21" files don't necessarily contain CRLF line endings
when viewed in binary mode, open the file in binary mode.  This
fixes the test failure seen on appveyor ci running the
"test_inverse_attr3" test.
2017-08-21 17:11:50 -05:00
Jeff Epler 1d01b831aa errordesc.cc: Correctly append a single character to a std::string
The idiom
    char c = ...;
    _userMsg.append( &c );
is not correct C++, because it treats the address of 'c' as a NUL-
terminated C string.  However, this is not guaranteed.

When building and testing on Debian Stretch with AddressSanitizer:
    ASAN_OPTIONS="detect_leaks=false" CXX="clang++" CC=clang CXXFLAGS="-fsanitize=address" LDFLAGS="-fsanitize=address" cmake .. -DSC_ENABLE_TESTING=ON  -DSC_BUILD_SCHEMAS="ifc2x3;ap214e3;ap209"
    ASAN_OPTIONS="detect_leaks=false" make
    ASAN_OPTIONS="detect_leaks=false" ctest . --output-on-failure
an error like the following is encountered:

==15739==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffeb2ca7621 at pc 0x00000043c943 bp 0x7ffeb2ca75d0 sp 0x7ffeb2ca6d80
READ of size 33 at 0x7ffeb2ca7621 thread T0
    #0 0x43c942 in __interceptor_strlen.part.45 (/home/jepler/src/stepcode/build/bin/lazy_sdai_ap214e3+0x43c942)
    #1 0x7fb9056e6143 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::append(char const*) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x11f143)
    #2 0x7fb905b677c3 in ErrorDescriptor::AppendToDetailMsg(char) /home/jepler/src/stepcode/src/clutils/errordesc.cc:150:5

Address 0x7ffeb2ca7621 is located in stack of thread T0 at offset 33 in frame
    #0 0x7fb905b676af in ErrorDescriptor::AppendToDetailMsg(char) /home/jepler/src/stepcode/src/clutils/errordesc.cc:149

  This frame has 1 object(s):
    [32, 33) '' <== Memory access at offset 33 overflows this variable

A similar problem with AppendToUserMsg is found by inspection.

After this change, all 200 tests pass under the AddressSanitizer
configuration
2017-08-21 08:35:04 -05:00
Jeff Epler 0d2e791e82 express/error.c: Ensure the error buffer does not overflow
On Debian Stretch, when configuring stepcode like so:
    ASAN_OPTIONS="detect_leaks=false" CXX="clang++" CXXFLAGS="-fsanitize=address" cmake ..
a fatal error would be detected:

  ==29661==ERROR: AddressSanitizer: heap-buffer-overflow on address
  0x62100001dca0 at pc 0x0000004435e3 bp 0x7ffed6d9cae0 sp 0x7ffed6d9c290

  READ of size 4001 at 0x62100001dca0 thread T0

      #0 0x4435e2 in __interceptor_strlen.part.45 (/home/jepler/src/stepcode/build/bin/schema_scanner+0x4435e2)
      #1 0x501d7b in ERRORreport_with_symbol /home/jepler/src/stepcode/src/express/error.c:413

  0x62100001dca0 is located 0 bytes to the right of 4000-byte region
  [0x62100001cd00,0x62100001dca0)

  allocated by thread T0 here:

      #0 0x4c3ae8 in __interceptor_malloc (/home/jepler/src/stepcode/build/bin/schema_scanner+0x4c3ae8)
      #1 0x5011fc in ERRORinitialize /home/jepler/src/stepcode/src/express/error.c:129

Operations on ERROR_string were unsafe, because they did not guard
against accesses beyond the end of the allocatd region.

This patch ensures that all accesses via *printf functions do respect
the end of the buffer; and encapsulates the routine for pointing
ERROR_string at the space for the next error text to start, if space is
available.

Finally, because it was found with search and replace, a stray manipulation
of ERROR_string within the print-to-file branch of the code is removed.
This stray line would have had the effect of moving ERROR_string one byte
further along at every warning-to-file, which could also have been a
cause of the problem here.
2017-08-21 08:35:04 -05:00
Jeff Epler d39fbaf4d7 sc_version_string: Use temporary names resilient against parallel builds
In #359 I identify a race condition between multiple parallel invocations
of cmake, which can arise naturally during ctests.  Now that the file
contents will not change without an intervening git commit, it is
sufficient to ensure that the parallel invocations use distinct temporary
file names with high probability.
2017-08-21 08:31:05 -05:00
Jeff Epler e422262877 sc_version_string: omit the date and time when testing
As analyzed in #359, if the header contains the current time, it will
be updated while running the testsuite; this, in turn, causes multiple
cmake processes to attempt to update targets like lib/libexpress.so.2.0.0
at the same time, causing test failures.
2017-08-21 08:31:00 -05:00
Mark 71fe947ff5 Merge pull request #361 from jepler/appveyor-single-thread-test
appveyor build: don't use ctest parallelism
2017-08-19 17:12:28 -04:00
Mark beb2a595f1 Merge pull request #357 from jepler/nullptr-bool
Fix build error with g++ 6.3 (Debian Stretch)
2017-08-19 15:41:33 -04:00
Jeff Epler 0b6cd90dd9 Fix test_inverse_attr3 failure
This fixes the failure in test_inverse_attr3 seen on travis ci's osx
build.

Actually, only the change to sectionReader::getRealInstance is
needed to fix the test, but as the reason that 'unget' can fail is
unclear, I changed all instances of 'unget' to use the 'seekg' +
arithmetic method instead.

I failed to find a reason why 'unget' could fail in this way, or
reports of macos-specific failures in 'unget', but I was not
enlightened.

I do not know whether test_inverse_attr3 would *consistently* hang
on Appveyor, but after this change (and modifying .appveyor.yml
to not skip test_inverse_attr3) it did succeed on the first try.
2017-08-16 07:49:13 -05:00
Jeff Epler 3fd71cf457 appveyor build: don't use ctest parallelism
On Windows, concurrent access to files is severely restricted
compared to standard operating systems.  When ctest is invoking
cmake, this causes it to write simultaneously to the same files in
each concurrent cmake invocation, leading to spurious test failures
like

  error MSB3491: Could not write lines to file "...".  The process
  cannot access the file '...' because it is being used by another
  process.

Explicitly ask for no parallelism with "-j1", even though it is
probably the default.
2017-08-15 20:38:47 -05:00
Jeff Epler 0fbc3c0c84 Fix build error with g++ 6.3 (Debian Stretch)
On this platform, TEST_NULLPTR fails, even though nullptr and
nullptr_t are supported:

/home/jepler/src/stepcode/build/CMakeFiles/CMakeTmp/src.cxx:4:23:
    error: converting to 'bool' from 'std::nullptr_t'
    requires direct-initialization [-fpermissive]
 int main() {return !!f();}
                      ~^~

Subsequent to this failure, the workaround definitions in sc_nullptr.h
prevent standard C++ headers (which must refer to real nullptr) to fail.

The failure occurs because the C++ standard apparently does not state
that operator! may be used on nullptr.  Despite this, some compilers
have historically allowed it.  g++ 6.3's behavior appears to be aligned
with the standard.

As requested by @brlcad, ensure that the function 'f' is used from main,
to avoid a clever (but not nullptr-supporting) compiler from somehow
skipping 'f' altogether, creating a false positive for nullptr support.
2017-08-15 06:50:56 -05:00
Mark a96336ab97 Merge pull request #351 from stepcode/review/327
Review/327
2017-08-13 20:46:34 -04:00
Thomas Paviot b24680d7e5 Merge pull request #356 from luzpaz/ascii-typos
Fixed typos showing up as ascii chars
2017-03-05 07:41:13 +01:00
Kunda 15afe96d67 Fixed typos showing up as ascii chars
Using http://www.lisi.ensma.fr/ftp/enseignement/A3_Master_Ingenierie_donnees/fonctionsGrammaire_EXPRESS.pdf I was able to fix typos in the text files for Builtin.py
2017-03-04 07:22:46 -05:00
Cliff Yapp a78ca01b54 Revert "Get latest version of ap242 from http://stepmod.cvs.sourceforge.net/viewvc/stepmod/stepmod/data/modules/ap242_managed_model_based_3d_engineering/mim_lf.exp"
This reverts commit 0b456a833e.

New schema apparently doesn't build.
2016-08-06 16:51:58 -04:00
Cliff Yapp 8627627c5e Add an option to completely bypass the git management of the version header. 2016-08-06 13:53:12 -04:00
Cliff Yapp 9b091756b1 Allow the user to control whether C++11 is used (matters for subbuilds) 2016-08-06 13:02:35 -04:00
Cliff Yapp dfce2dcf07 For the flags variables, rather annoyingly, they actually need to be managed as strings and not lists. 2016-08-06 12:37:01 -04:00
Cliff Yapp 5c7e63c75b Fix macro comments. This approach to managing the targets varies from the old EXCLUDE_OR_INSTALL setup in that by default the testable targets are not added to the 'all' build - in other works, 'make' will make just the main stepcode targets. The testable targets are available individually, and if SC_ENABLE_TESTING is enabled they *will* be added to the 'all' target, but by default they are not compiled in the basic build. 2016-08-06 12:32:12 -04:00
Cliff Yapp 0b456a833e Get latest version of ap242 from http://stepmod.cvs.sourceforge.net/viewvc/stepmod/stepmod/data/modules/ap242_managed_model_based_3d_engineering/mim_lf.exp 2016-08-06 12:05:18 -04:00
Cliff Yapp a243b4d8c8 Separate shared and static generated files for better parallel building safety. 2016-08-06 11:55:38 -04:00
Cliff Yapp daec3e2640 Add option handling to the SC target macros, replacing the EXCLUDE_FROM_INSTALL macro. 2016-08-06 11:43:59 -04:00
Cliff Yapp 06b13bb9af Make a stab at adapting the new, simplier verification to vanilla stepcode 2016-08-06 11:23:34 -04:00
Cliff Yapp e38519a7f1 Update Find cmake scripts 2016-08-06 10:53:19 -04:00
Cliff Yapp 12def15dd2 Start working on merging BRL-CAD changes back into upstream. 2016-08-06 10:46:23 -04:00
Mark Pictor a160cc9af6 fix #327 - statically initialize t_sdaiINTEGER etc 2015-08-30 11:57:58 -04:00
Mark Pictor 1dfe76b3b4 README: put CI badges in table 2015-08-23 22:30:36 -04:00
Mark Pictor c23ba65c41 appveyor log - use JSON-like console data, massaged for parsability 2015-08-23 22:30:16 -04:00
Mark Pictor 274de2a91d appveyor: exclude hanging test 2015-08-10 21:06:51 -04:00
Mark Pictor 1a757024c4 add appveyor badge 2015-08-10 21:04:10 -04:00
Mark Pictor abae0a7c45 allow downloading log directly from AV 2015-08-10 21:00:35 -04:00
Mark bfc11face5 Merge pull request #345 from stepcode/review/misc
appveyor isn't at 100%, but it's considerably better
2015-08-10 20:47:30 -04:00
Mark Pictor 677261d4fb fix LNK2004 getEDesc already defined in sectionReader.obj
is this really the only/best way to fix this?!
2015-08-09 23:36:54 -04:00
Mark Pictor 4207a46f07 fix MSVC link error for NilSTEPentity 2015-08-09 23:30:13 -04:00
Mark Pictor 7316fe5070 msvc warnings/errors 2015-08-09 23:29:15 -04:00
Mark Pictor 4d32009592 'register' storage class specifier is deprecated [-Wdeprecated-register] 2015-08-03 22:00:22 -04:00
Mark Pictor 0b6078b72b missing include 2015-08-03 21:55:00 -04:00
Mark Pictor 36e34862cc cllazyfile: work around LNK2005 error. had to tweak class members so MSVC didn't see MgrNodeBase class twice.
suspect there is a better solution, but I'm not sure what it would be
2015-08-03 21:50:19 -04:00
Mark Pictor 9dcb6aa640 build judy array as part of base lib, else import/export macros don't work 2015-08-03 21:38:37 -04:00
Mark Pictor bc5533bda8 test for, and use, nullptr if we have it 2015-08-03 21:37:28 -04:00
Mark Pictor 4e88ad69eb summarize-appveyor-log: sort before printing 2015-08-02 22:51:22 -04:00
Mark Pictor b890c156f5 attempt to silence msvc linker errors 2015-08-02 22:50:26 -04:00
Mark Pictor 0ba7343004 no more excuses, build cllazyfile on windows 2015-08-02 15:59:48 -04:00
Mark Pictor f2247d222f use COMPILE_DEFINITIONS property for definitions 2015-08-02 15:58:04 -04:00
Mark Pictor 5288026043 add windows dll import/export macros to cllazyfile 2015-08-02 15:57:10 -04:00
Mark Pictor 6e8cad223e cmake 2.8.7 needs append_string, not append 2015-08-02 15:37:45 -04:00
Mark Pictor 018e7cfffc reduce delay used in parallel test, as it appears to cause a failure.
TODO: rework the test to not be timing-sensitive
2015-08-02 14:53:36 -04:00
Mark Pictor 458b775f41 simplify cmake logic - use set_property(...APPEND...) rather than get/list append/set 2015-08-02 14:30:01 -04:00
Mark Pictor dc82923cf1 support cmake 2.8.7 since that's what travis-ci uses 2015-08-02 14:28:53 -04:00
Mark Pictor aa967b3316 tweak includ dir logic, print path 2015-07-26 23:22:32 -04:00
Mark Pictor 17b41da525 add std::chrono test, if available use in thread test 2015-07-26 22:22:44 -04:00
Mark Pictor 135adc76c8 fix warning, improve cmake messages 2015-07-26 20:49:04 -04:00
Mark Pictor 017faa942f make schema-specific tests work on cmake 3.x 2015-07-26 20:49:04 -04:00
Mark Pictor 46c37207da replace c++ style comments recently introduced with c-style comments 2015-07-26 16:59:42 -04:00
Mark Pictor 85f45f38e4 debug message for appveyor 2015-07-26 15:22:24 -04:00
Mark Pictor be378119f4 piping to grep prevents appveyor from detecting failures 2015-07-26 15:22:09 -04:00
Mark Pictor ecde882d5a oops, forgot export macro for path2str 2015-07-26 14:32:43 -04:00
Mark Pictor 3d90ffdf83 remove yet more CORBA and ObjectStore stuff... surprised it still exists 2015-07-26 14:22:07 -04:00
Mark Pictor 5dfca2ed78 exp2py - remove unused function USEREFout 2015-07-26 14:20:24 -04:00
Mark Pictor fbf0272d3b indent a listdo/listod 2015-07-26 13:42:52 -04:00
Mark Pictor c69f9ebab2 fix length check for keyword detection function 2015-07-26 13:42:25 -04:00
Mark Pictor 942fb89f68 cleanup 2015-07-26 13:41:49 -04:00
Mark Pictor 893936b11f printf(...) -> fprintf( stderr, ...): warnings and errors should not be on stdout 2015-07-26 13:39:40 -04:00
Mark Pictor e4a8be26da resolve MSVC "unknown escape sequence" warning 2015-07-19 18:29:55 -04:00
Mark Pictor c63b3cc9b8 add CONTRIBUTING.md 2015-07-19 15:02:54 -04:00
Mark Pictor 2dace5da2e update CI-related stuff 2015-07-19 15:02:54 -04:00
Mark 7568033499 Merge pull request #344 from cshorler/python_p21_lexer_and_parser_improvements
Python p21 lexer and parser improvements
2015-07-12 17:41:14 -04:00
Mark 65b6869b30 Merge pull request #343 from cshorler/python_2_6_compatibility
Python 2.6 compatibility
2015-07-12 17:39:18 -04:00
Christopher Horler 915e0de65f simplification - invocation of t_STRING / t_BINARY guarantees we can use string slicing rather than strip() 2015-07-08 07:59:37 +01:00
Christopher Horler 9c83ba32a9 fix list / params handling 2015-07-07 18:46:19 +01:00
Christopher Horler 13f36c11a8 implement value conversions for simple types 2015-07-07 18:44:58 +01:00
Christopher Horler 6b26410d9d make default implementation take bigger "slurps" looking for PART21_START tokens 2015-07-06 23:55:16 +01:00
Christopher Horler 3e84677ac9 change handling of base_tokens to simplify subclass implementations 2015-07-06 23:52:27 +01:00
Christopher Horler 081cf35855 Update tests function to parse every .stp file in the stepcode tree
(assumes code is under ~/projects/src/stepcode)
2015-07-05 18:36:33 +01:00
Christopher Horler c1c3bc1077 Lexer improvements
- change way states are used, could give a substantial performance improvement
 - implement a more flexible approach for exchange_file start token search (more extensibile for subclassing)
 - rework/standardise keyword implementation for DATA token

Parser improvements
 - implement error handling for duplicate entity instances
   * parser catches the error, logs it
   * resyncs and continues (the duplicate is ignored)
 - rework the exchange_file structure detection
   * added parser.reset() to allow a more flexible approach to subclassing
2015-07-05 18:27:46 +01:00
Christopher Horler 6351ff38d9 Python 2.6
- replace another dict comprehension
 - ensure new style classes are used in Python 2.6
 - change the way the tokens list is used (improves ability to subclass)
2015-07-05 18:08:33 +01:00
Christopher Horler a82f7497a6 Python 2.6 doesn't have NullHandler or dict comprehensions 2015-07-05 17:30:40 +01:00
Mark 2a3e2a9abf Merge pull request #342 from cshorler/improve_extensibility_for_python_p21_handling
make Python Part21 lexer more extensible for writing custom parser rules
2015-06-26 15:26:40 -04:00
Christopher Horler eaf9ffc3f3 raise ValueError instead of sys.exit if input doesn't have valid header / or duplicate entity instances 2015-06-24 22:26:34 +01:00
Christopher Horler b72f4d404a fix typo in rule 2015-06-24 17:59:01 +01:00
Christopher Horler b31d8ef853 when subclassing due to ply's dir() usage to determine rules a start rule is necessary 2015-06-24 17:24:23 +01:00
Christopher Horler c865023114 files may contain multiple exchange structures, to allow for this add rudimentary state tracking 2015-06-24 17:22:49 +01:00
Christopher Horler 25ca2a788d make Python Part21 lexer more extensible for writing custom parser rules 2015-06-22 20:38:20 +01:00
Mark a80489dc96 Merge pull request #340 from stepcode/review/misc
warnings + misc
2015-06-14 21:25:25 -04:00
Mark Pictor 35170b388e give up on msbuild, seems to offer no benefits. go back to cmake --build 2015-06-14 21:23:08 -04:00
Mark Pictor d2680940ad disable 2 builds so appveyor will go faster 2015-06-14 19:00:28 -04:00
Mark Pictor e24ac2acd3 appveyor - print results from failed tests 2015-06-14 18:07:04 -04:00
Mark Pictor 903277f288 in appveyor summary, print errors first 2015-06-13 21:29:36 -04:00
Mark Pictor 5b2782a34c appveyor has grep, so use it on build output 2015-06-13 21:28:59 -04:00
Mark Pictor 97731f8611 warning about extra parens 2015-06-13 21:13:04 -04:00
Mark Pictor 272928d6e5 treat 'fatal error' as error; also ran go fmt 2015-06-13 21:13:04 -04:00
Mark Pictor 76944b3a90 powershell's select-string is an abomination... is grep in PATH? 2015-06-13 21:13:04 -04:00
Mark 8a270222c6 Merge pull request #341 from cshorler/mpictor/review-misc
remove strncpy as we're not using it anyway - fixes crash on enumerat…
2015-06-13 20:34:40 -04:00
Christopher Horler e8afb772f1 remove strncpy as we're not using it anyway - fixes crash on enumeration output 2015-06-13 15:35:32 +01:00
Mark Pictor 0eefd769e3 oops, use our own stdbool 2015-06-08 22:53:45 -04:00
Mark Pictor 1c8225f79a eliminate gcc warnings for exp2py 2015-06-08 22:40:38 -04:00
Mark Pictor 2d8a7373fd fix some MSVC warnings 2015-06-08 22:40:38 -04:00
Mark Pictor 2300021416 MSVC warning - multiple default constructors 2015-06-08 22:40:38 -04:00
Mark Pictor 91a2dcacf3 MSVC lacks __func__, use __FUNCTION__ instead 2015-06-08 22:40:38 -04:00
Mark Pictor 618deae50e add golang program to summarize msvc warnings/errors from appveyor 2015-06-08 22:40:38 -04:00
Mark Pictor 1aa78e7e48 make appveyor happier 2015-06-08 22:40:38 -04:00
Mark Pictor 4129d363b0 add stepcore test for segfault in STEPattribute::set_null() 2015-05-20 20:51:14 -04:00
Mark Pictor 619c927ecb update Doxyfile 2015-05-20 20:03:53 -04:00
Mark Pictor 89684015ae improve comments for doxygen 2015-05-20 20:03:47 -04:00
Mark Pictor 8423811031 delete makefile fragment 2015-05-20 20:02:09 -04:00
Mark 4f9ad1c75a Merge pull request #338 from ShabalinAnton/cllazyfile_fixes
Cllazyfile fixes
2015-05-19 19:30:41 -04:00
Anton Shabalin 0c34752882 1. Heap corruption error fixed at sectionReader
2. Win support added at lazyRefs
2015-05-19 11:21:11 +08:00
Mark 0b3ab924f8 Merge pull request #332 from pcjc2/speedup_instmgr
Speedup InstMgr by running PrettyTmpName() outside of search loops
2015-04-18 21:47:39 -04:00
Mark fae60fbe8c Merge pull request #334 from stepcode/mp/TypeName_temp_ref
returning pointer to temporary for type name
2015-04-14 22:54:35 -04:00
Mark Pictor 703654ae70 update use of AttrTypeName in test/scl2html.cc 2015-04-14 22:53:40 -04:00
Mark 9fca25bed6 Merge pull request #335 from stepcode/mp/supertype-parens
exppp - supertype parens
2015-04-14 21:07:35 -04:00
Mark Pictor 988d2614be add test for supertype andor parens 2015-04-12 23:23:24 -04:00
Mark Pictor 1a8282d5dc missing parens on supertype andor - #318 2015-04-12 22:59:29 -04:00
Mark Pictor 235d38a80c doxify comments 2015-04-12 22:16:25 -04:00
Mark Pictor cba6fec8d7 eliminate a reference to temporary, modify 2 funcs
modify AttrDescriptor::TypeName() and TypeDescriptor::AttrTypeName() - don't return
std::string::c_str()
2015-04-12 22:15:59 -04:00
Mark 1d2e33e575 Merge pull request #326 from cshorler/exp2python_remove_exppp_dependency
Exp2python remove exppp dependency
2015-04-12 15:31:56 -04:00
Peter Clifton 2829deb7cc Speedup InstMgr by running PrettyTmpName() outside of search loops
PrettyTmpName() came up fairly hot in at least one of these loops
when profiling loading and iterating over STEP files.
2015-04-12 19:48:08 +01:00
Christopher Horler c83f0792a1 remove unused TypeDescription function 2015-04-03 21:17:29 +01:00
Christopher Horler 482c7905f3 refactor expression output for Python (remove exppp dependency) 2015-04-03 21:08:47 +01:00
Christopher Horler 46b5e74596 remove exppp runtime dependency 2015-04-03 21:08:32 +01:00
Mark ec0443a446 Merge pull request #324 from cshorler/ap242ed1_fixes
Python - AP242ed1 fixes
2015-04-01 18:42:39 -05:00
Mark 6708334b37 Merge pull request #325 from ramcdona/FixUps
Fix ups
2015-03-29 18:29:01 -05:00
Christopher Horler 9025643a1b fix generation of TYPE ENUMERATION 2015-03-28 13:32:21 +00:00
Christopher Horler b996d835f5 use the Python standard library enum module to implement the EXPRESS ENUMERATION 2015-03-28 13:19:01 +00:00
Rob McDonald 48df74932a Remove unused real typedef. 2015-03-27 08:38:46 -07:00
Rob McDonald 3b0f0b33ea Add ExternalProject_add based build of ap203min example 2015-03-27 08:38:38 -07:00
Christopher Sean Morrison 167d1d7fab severity is unused, unname it 2015-03-27 11:19:56 -04:00
Christopher Sean Morrison abb43fcb6f remove unused (and duplicated) variable, quellage 2015-03-27 11:18:24 -04:00
Christopher Sean Morrison a2f2f41e66 quell warning about type mismatch. needs to be signed as the sdai instance could be -1. 2015-03-27 11:13:59 -04:00
Christopher Sean Morrison e68afbad49 respond to the TODO about neg values ever being used. they currently are, which cascades into a signed/unsigned mismatch down the line in the lazy loader. 2015-03-27 11:12:17 -04:00
Christopher Sean Morrison 33ff7c57dc quell compiler warnings (errors in later versions of llvm 3.6) about incompatible type assignment (expecting a pointer) 2015-03-27 10:59:34 -04:00
Christopher Horler 04a57d0f2a avoid subclassing boolean types in Python 2015-03-25 21:56:23 +00:00
Christopher Horler 062b0e6ae3 fix - use of local variable name "pass" in AP242 causes invalid python code 2015-03-23 19:50:59 +00:00
Mark 5c6ffc7dca Merge pull request #322 from cshorler/fix_hdr_install
fix header installation - remove sc_stdbool.h from src/base/CMakeLists.t...
2015-03-20 20:10:05 -04:00
Christopher Horler ea80885185 fix header installation - remove sc_stdbool.h from src/base/CMakeLists.txt, is already in include/CMakeLists.txt 2015-03-19 19:42:06 +00:00
Mark 8964d2ed05 Merge pull request #320 from stepcode/review/segfault
ap242 segfault
2015-02-23 20:36:36 -05:00
Mark f25fb9d968 Merge pull request #319 from stepcode/mp/msvc-warn
msvc warn
2015-02-22 22:24:00 -05:00
Mark Pictor 0336649b07 also delete these attrs in dtor 2015-02-22 22:20:56 -05:00
Mark Pictor bdcd5166e1 was returning Severity from a bool function 2015-02-19 20:23:16 -05:00
Mark Pictor dbbd0c63b6 cout -> std::cout 2015-02-19 20:23:15 -05:00
Mark Pictor cb771f628e int->bool in several places 2015-02-19 20:23:15 -05:00
Mark Pictor 2a17763354 fix msvc warnings in express/test/print_schemas.c 2015-02-17 20:19:52 -05:00
Mark Pictor 7f19877b1a fix msvc warnings in express/test/print_attrs.c 2015-02-17 20:17:32 -05:00
Mark Pictor 164355c640 fix LISTdo indentation for 2 loops 2015-02-16 21:48:09 -05:00
Mark Pictor 2c7ed5c826 add another loop to initialize any attrs missed by first loop 2015-02-16 21:46:09 -05:00
Mark Pictor 264db5d03c MSVC warning C4113: 'void (__cdecl *)()' != 'void (__cdecl *)(void)' 2015-02-16 20:58:37 -05:00
Mark Pictor 423d5e08f6 appveyor: run fewer tests 2015-02-16 20:58:37 -05:00
Mark Pictor ba6d0a1c0c add test and files for a p21read segfault.
like the 210e2 segfault, this one is probably related to SELECTs.
2015-02-16 20:58:15 -05:00
Mark 37cfaebb1f Merge pull request #313 from stepcode/review/split-stepaggregate
split STEPaggregate.cc,.h into small files
2015-02-16 20:54:26 -05:00
Mark Pictor f233ae0059 fix up includes after reorganizing STEPaggr code 2015-02-15 22:13:21 -05:00
Mark Pictor 7950f4db7e move GenericAggregate and co out of STEPaggregate.* 2015-02-15 22:13:21 -05:00
Mark Pictor ec5171fe27 move EntityAggregate and co out of STEPaggregate.* 2015-02-15 22:13:21 -05:00
Mark Pictor c962b1d391 move SelectAggregate and co out of STEPaggregate.* 2015-02-15 22:13:21 -05:00
Mark Pictor dc32b24f3f move StringAggregate and co out of STEPaggregate.* 2015-02-15 22:13:21 -05:00
Mark Pictor 57a3d9ca1a move BinaryAggregate and co out of STEPaggregate.* 2015-02-15 22:13:21 -05:00
Mark Pictor ef4d64a98e move EnumAggregate and co out of STEPaggregate.* 2015-02-15 22:13:21 -05:00
Mark Pictor b3047b4b1f move RealAggregate out of STEPaggregate files 2015-02-15 22:13:21 -05:00
Mark Pictor 4bac203373 move IntAggregate and IntNode out of STEPaggregate 2015-02-15 22:13:21 -05:00
Mark Pictor ad2e50b05d eliminate STEPattribute.inline.cc 2015-02-15 22:13:21 -05:00
Mark Pictor 3e8c468f67 tweak appveyor... almost there 2015-02-12 18:52:07 -05:00
Mark 0ccca0afc2 Merge pull request #312 from stepcode/mp/bigfiles
Split ExpDict up
2015-02-08 21:34:15 -05:00
Mark Pictor 7cbc9f84ce use sc_stdbool.h because old VS's lack stdbool. caught by appveyor 2015-02-08 20:04:31 -05:00
Mark Pictor e266db9b3f cmake can't find vs10 on appveyor, and didn't use right generator name for vs9 2015-02-08 20:04:03 -05:00
Mark Pictor 77000dd445 tweak appveyor again 2015-02-08 19:29:53 -05:00
Mark Pictor 1d784c8a90 finish splitting ExpDict up 2015-02-08 19:29:00 -05:00
Mark Pictor 5b68726a3c continue splitting ExpDict up 2015-02-08 19:22:54 -05:00
Mark Pictor d7b3129834 move more classes out of ExpDict.* 2015-02-08 17:51:06 -05:00
Mark Pictor 6e3e58df00 Registry.inline.cc -> Registry.cc 2015-02-08 17:51:06 -05:00
Mark Pictor 80eabe9e80 eliminate 'deleting void' compiler warning 2015-02-08 17:51:06 -05:00
Mark Pictor 5afcabf901 workaround Wfloat-equal warning
pretty sure we want the behavior that triggers the
warning, so use memcmp instead of == to compare floats
2015-02-08 17:51:06 -05:00
Mark Pictor 105cce4a9c unused variable warning 2015-02-08 17:51:05 -05:00
Mark Pictor cf11cad78a start breaking up ExpDict into small files 2015-02-08 17:51:05 -05:00
Mark Pictor 34c452e658 merge SingleLinkList.inline.cc into .cc, .h 2015-02-08 17:51:05 -05:00
Mark Pictor 7627b46e44 update .gitignore 2015-02-08 17:51:05 -05:00
Mark Pictor 10ba621ee1 yamllint.com is happy with this one. grumble grumble 2015-02-08 17:27:59 -05:00
Mark Pictor 5c63ccd6cf again... 2015-02-08 17:21:39 -05:00
Mark Pictor bc13835a01 need powershell for this env var use? 2015-02-08 17:19:05 -05:00
Mark Pictor 44b056f9e2 add appveyor.yml for windows continuous integration 2015-02-08 17:01:36 -05:00
Mark 061ec0dbc6 Merge pull request #311 from stepcode/review/update-schemas
Update schemas 209,210e3,242 from CD to IS
2015-02-08 15:36:13 -05:00
Mark Pictor b600f05bd2 tweak travis-ci more 2015-02-08 14:58:29 -05:00
Mark Pictor 719f39f489 update AP209 ATS files. enum element_order now has the _order prefix on its values
sed -i 's/CURVE_3D_ELEMENT_DESCRIPTOR(.LINEAR./CURVE_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER./g;' *.stp
sed -i 's/SURFACE_3D_ELEMENT_DESCRIPTOR(.LINEAR./SURFACE_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER./g;' *.stp
sed -i 's/SURFACE_3D_ELEMENT_DESCRIPTOR(.QUADRATIC./SURFACE_3D_ELEMENT_DESCRIPTOR(.QUADRATIC_ORDER./g;' *.stp
sed -i 's/VOLUME_3D_ELEMENT_DESCRIPTOR(.QUADRATIC./VOLUME_3D_ELEMENT_DESCRIPTOR(.QUADRATIC_ORDER./g;' *.stp
sed -i 's/VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR./VOLUME_3D_ELEMENT_DESCRIPTOR(.LINEAR_ORDER./g;' *.stp
2015-02-08 14:22:27 -05:00
Mark Pictor 2c6d346584 update bound callbacks to also work with derived attributes. discovered in ap209 IS 2015-02-08 14:22:27 -05:00
Mark Pictor abf41650ee travis-ci: print parts of ctest log on failure 2015-02-08 14:22:27 -05:00
Mark Pictor b2a8343741 fix cmake error encountered when testing is enabled and all schemas disabled 2015-02-08 14:22:27 -05:00
Mark Pictor ee32a0f923 new versions of ap242, ap210e3, ap209. all 3 are now IS, renamed accordingly
wget http://stepmod.cvs.sourceforge.net/viewvc/stepmod/stepmod/data/modules/ap210_electronic_assembly_interconnect_and_packaging_design/mim_lf.exp
wget http://stepmod.cvs.sourceforge.net/viewvc/stepmod/stepmod/data/modules/ap209_multidisciplinary_analysis_and_design/mim_lf.exp
wget http://stepmod.cvs.sourceforge.net/viewvc/stepmod/stepmod/data/modules/ap242_managed_model_based_3d_engineering/mim_lf.exp
2015-02-08 14:22:26 -05:00
Mark 2a760a1e12 Merge pull request #310 from stepcode/review/getopt
prefix optind, optarg, opterr with sc_ because emscripten complained
2015-02-08 12:00:02 -05:00
Mark Pictor 2014a75678 prefix optind, optarg, opterr with sc_ because emscripten complained 2015-02-01 19:56:23 -05:00
Mark 8cb5c79279 Merge pull request #309 from stepcode/review/parallel-ctest
fix annoying issue with parallel testing
2015-02-01 19:44:43 -05:00
Mark 62202523b8 Merge pull request #307 from stepcode/review/plib-crash
PLIB crash
2015-02-01 19:44:24 -05:00
Mark 9ce384b600 Merge pull request #308 from stepcode/review/msvc13
MSVC13
2015-01-27 20:11:05 -05:00
Mark Pictor 5aacdb2206 update travis yml - fix parallel test command, add osx 2015-01-26 21:56:38 -05:00
Mark Pictor 6ec39b58aa rework version_string logic - only write the file if the git commit (not timestamp) changes 2015-01-26 21:24:14 -05:00
Mark Pictor c975ab2380 remove simple, unused version of sc_stdbool.h
apparently I'd added it after the one in include. not sure why.
2015-01-26 19:31:17 -05:00
Anton Shabalin 1054952e1e Patch for MSVC2013 compilation 2015-01-26 19:04:28 -05:00
Mark Pictor 2216cf47d3 eliminate parser crash with PLIB Part 25 (#79)
This changes the lookup logic related to SELECTs to reject certain possibilities when there is clearly a better
alternative.

As a result, some "Possibly ambiguous implicit downcast" warnings will become "Implicit downcast" warnings.
2015-01-26 16:20:04 -05:00
Mark Pictor 365b787fff simplify plib prob schema 2015-01-19 21:32:06 -05:00
Mark Pictor 4b4a4029ed add rough schema exhibiting same problem as plib part 25 2015-01-18 16:08:25 -05:00
Mark c1892febc1 rename altered rendering of sample code block 2015-01-02 14:07:54 -05:00
Mark f0b2d97d00 NEWS: forgot to include BRL-CAD changes 2014-12-26 16:55:44 -05:00
Mark 1fa4927035 rename so travis-ci image will work (?!) 2014-12-26 15:24:51 -05:00
Mark 953021ec9d Merge pull request #303 from stepcode/review/inverse-attributes
inverse attributes...finally!
2014-12-26 15:12:05 -05:00
Mark Pictor c8f14a0821 bump version (0.8), update AUTHORS, NEWS for v0.8, add travis-ci build status to README 2014-12-26 15:10:00 -05:00
Mark 63049515d1 Merge pull request #300 from cshorler/python_properties_and_assert
Python properties and assert
2014-12-26 14:29:32 -05:00
Mark ca7487fa95 Merge pull request #299 from cshorler/investigate_ply_usage
Investigate Ply usage
2014-12-26 14:28:49 -05:00
Mark Pictor 0f5179e74b oops, forgot an include 2014-12-26 13:51:09 -05:00
Mark Pictor bfbd8df61e minor cleanup 2014-12-26 13:34:38 -05:00
Mark Pictor dfe69a923d bug in superInvAttrIter allowed null pointer return for ia 2014-12-26 13:34:38 -05:00
Mark Pictor 50452e8282 fix inv attr code in SDAI_Application_instance 2014-12-26 13:34:38 -05:00
Mark Pictor e74d4dc813 fix inverse attr initialization; attr was being found but it wasn't exiting the loop 2014-12-26 13:34:38 -05:00
Mark Pictor 653625f56a fix crash with lazy loading and unexpected newlines, found in cd209 files 2014-12-26 13:34:38 -05:00
Mark Pictor 5f702fb702 fix dumpComplexInst func, stupid mistake - was using wrong data member 2014-12-26 13:34:38 -05:00
Mark Pictor 8273ce1866 lazyRefs works now 2014-12-26 13:34:38 -05:00
Mark Pictor efb82853b7 don't print code for inverse data members, they're in iAMap now 2014-12-26 13:34:37 -05:00
Mark Pictor 37901afbbb redo attribute numbering, print inverse attr access members separately 2014-12-26 13:34:37 -05:00
Mark Pictor 6bac26d3c7 add index to struct Variable_, fix some whitespace 2014-12-26 13:34:37 -05:00
Mark Pictor ff3fd1f5e7 _complex is now bool, not int - update STEPcomplex ctors 2014-12-26 13:34:37 -05:00
Mark Pictor 9313b8e6ee move some attr-specific stuff from classes_entity to classes_attribute, also minor cleanup 2014-12-26 13:34:37 -05:00
Mark Pictor 921de860b0 closer... 2014-12-26 13:34:28 -05:00
Mark Pictor 5df2f69930 inching forward on inverse attrs 2014-12-26 13:32:24 -05:00
Mark Pictor 31bf315543 const correctness in superInvAttrIter 2014-12-26 13:32:24 -05:00
Mark Pictor 87c66bb4dc flesh out InitIAttrs() in eDesc, instance 2014-12-26 13:32:23 -05:00
Mark Pictor c91109b7b4 add functions to access schema class members 2014-12-26 13:32:23 -05:00
Mark Pictor febbb636fc allow const or non-const for ed iter 2014-12-26 13:32:23 -05:00
Mark Pictor 7976c8bee5 loop through ed's with inverse attrs, connecting them to what they point at 2014-12-26 13:32:23 -05:00
Mark Pictor 0b42b2fe89 oops, move eDesc initialization back into SdaiAll
otherwise, they may be initialized after being ref'd in attrDescs
2014-12-26 13:32:23 -05:00
Mark Pictor d36d12c6d3 fix failing schema 2014-12-26 13:32:23 -05:00
Mark Pictor 86bbc327fa cleanup 2014-12-26 13:32:23 -05:00
Mark Pictor c8cfac3acc some types still print in SdaiAll 2014-12-26 13:32:23 -05:00
Mark Pictor 9efd75ebc1 add some small schemas and a .p21; should be examined, maybe moved/simplified 2014-12-26 13:32:23 -05:00
Mark Pictor 98283dca34 more work on inverse attrs, code generation 2014-12-26 13:31:21 -05:00
Mark Pictor 65c703b811 work on inverse attrs 2014-12-26 13:29:08 -05:00
Mark Pictor 2374029ae8 cleanup 2014-12-26 13:29:08 -05:00
Mark Pictor c6d841789e initialize entity iAttrs using eDesc 2014-12-26 13:29:08 -05:00
Mark Pictor 14689c6db6 split ENTITYprint_new() into two, print into different files
* split into ENTITYprint_descriptors(), ENTITYprint_classes()
  * the former is now called from ENTITYprint_cc()
* make some changes to the args (don't pass ComplexCollect, just a bool)
2014-12-26 13:29:08 -05:00
Mark Pictor 01db3788a2 silence a signed-unsigned warning by using size_t 2014-12-26 13:29:07 -05:00
Mark Pictor 712d9657e8 improve comments, whitespace 2014-12-26 13:29:07 -05:00
Mark Pictor 168e7a93ed split up a 32-line fprintf 2014-12-26 13:29:07 -05:00
Mark Pictor 7ae34348be indents in generated code 2014-12-26 13:29:07 -05:00
Mark Pictor 1e95f8f61e remove LIBcopy_constructor() - unused since 1992(!) 2014-12-26 13:29:07 -05:00
Mark Pictor 4df86e5fea schema name changed for some p21 tests - update it 2014-12-26 13:29:07 -05:00
Mark Pictor 78427423ab redo some comments 2014-12-26 13:29:07 -05:00
Mark Pictor c2c0a6443b reformat some error message code, add one message for complex insts 2014-12-26 13:29:07 -05:00
Mark Pictor 674fa941f6 delete the array of names after creating a STEPcomplex 2014-12-26 13:29:07 -05:00
Mark Pictor 9db1170803 improve some comments in lazy loading code 2014-12-26 13:29:07 -05:00
Mark Pictor 7089bdbf5c when loading instance dependencies, seek to original position afterwards
otherwise, SDAI_Application_instance::STEPRead() will crash and burn when the file position changes on it
2014-12-26 13:29:07 -05:00
Mark Pictor 409315841b fix test dependency so 'make test ARGS=-jN' works 2014-12-26 13:29:07 -05:00
Mark Pictor 4bde538c65 add comment with express that fails 2014-12-26 13:28:54 -05:00
Mark Pictor 6955a03fca check for both aggr and non-aggr inverse attributes 2014-12-26 13:28:54 -05:00
Mark Pictor b31ffa3968 more changes to attrIsObj() 2014-12-26 13:28:22 -05:00
Mark Pictor 06bfc7d4d1 handle both aggr and non-aggr inverses 2014-12-26 13:28:21 -05:00
Mark Pictor 73b3c1b901 fix assertion - can either be aggregate or instance 2014-12-26 13:28:21 -05:00
Mark Pictor 66deaafb30 change behavior of attrIsObj() fn in classes_attribute 2014-12-26 13:27:02 -05:00
Mark Pictor 9e1d078b46 add 2 protos to classes_attribute header 2014-12-26 13:27:02 -05:00
Mark Pictor 31331651df modify const-ness in AGGRprint_access_methods 2014-12-26 13:27:02 -05:00
Mark Pictor 6117e532f8 move much of ATTRprint_access_methods into a series of smaller funcs 2014-12-26 13:27:02 -05:00
Mark Pictor b9db4568fe CONST -> const in a few more places 2014-12-26 13:27:02 -05:00
Mark Pictor ea24200c67 make STEPinvAttrList work with the new setter/getter variants 2014-12-26 13:27:02 -05:00
Mark Pictor acdc338c9d static setter/getter won't always have the same signature
detect whether to use sdaiApplicationInstance or EntityAggregate
2014-12-26 13:27:02 -05:00
Mark Pictor 9cf54cf374 add attrIsObj(), which returns true if const and non-const methods are sensible for a given var 2014-12-26 13:27:02 -05:00
Mark Pictor ea339e2ffa exp2cxx: move select getters into own function, print const and non-const 2014-12-26 13:27:01 -05:00
Mark Pictor 14d7b32320 remove duplicate function prototypes that masked a signature change 2014-12-26 13:27:01 -05:00
Mark Pictor 62ef3c6edd add const getter for string/bin attr's 2014-12-26 13:27:01 -05:00
Mark Pictor 521a999af9 change const getter for entity attr's 2014-12-26 13:27:01 -05:00
Mark Pictor 47d42ad558 invert sense of test in logging code - wouldn't print unless null 2014-12-26 13:27:01 -05:00
Mark Pictor f63835532b move string/binary access methods into 2 small funcs 2014-12-26 13:27:01 -05:00
Mark Pictor cd08570a3f print const and non-const getters for select attrs 2014-12-26 13:27:01 -05:00
Mark Pictor 4a01038cd0 fix a couple comments 2014-12-26 13:27:01 -05:00
Mark Pictor 3132089419 note that unity headers are probably useless since the main schema header includes all of the headers 2014-12-26 13:27:01 -05:00
Mark Pictor 5c0bea384c add braces and indenting to two LISTdo..LISTod's 2014-12-26 13:27:01 -05:00
Mark Pictor d64bbc3611 move count var so that derived attrs are counted
otherwise, the attr numbers in the ctor will be off by the number of preceding derived attrs
2014-12-26 13:27:01 -05:00
Mark Pictor 236778a5fc generated code: also print a const getter in class header when attr is a pointer type 2014-12-26 13:27:01 -05:00
Mark Pictor d6bb20d81b use instMgrBase in SDAI_Select operator test 2014-12-26 13:27:00 -05:00
Mark Pictor 6cb750a3eb don't print const for getter 2014-12-26 13:27:00 -05:00
Mark Pictor 118d8b295b merge with instMgrBase commit 2014-12-26 13:27:00 -05:00
Mark Pictor 64dd1d2a9a two libstructor_print calls missing neededAttr param 2014-12-26 13:27:00 -05:00
Mark Pictor 2ae605d5ae rename var - 'class' may not be a C keyword, but it's confusing 2014-12-26 13:27:00 -05:00
Mark Pictor 23a5a62397 formatting 2014-12-26 13:27:00 -05:00
Mark Pictor aaa1ca04a6 fix a few comments 2014-12-26 13:27:00 -05:00
Mark Pictor d4f13e0179 replace entity access member code with call to new func 2014-12-26 13:27:00 -05:00
Mark Pictor 800453e68a split entity methods out of ATTRprint_access_methods into 2 new funcs
second new func prints log stuff, called by other func 3x
2014-12-26 13:27:00 -05:00
Mark Pictor a74dc1d32c forgot to add 'const' keyword in several places after changing the ..._get_head() fn 2014-12-26 13:27:00 -05:00
Mark Pictor d9c89b9e94 when printing initializers, skip derived attrs 2014-12-26 13:27:00 -05:00
Mark Pictor fdcdd5a966 forgot to replace InstMgr with InstMgrBase in selects.c 2014-12-26 13:26:59 -05:00
Mark Pictor 7222c91c01 update inverse attr test 3 2014-12-26 13:26:59 -05:00
Mark Pictor 51acb993da whoops, don't pretend an instance can't be found if it is already loaded 2014-12-26 13:26:59 -05:00
Mark Pictor ebb7a920f2 use InstMgrBase instead of InstMgr in most stepcore classes
this is so that lazyInstMgr functions will be called when necessary
2014-12-26 13:26:59 -05:00
Mark Pictor f6078d8b5b eliminate unused buffer 2014-12-26 13:26:59 -05:00
Mark Pictor 4b3e433667 in generated c++: create data members for null pointers 2014-12-26 13:26:59 -05:00
Mark Pictor 1fddd17a64 in generated c++: ensure pointer is non-null before calling shallowCopy 2014-12-26 13:26:59 -05:00
Mark Pictor 647ecbcf99 in generated c++: ensure that pointers are zeroed (DataMemberInitializers()) 2014-12-26 13:26:59 -05:00
Mark Pictor ef2c01d76c in generated c++: in constructors, populate iAttrs
is populated with inverse attrs, setters, getters
2014-12-26 13:26:59 -05:00
Mark Pictor e17938afe8 generated c++: static setter/getter for inverse attrs 2014-12-26 13:26:59 -05:00
Mark Pictor d5f693a862 use STEPinvAttrList in sdaiApplication_Instance 2014-12-26 13:26:59 -05:00
Mark Pictor bd402b2567 add STEPinvAttrList for inv attr descs and setter/getter pointers
this will allow access to inverse attr values even with late binding, and is necessary to
set these attr values when the instances are being loaded
2014-12-26 13:26:59 -05:00
Mark Pictor ca560239ce use lazyRefs in lazyInstMgr 2014-12-26 13:26:55 -05:00
Mark Pictor b3b464632b trivial changes 2014-12-26 13:24:59 -05:00
Mark Pictor 0188910a3a add lazyRefs.h 2014-12-26 13:24:59 -05:00
Mark Pictor 35ead380af include subsuperiterators header 2014-12-26 13:24:59 -05:00
Mark Pictor b1387b731e improve comments, a few other small changes that don't affect behavior 2014-12-26 13:24:56 -05:00
Mark Pictor d1062cddfa use lazyInstMgr for inverse_attr3.cc 2014-12-26 13:21:52 -05:00
Mark Pictor 6e636d1c20 add variable names to some prototypes in ErrorDescriptor header 2014-12-26 13:21:52 -05:00
Mark Pictor f3cd328b24 add a FIXME 2014-12-26 13:21:52 -05:00
Mark Pictor 7867505fdc macro CONST -> const 2014-12-26 13:21:52 -05:00
Mark Pictor 57d3d2fe07 improve some comments for doxygen 2014-12-26 13:21:52 -05:00
Mark Pictor 259750e31e split a big fprintf up for readability 2014-12-26 13:21:52 -05:00
Mark Pictor 9144443d69 doxify comments in classes_misc.c 2014-12-26 13:21:52 -05:00
Mark Pictor 6004ba458b remove outdated comment from inverse_attr2.cc 2014-12-26 13:21:52 -05:00
Mark Pictor 2d060e7cc3 minor changes to judyLArray.h, judy.c 2014-12-26 13:21:52 -05:00
Mark Pictor 6419146cf1 functions to look up instance type in file 2014-12-26 13:21:47 -05:00
Mark Pictor ffd0da9ceb default to case insensitive when searching by instance type 2014-12-26 13:08:08 -05:00
Mark Pictor bf39d90382 _mainRegistry wasn't initialized 2014-12-26 13:08:07 -05:00
Mark Pictor 5b14529f63 warning about comparison that was always true 2014-12-26 13:08:07 -05:00
Mark Pictor 60141ce6f7 abstract class with non-virtual destructor 2014-12-26 13:08:07 -05:00
Christopher Horler 4515ffca43 improvements to error handling
* Lexer now has a compatibility mode for entity names not all in uppercase
* Lexer now takes an extra argument header_limit, input is searched for
  valid start point, extra text up to header_limit is ignored.
2014-06-22 20:38:52 +01:00
Christopher Horler 4e90ff65e8 add logging to module, and mapping of lexer attributes lineno and lexpos to improve error messages 2014-06-22 12:11:56 +01:00
Christopher Horler e18b6d5c2a check for duplicate entity definitions in input 2014-06-20 22:34:38 +01:00
Christopher Horler ecaa9ba13f Update Python syntax and class definitions / style
- properties now use the @property decorator
- the assert statement is used in some places to enable disabling checks
2014-06-18 00:35:47 +01:00
Christopher Horler 53fac955ba add debug option to parse, add support to lexer for entity keywords 2014-06-17 22:17:37 +01:00
Christopher Horler aee532dd14 Use Ply for parser implementation 2014-06-17 20:07:06 +01:00
Christopher Horler 5840883239 add 'build' subdir ignores for CMake and Python 2014-06-17 19:59:01 +01:00
279 changed files with 98910 additions and 102931 deletions
+65
View File
@@ -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)
+3
View File
@@ -0,0 +1,3 @@
/build
*.kdev4
.kdev_include_paths
+8 -1
View File
@@ -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
+6 -1
View File
@@ -5,21 +5,26 @@ http://brlcad.svn.sourceforge.net/viewvc/brlcad/brlcad/trunk/src/other/step/?vie
In alphabetical order:
Bertucat, Roch (rbertucat)
Bowman, W. Keith (indianlarry)
da Costa, Raphael Kubo (rakuco)
DeGraw, Jason (jasondegraw)
Easterbrook, Zach (lainiwakurax)
Greenwald, Erik (erikg, erikgreenwald)
Horler, Chris (cshorler)
Lanning, Craig (craigl64)
Loman, David (davidloman)
McDonald, Rob (ramcdona)
Mittal, Pulkit (hoiji09)
Morrison, Christopher Sean (sean, morrison, brlcad)
Paviot, Thomas (tpaviot)
Pictor, Mark (mpictor)
Reed, Nick (nickreed)
Shah, Kesha (kesha)
Shah, Kesha (kesha, keshashah)
Thomas, Dawn (homovulgaris, madant)
Wouters, Dave (davyw)
Yapp, Clifford (starseeker)
Special thanks:
Hunten, Keith (Lockheed Martin)
Lubbell, Joshua (NIST)
Stirk, Charlie (CostVision)
Thurman, Tom (TRThurman)
+14 -11
View File
@@ -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:
+45
View File
@@ -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/
+22
View File
@@ -1,4 +1,26 @@
STEPcode -- http://github.com/stepcode/stepcode -- http://stepcode.org
************************************************************************
Release 0.8 (December, 2014)
New since v0.7:
* handle diamond inheritance, derived Attributes
* rename fedex_python, fedex_plus to exp2py, exp2cxx
* many changes to the pretty printer, due to use in reformatting draft
and IS schemas (Thanks Tom!)
* parser was also changed due to errors caught while pretty printing
- we can be much more confident that the parser is correct now
* fix incorrect quoting of timestamp in p21 header
* fix various copy constructors and ShallowCopy() members
* split generated code into many small files
- far easier to open generated code in editors
- support more compilers
- small files are combined (via #include statements) into a few
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!
************************************************************************
Release 0.7 (April, 2013)
+15 -8
View File
@@ -1,5 +1,10 @@
Travis-CI | AppVeyor CI
:-------------:|:---------------:
Linux, OSX (LLVM) | Windows (MSVC)
[![Build Status](https://travis-ci.org/stepcode/stepcode.svg?branch=master)](https://travis-ci.org/stepcode/stepcode) | [![Build status](https://ci.appveyor.com/api/projects/status/3fbr9t9gfa812oqu?svg=true)](https://ci.appveyor.com/project/mpictor/stepcode)
***********************************************************************
STEPcode v0.7 -- stepcode.org, github.com/stepcode/stepcode
STEPcode v0.8 -- stepcode.org, github.com/stepcode/stepcode
* What is STEPcode? SC reads ISO10303-11 EXPRESS schemas and generates
C++ source code that can read and write Part 21 files conforming
@@ -32,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)
@@ -54,4 +61,4 @@ Download astyle from http://sourceforge.net/projects/astyle/files/astyle/
***********************************************************************
For more info, see the wiki.
For more info, see the wiki.
+1 -1
View File
@@ -1 +1 @@
0.7
0.8
-91
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
+1 -15
View File
@@ -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
-146
View File
@@ -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
-134
View File
@@ -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
+22
View File
@@ -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
+1 -1
View File
@@ -65,7 +65,7 @@ macro(SCHEMA_TESTS)
COMMAND ${CMAKE_COMMAND} --build .
--target lazy_${PROJECT_NAME}
--config $<CONFIGURATION>)
set_tests_properties(build_lazy_cpp_${PROJECT_NAME} PROPERTIES DEPENDS generate_cpp_${PROJECT_NAME} LABELS cpp_schema_build)
set_tests_properties(build_lazy_cpp_${PROJECT_NAME} PROPERTIES DEPENDS build_cpp_${PROJECT_NAME} LABELS cpp_schema_build)
endif(NOT WIN32)
endmacro(SCHEMA_TESTS)
+58 -21
View File
@@ -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 )
-6
View File
@@ -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
View File
@@ -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)
+15 -23
View File
@@ -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)
-102
View 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
+35
View File
@@ -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
+30
View File
@@ -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
+15 -6
View File
@@ -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)
+6 -6
View File
@@ -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)
-39
View File
@@ -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
View File
@@ -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
View File
@@ -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 ) );
+3 -2
View File
@@ -76,10 +76,11 @@ typedef struct Variable_ * Variable;
/***************************/
struct Variable_ {
Expression name; /**< Symbol is inside of 'name' */
Expression name; /**< Symbol is inside of 'name' */
Type type;
Expression initializer; /**< or 'derived' */
int offset; /**< used for attr order in Entitys, and for decl order in LOCAL vars. these two uses should never conflict! */
int offset; /**< used for attr order in Entitys, and for decl order in LOCAL vars. these two uses should never conflict! */
int idx; /**< used in exp2cxx to simplify calculation of attrDescriptor names in generated code */
struct {
unsigned int optional : 1; /**< OPTIONAL keyword */
+2
View File
@@ -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 */
+1 -1
View File
@@ -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
+3 -1
View File
@@ -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>
+330
View File
@@ -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
View File
@@ -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()
+21
View File
@@ -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
+4 -2
View File
@@ -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
@@ -903,8 +904,9 @@ JudySlot * judy_last( Judy * judy, JudySlot next, unsigned int off, unsigned int
JudySlot * judy_end( Judy * judy ) {
judy->level = 0;
return judy_last( judy, *judy->root, 0, 0 );
} // judy_nxt: return next entry
}
// judy_nxt: return next entry
JudySlot * judy_nxt( Judy * judy ) {
JudySlot * table, *inner;
int slot, size, cnt;
+1 -1
View File
@@ -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];
+12 -8
View File
@@ -29,14 +29,16 @@ struct judylKVpair {
*/
template< typename JudyKey, typename JudyValue >
class judyLArray {
public:
typedef judylKVpair< JudyKey, JudyValue > pair;
protected:
Judy * _judyarray;
unsigned int _maxLevels, _depth;
JudyValue * _lastSlot;
JudyKey _buff[1];
bool _success;
pair _kv;
public:
typedef judylKVpair< JudyKey, JudyValue > pair;
judyLArray(): _maxLevels( sizeof( JudyKey ) ), _depth( 1 ), _lastSlot( 0 ), _success( true ) {
assert( sizeof( JudyKey ) == JUDY_key_size && "JudyKey *must* be the same size as a pointer!" );
assert( sizeof( JudyValue ) == JUDY_key_size && "JudyValue *must* be the same size as a pointer!" );
@@ -55,9 +57,12 @@ class judyLArray {
judy_close( _judyarray );
}
void clear() {
void clear( bool deleteContents = false ) {
JudyKey key = 0;
while( 0 != ( _lastSlot = ( JudyValue * ) judy_strt( _judyarray, ( const unsigned char * ) &key, 0 ) ) ) {
if( deleteContents ) {
delete *_lastSlot;
}
judy_del( _judyarray );
}
}
@@ -112,18 +117,17 @@ class judyLArray {
}
/// retrieve the key-value pair for the most recent judy query.
inline const pair mostRecentPair() {
pair kv;
inline const pair & mostRecentPair() {
judy_key( _judyarray, ( unsigned char * ) _buff, _depth * JUDY_key_size );
if( _lastSlot ) {
kv.value = *_lastSlot;
_kv.value = *_lastSlot;
_success = true;
} else {
kv.value = ( JudyValue ) 0;
_kv.value = ( JudyValue ) 0;
_success = false;
}
kv.key = _buff[0];
return kv;
_kv.key = _buff[0];
return _kv;
}
/// retrieve the first key-value pair in the array
+1 -1
View File
@@ -191,7 +191,7 @@ class judyS2Array {
kv.value = *_lastSlot;
_success = true;
} else {
kv.value = ( JudyValue ) 0;
kv.value = NULL;
_success = false;
}
kv.key = _buff;
+29
View File
@@ -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;
}
+20
View File
@@ -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 */
+1
View File
@@ -6,6 +6,7 @@
#ifdef __cplusplus
#include <iostream>
#include <iosfwd>
#include <string>
#include "sc_memmgr.h"
+31 -31
View File
@@ -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 '?';
}
+2 -2
View File
@@ -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 );
+6 -6
View File
@@ -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();
+13
View File
@@ -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
-12
View File
@@ -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 */
+4 -4
View File
@@ -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"
+5 -14
View File
@@ -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
*/
+1
View File
@@ -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() );
}
+8 -5
View File
@@ -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,
+3 -3
View File
@@ -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 ) {
+4 -7
View File
@@ -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 -1
View File
@@ -27,7 +27,7 @@ class SC_LAZYFILE_EXPORT headerSectionReader: public sectionReader {
return _headerInstances;
}
~headerSectionReader() {
virtual ~headerSectionReader() {
//FIXME delete each instance?! maybe add to clear, since it iterates over everything already
//enum clearHow { rawData, deletePointers }
_headerInstances->clear();
+9 -5
View File
@@ -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: protected MgrNode {
class SC_LAZYFILE_EXPORT mgrNodeHelper: public MgrNodeBase {
protected:
lazyInstMgr * _lim;
instanceID _id;
@@ -22,13 +25,13 @@ class mgrNodeHelper: protected MgrNode {
mgrNodeHelper( lazyInstMgr * lim ) {
_lim = lim;
_id = 0;
prev = next = 0;
}
inline void setInstance( instanceID id ) {
_id = id;
}
inline SDAI_Application_instance * GetSTEPentity() {
// unsigned int c = _lim->countDataSections();
return _lim->loadInstance( _id );
return _lim->loadInstance( _id, true );
}
};
@@ -40,13 +43,14 @@ class mgrNodeHelper: protected MgrNode {
* when an instance is looked up, this uses lazyInstMgr to load it, and then returns a pointer to it.
*/
class instMgrAdapter: public InstMgr {
class SC_LAZYFILE_EXPORT instMgrAdapter: public InstMgrBase {
protected:
mgrNodeHelper _mn;
public:
instMgrAdapter( lazyInstMgr * lim ): InstMgr( 0 ), _mn( lim ) {}
instMgrAdapter( lazyInstMgr * lim ): InstMgrBase(), _mn( lim ) {}
inline mgrNodeHelper * FindFileId( int fileId ) {
//TODO check if fileId exists. if not, return null
_mn.setInstance( fileId );
return &_mn;
}
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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() );
+38 -10
View File
@@ -1,8 +1,12 @@
#include "lazyTypes.h"
#include "lazyInstMgr.h"
#include "Registry.h"
#include <SubSuperIterators.h>
#include "SdaiSchemaInit.h"
#include "instMgrHelper.h"
#include "lazyRefs.h"
#include "sdaiApplication_instance.h"
lazyInstMgr::lazyInstMgr() {
_headerRegistry = new Registry( HeaderSchemaInit );
@@ -10,6 +14,7 @@ lazyInstMgr::lazyInstMgr() {
_lazyInstanceCount = 0;
_loadedInstanceCount = 0;
_longestTypeNameLen = 0;
_mainRegistry = 0;
_errors = new ErrorDescriptor();
_ima = new instMgrAdapter( this );
}
@@ -38,7 +43,7 @@ sectionID lazyInstMgr::registerDataSection( lazyDataSectionReader * sreader ) {
void lazyInstMgr::addLazyInstance( namedLazyInstance inst ) {
_lazyInstanceCount++;
assert( inst.loc.begin > 0 && inst.loc.instance > 0 && inst.loc.section >= 0 );
assert( inst.loc.begin > 0 && inst.loc.instance > 0 );
int len = strlen( inst.name );
if( len > _longestTypeNameLen ) {
_longestTypeNameLen = len;
@@ -46,8 +51,12 @@ void lazyInstMgr::addLazyInstance( namedLazyInstance inst ) {
}
_instanceTypes->insert( inst.name, inst.loc.instance );
/* store 16 bits of section id and 48 of instance offset into one 64-bit int
* TODO: check and warn if anything is lost (in calling code?)
* does 32bit need anything special?
** TODO: check and warn if anything is lost (in calling code?)
** does 32bit need anything special?
**
** create conversion class?
** could then initialize conversion object with number of bits
** also a good place to check for data loss
*/
positionAndSection ps = inst.loc.section;
ps <<= 48;
@@ -85,18 +94,29 @@ unsigned long lazyInstMgr::getNumTypes() const {
}
void lazyInstMgr::openFile( std::string fname ) {
_files.push_back( new lazyFileReader( fname, this, _files.size() ) );
//don't want to hold a lock for the entire time we're reading the file.
//create a place in the vector and remember its location, then free lock
///FIXME begin atomic op
size_t i = _files.size();
_files.push_back( (lazyFileReader * ) 0 );
///FIXME end atomic op
lazyFileReader * lfr = new lazyFileReader( fname, this, i );
_files[i] = lfr;
/// TODO resolve inverse attr references
//between instances, or eDesc --> inst????
}
SDAI_Application_instance * lazyInstMgr::loadInstance( instanceID id ) {
SDAI_Application_instance * lazyInstMgr::loadInstance( instanceID id, bool reSeek ) {
assert( _mainRegistry && "Main registry has not been initialized. Do so with initRegistry() or setRegistry()." );
SDAI_Application_instance * inst = 0;
std::streampos oldPos;
positionAndSection ps;
sectionID sid;
inst = _instancesLoaded.find( id );
SDAI_Application_instance * inst = _instancesLoaded.find( id );
if( inst ) {
return inst;
}
instanceStreamPos_t::cvector * cv;
if( !inst && 0 != ( cv = _instanceStreamPos.find( id ) ) ) {
//FIXME _instanceStreamPos.find( id ) can return nonzero for nonexistent key?!
if( 0 != ( cv = _instanceStreamPos.find( id ) ) ) {
switch( cv->size() ) {
case 0:
std::cerr << "Instance #" << id << " not found in any section." << std::endl;
@@ -107,15 +127,23 @@ SDAI_Application_instance * lazyInstMgr::loadInstance( instanceID id ) {
off = ps & 0xFFFFFFFFFFFFULL;
sid = ps >> 48;
assert( _dataSections.size() > sid );
if( reSeek ) {
oldPos = _dataSections[sid]->tellg();
}
inst = _dataSections[sid]->getRealInstance( _mainRegistry, off, id );
if( reSeek ) {
_dataSections[sid]->seekg( oldPos );
}
break;
default:
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 );
lazyRefs::referentInstances_t insts = lr.result();
} else {
std::cerr << "Error loading instance #" << id << "." << std::endl;
}
+63 -19
View File
@@ -11,6 +11,7 @@
#include "Registry.h"
#include "sc_memmgr.h"
#include "sc_export.h"
#include "judyLArray.h"
#include "judySArray.h"
@@ -20,13 +21,13 @@
class Registry;
class instMgrAdapter;
class lazyInstMgr {
class SC_LAZYFILE_EXPORT lazyInstMgr {
protected:
/** map from instance number to instances that it refers to
/** multimap from instance number to instances that it refers to
* \sa instanceRefs_pair
*/
instanceRefs_t _fwdInstanceRefs;
/** map from instance number to instances that refer to it
/** multimap from instance number to instances that refer to it - the majority of these will not be inverse references!
* \sa instanceRefs_pair
*/
instanceRefs_t _revInstanceRefs;
@@ -39,11 +40,15 @@ class lazyInstMgr {
/** map from instance number to instance pointer (loaded instances only)
* \sa instancesLoaded_pair
*
* TODO should be multimap to allow use of instances in multiple data sections?
* a unique instance ID (containing sectionID and instanceID) would also work
*/
instancesLoaded_t _instancesLoaded;
/** map from instance number to beginning and end positions and the data section
* \sa instanceStreamPos_pair
*
* FIXME to save memory, modify judyL2Array to not use a vector until there are several
* instances with the same instanceID. This will help elsewhere as well.
*/
@@ -65,12 +70,11 @@ class lazyInstMgr {
public:
lazyInstMgr();
~lazyInstMgr();
void addSchema( void ( *initFn )() ); //?
void openFile( std::string fname );
void addLazyInstance( namedLazyInstance inst );
instMgrAdapter * getAdapter() {
return _ima;
InstMgrBase * getAdapter() {
return ( InstMgrBase * ) _ima;
}
instanceRefs_t * getFwdRefs() {
@@ -80,8 +84,14 @@ class lazyInstMgr {
instanceRefs_t * getRevRefs() {
return & _revInstanceRefs;
}
/// returns two iterators delimiting the instances that match `type`
instanceTypes_t::cvector * getInstances( std::string type ) { /*const*/
/// returns a vector containing the instances that match `type`
instanceTypes_t::cvector * getInstances( std::string type, bool caseSensitive = false ) { /*const*/
if( !caseSensitive ) {
std::string::iterator it = type.begin();
for( ; it != type.end(); ++it ) {
*it = toupper( *it );
}
}
return _instanceTypes->find( type.c_str() );
}
/// get the number of instances of a certain type
@@ -140,28 +150,62 @@ class lazyInstMgr {
unsigned long getNumTypes() const;
sectionID registerDataSection( lazyDataSectionReader * sreader );
fileID registerLazyFile( lazyFileReader * freader );
ErrorDescriptor * getErrorDesc() {
return _errors;
}
SDAI_Application_instance * loadInstance( instanceID id );
/** returns a pointer to an instance, loading it if necessary.
* \param id the instance number to look for
* \param reSeek if true, reset file position to current position when done. only necessary when loading an instance with dependencies; excessive use will cause a performance hit
*/
SDAI_Application_instance * loadInstance( instanceID id, bool reSeek = false );
//list all instances that one instance depends on (recursive)
instanceSet * instanceDependencies( instanceID id );
bool isLoaded( instanceID id ) {
_instancesLoaded.find( id );
return _instancesLoaded.success();
}
const char * typeFromFile( instanceID id ) {
instanceStreamPos_t::cvector * cv;
cv = _instanceStreamPos.find( id );
if( cv ) {
if( cv->size() != 1 ) {
std::cerr << "Error at " << __FILE__ << ":" << __LINE__ << " - multiple instances (" << cv->size() << ") with one instanceID (" << id << ") not supported yet." << std::endl;
return 0;
}
positionAndSection ps = cv->at( 0 );
//extract p, s, call
long int off = ps & 0xFFFFFFFFFFFFULL;
sectionID sid = ps >> 48;
return _dataSections[sid]->getType( off );
}
std::cerr << "Error at " << __FILE__ << ":" << __LINE__ << " - instanceID " << id << " not found." << std::endl;
return 0;
}
// TODO implement these
/* * the opposite of instanceDependencies() - all instances that are *not* dependencies of one particular instance
same as above, but with list of instances */
//std::vector<instanceID> notDependencies(...)
//renumber instances so that they are numbered 1..N where N is the total number of instances
//void normalizeInstanceIds();
//find data that is repeated and eliminate, if possible
//void eliminateDuplicates();
//tell instMgr to use instances from this section
//void useDataSection( sectionID id );
// add another schema to registry
//void addSchema( void ( *initFn )() );
//list all instances that one instance depends on (recursive)
//std::vector<instanceID> instanceDependencies( instanceID id ); //set is faster?
/* * the opposite of instanceDependencies() - all instances that are *not* dependencies of one particular instance
same as above, but with list of instances */
//std::vector<instanceID> notDependencies(...)
//renumber instances so that they are numbered 1..N where N is the total number of instances
//void normalizeInstanceIds();
//find data that is repeated and eliminate, if possible
//void eliminateDuplicates();
//tell instMgr to use instances from this section
//void useDataSection( sectionID id );
// TODO support references from one file to another
};
+1 -1
View File
@@ -43,6 +43,7 @@ lazyP21DataSectionReader::lazyP21DataSectionReader( lazyFileReader * parent, std
}
// part of readdata1
//if this changes, probably need to change sectionReader::getType()
const namedLazyInstance lazyP21DataSectionReader::nextInstance() {
std::streampos end = -1;
namedLazyInstance i;
@@ -53,7 +54,6 @@ const namedLazyInstance lazyP21DataSectionReader::nextInstance() {
if( ( _file.good() ) && ( i.loc.instance > 0 ) ) {
skipWS();
i.loc.section = _sectionID;
skipWS();
i.name = getDelimitedKeyword( ";( /\\" );
if( _file.good() ) {
end = seekInstanceEnd( & i.refs );
+295
View File
@@ -0,0 +1,295 @@
#ifndef LAZYREFS_H
#define LAZYREFS_H
#include <string>
#include <set>
#include <utility>
#include <vector>
#include "sc_export.h"
#include "lazyTypes.h"
#include "lazyInstMgr.h"
#include "ExpDict.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
* ----------- -----
* ia->Name() isdefinedby
* ia->inverted_attr_id_() relatedobjects
* ia->inverted_entity_id_() reldefinesbytype
*
* 1. for the instance in question, find inverse attrs with recursion
* 2. look up references to the current instance (_r)
* a. for each item in _r, look up its type and add mapping (instanceID -> char* typestring) to _refMap
* 3. for each ia,
* a. entity name is returned by ia->inverted_entity_id_()
* b. add this entity and its children to a list ( edL )
* c. compare the type of each item in _refMap with types in edL; for types in both, remember the instance number ( _referentInstances )
* d. load each instance in _referentInstances
* e. check if the relevant inverted attr of instances loaded from _referentInstances reference the instance in step 1; if not, unload **IF** the instance hadn't been loaded
* --> if it was loaded, this implies that it is used elsewhere
* f. (optional / TODO ) for performance, cache list edL - it may be useful in the future
* -- best to store such that the most recently (frequently?) used lists are retained and others are discarded
*/
/* ****
* ALTERNATE for 2a, 3c:
* for each type t in edL, use lim->getInstances( t ) to get a list of instances of that type, Lt
* for each instance i in Lt, check if it is in _r
* if so, load it
* BENEFIT: no need to write lazyInstMgr::getTypeStr() (however, it might be necessary in the future regardless)
*/
//TODO screen out intances that appear to be possible inverse refs but aren't actually
// note - doing this well will require major changes, since each inst automatically loads every instance that it references
//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 SC_LAZYFILE_EXPORT lazyRefs {
public:
typedef std::set< instanceID > referentInstances_t;
protected:
typedef std::set< const Inverse_attribute * > iaList_t;
typedef judyLArray< instanceID, std::string * > refMap_t;
typedef std::set< const EntityDescriptor * > edList_t;
iaList_t _iaList;
lazyInstMgr * _lim;
instanceID _id;
refMap_t _refMap;
referentInstances_t _referentInstances;
SDAI_Application_instance * _inst;
void checkAnInvAttr( const Inverse_attribute * ia ) {
const EntityDescriptor * ed;
const Registry * reg = _lim->getMainRegistry();
ed = reg->FindEntity( ia->_inverted_entity_id );
subtypesIterator subtypeIter( ed );
edList_t edL;
edL.insert( ed );
// 3b - use subtypeIter to add to edL
for( ; !subtypeIter.empty(); ++subtypeIter ) {
edL.insert( *subtypeIter );
}
//3c - for each item in both _refMap and edL, add it to _referentInstances
potentialReferentInsts( edL );
//3d - load each inst
iAstruct ias = invAttr( _inst, ia );
referentInstances_t::iterator insts = _referentInstances.begin();
for( ; insts != _referentInstances.end(); ++insts ) {
loadInstIFFreferent( *insts, ias, ia );
}
//3f - cache edL - TODO
}
void loadInstIFFreferent( instanceID inst, iAstruct ias, const Inverse_attribute * ia ) {
bool prevLoaded = _lim->isLoaded( inst );
SDAI_Application_instance * rinst = _lim->loadInstance( inst );
bool ref = refersToCurrentInst( ia, rinst );
if( ref ) {
if( ia->inverted_attr_()->IsAggrType() ) {
if( !ias.a ) {
ias.a = new EntityAggregate;
_inst->setInvAttr( ia, ias );
assert( invAttr( _inst, ia ).a == ias.a );
}
EntityAggregate * ea = ias.a;
//TODO check if duplicate
ea->AddNode( new EntityNode( rinst ) );
} else {
SDAI_Application_instance * ai = ias.i;
if( !ai ) {
ias.i = rinst;
_inst->setInvAttr( ia, ias );
} 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;
// TODO _error->GreaterSeverity( SEVERITY_INPUT_ERROR );
}
}
} else {
if( !prevLoaded ) {
//TODO _lim->unload( inst ); //this should keep the inst loaded for now, but put it in a list of ones that can be unloaded if not accessed
}
}
}
///3e - check if actually inverse ref
bool refersToCurrentInst( const Inverse_attribute * ia, SDAI_Application_instance * referrer ) {
//find the attr
int rindex = attrIndex( referrer, ia->_inverted_attr_id, ia->_inverted_entity_id );
STEPattribute sa = referrer->attributes[ rindex ];
assert( sa.getADesc()->BaseType() == ENTITY_TYPE );
bool found = false;
if( sa.getADesc()->IsAggrType() ) {
//aggregate - search for current inst id
EntityAggregate * aggr = dynamic_cast< EntityAggregate * >( sa.Aggregate() );
assert( aggr );
EntityNode * en = ( EntityNode * ) aggr->GetHead();
while( en ) {
if( en->node == _inst ) {
found = true;
break;
}
en = ( EntityNode * ) en->NextNode();
}
} else {
//single instance
assert( sa.getADesc()->NonRefType() == ENTITY_TYPE );
if( sa.Entity() == _inst ) {
found = true;
}
}
if( !found ) {
std::cerr << "inst #" << _inst->FileId() << " not found in #" << referrer->FileId();
std::cerr << ", attr #" << rindex << " [contents: ";
referrer->STEPwrite( std::cerr );
std::cerr << "]" << std::endl;
}
return found;
}
int attrIndex( SDAI_Application_instance * inst, const char * name, const char * entity ) {
for( int i = 0; i < inst->attributes.list_length(); i++ ) {
// std::cout << "attr " << i << " name " << inst->attributes[i].Name() << ", entity " << inst->EntityName() << std::endl;
if( ( strcasecmp( name, inst->attributes[i].Name() ) == 0 ) &&
( strcasecmp( entity, inst->attributes[i].getADesc()->Owner().Name() ) == 0 ) ) {
return i;
}
}
return -1;
}
iAstruct invAttr( SDAI_Application_instance * inst, const Inverse_attribute * ia /*, iaList_t & iaList */ ) {
SDAI_Application_instance::iAMap_t map = inst->getInvAttrs();
SDAI_Application_instance::iAMap_t::iterator iai = map.begin();
while( iai != map.end() ) {
if( iai->first == ia ) {
return iai->second;
}
++iai;
}
std::cerr << "Error! inverse attr " << ia->Name() << " (" << ia << ") not found in iAMap for entity " << inst->getEDesc()->Name() << std::endl;
abort();
iAstruct nil = {nullptr};
return nil;
}
/** 3c. compare the type of each item in R with types in A
* for items that match, remember the instance number (list C)
*/
void potentialReferentInsts( edList_t & edL ) {
refMap_t::pair kv = _refMap.begin();
while( kv.value != 0 ) {
std::set< const EntityDescriptor * >::iterator edi = edL.begin();
for( ; edi != edL.end(); ++edi ) {
if( 0 == strcasecmp( kv.value->c_str(), ( *edi )->Name() ) ) {
_referentInstances.insert( kv.key );
break;
}
}
kv = _refMap.next();
}
}
///find any inverse attributes, put in `iaList`
/// attrs not necessarily in order!
void getInverseAttrs( const EntityDescriptor * ed, iaList_t & iaList ) {
iaList.clear();
supertypesIterator supersIter( ed );
const Inverse_attribute * iAttr;
for( ; !supersIter.empty(); ++supersIter ) {
//look at attrs of *si
InverseAItr iai( &( ( *supersIter )->InverseAttr() ) );
while( 0 != ( iAttr = iai.NextInverse_attribute() ) ) {
iaList.insert( iAttr );
}
}
// look at our own attrs
InverseAItr invAttrIter( &( ed->InverseAttr() ) );
while( 0 != ( iAttr = invAttrIter.NextInverse_attribute() ) ) {
iaList.insert( iAttr );
}
}
// 2. find reverse refs
//2a. convert to map where K=instanceID and V=char*
// rather than keeping each V in memory or trying to free non-unique ones, look up each type in the Registry and use that pointer
bool mapRefsToTypes() {
_refMap.clear( true ); // true -> use delete on pointers
instanceRefs_t::cvector * refs = _lim->getRevRefs()->find( _id );
if( !refs || refs->empty() ) {
return false;
}
instanceRefs_t::cvector::const_iterator it;
for( it = refs->begin(); it != refs->end(); ++it ) {
const char * type = _lim->typeFromFile( *it );
_refMap.insert( *it, new std::string( type ) );
}
return true;
}
public:
lazyRefs( lazyInstMgr * lmgr ): _lim( lmgr ), _id( 0 ) {
_iaList.clear();
}
lazyRefs( lazyInstMgr * lmgr, SDAI_Application_instance * ai ): _lim( lmgr ), _id( 0 ) {
_iaList.clear();
init( 0, ai );
}
lazyRefs( lazyInstMgr * lmgr, instanceID iid ): _lim( lmgr ) {
_iaList.clear();
init( iid, 0 );
}
~lazyRefs() {
// delete strings in refMap
_refMap.clear( true );
}
/// initialize with the given instance; will use ai if given, else loads instance iid
void init( instanceID iid, SDAI_Application_instance * ai = 0 ) {
if( iid == 0 && ai == 0 ) {
std::cerr << "Error at " << __FILE__ << ":" << __LINE__ << " - both args are null" << std::endl;
return;
}
if( !ai ) {
_inst = _lim->loadInstance( iid );
_id = iid;
} else {
_inst = ai;
_id = _inst->GetFileId();
}
_refMap.clear( true );
// 1. find inverse attrs with recursion
getInverseAttrs( ai->getEDesc(), _iaList );
//2. find reverse refs, map id to type (stop if there are no inverse attrs or no refs)
if( _iaList.size() == 0 || !mapRefsToTypes() ) {
return;
}
iaList_t::iterator iai = _iaList.begin();
for( ; iai != _iaList.end(); ++iai ) {
// 3. for each IA, ...
checkAnInvAttr( *iai );
}
}
referentInstances_t result() {
return _referentInstances;
}
};
#endif //LAZYREFS_H
+74
View File
@@ -0,0 +1,74 @@
for inverse attrs, we have the attr name and the type of the instance
--load instance, find inverse attr(s)
--for each inverse attr:
--find all instance types that inherit from the inverted attr's owner (list A)
--look up instances that reference the one in question (list B) - use memoization
--find instances that match both lists, put in list C
--load instances in list C
--for list C, check that the relevant attr references the original instance - if not, unload (?)
--
--when done with this inverse attr, cache list A
EXAMPLE
*******
information model
-----------------
ENTITY Object;
ObjectType : OPTIONAL STRING;
INVERSE
IsDefinedBy : SET [0:?] OF RelDefinesByType FOR RelatedObjects;
END_ENTITY;
ENTITY RelDefinesByType;
RelatedObjects : SET [1:?] OF Object;
END_ENTITY;
ENTITY Window
SUBTYPE OF (Object);
Description : OPTIONAL string;
END_ENTITY;
data file
---------
#1=OBJECT('one');
#2=RELDEFINESBYTYPE((#1));
#3=RELDEFINESBYTYPE((#4));
#4=WINDOW('two','blah');
#1 and #4 have an inverse attr, but this is not visible in the data file
#2 and #3 have #1 and #4, respectively, in an aggregate (thus the parenthesis around the instance); in this case, a SET called RelatedObjects
RelatedObjects is the inverted attr that the inverse attr IsDefinedBy links to
looking at the entity descriptor for WINDOW, it is not apparent that there is an inverse attr; its parents must be examined
given inverted attr ia:
attr method value
----------- -----
ia->Name() isdefinedby
ia->inverted_attr_id_() relatedobjects
ia->inverted_entity_id_() reldefinesbytype
1. for the instance in question, find inverse attrs with recursion
2. for each ia,
a. entity name is returned by ia->inverted_entity_id_()
b. add this entity and its children to a list (list A)
c. look up references to the current instance (list B)
d. for each item in B, look up its type; if its type is present in A, remember the instance number (list C)
e. load each instance in C
f. (optional) check if the relevant inverted attr of instances loaded from list C reference the instance in step 1; if not, unload **IF** the instance hadn't been loaded
--> if it was loaded, this implies that it is used elsewhere
g. cache list A, since it may be useful in the future
-- best to store such that the most recently (frequently?) used lists are retained and others are discarded
NEED TO DO
----------
make it possible to access inverse attrs without knowing their names
probably best to do this much like explicit attrs - creating an array. each element should have a pointer to the inverted attr desc, a pointer to the setter, and a pointer to the getter
+1 -1
View File
@@ -45,7 +45,7 @@ typedef std::set< instanceID > instanceSet;
* situations, so the information should be kept up-to-date.
*/
typedef struct {
long begin;
long begin; ///< this is the result of tellg() before reading the instanceID; there may be whitespace or comments, but nothing else.
instanceID instance;
sectionID section;
/* bool modified; */ /* this will be useful when writing instances - if an instance is
+26 -14
View File
@@ -100,20 +100,31 @@ void printDeps( lazyInstMgr & mgr ) {
}
///prints info about a complex instance
void dumpComplexInst( STEPcomplex * c, unsigned int depth ) {
void dumpComplexInst( STEPcomplex * c ) {
int depth = 0;
if( c ) {
std::cout << "attr list size: " << c->_attr_data_list.size() << ", depth " << depth << std::endl;
STEPcomplex_attr_data_list::iterator it;
for( it = c->_attr_data_list.begin(); it != c->_attr_data_list.end(); it++ ) {
std::cout << "*** Not printing complex instance attribute info - many eDesc pointers are invalid. ***" << std::endl; //FIXME!
// std::cout << "attr list size: " << c->_attr_data_list.size() << ", depth " << depth << std::endl;
// STEPcomplex_attr_data_list::iterator it;
// for( it = c->_attr_data_list.begin(); it != c->_attr_data_list.end(); it++ ) {
// std::cout << "*** Not printing complex instance attribute info - many eDesc pointers are invalid. ***" << std::endl; //FIXME!
// SDAI_Application_instance * attr = ( SDAI_Application_instance * ) *it;
// if( attr->IsComplex() ) {
// dumpComplexInst( dynamic_cast<STEPcomplex *>( attr ), depth + 1 );
// } else if( attr->eDesc > ( void * ) 0xFF ) { //arbitrary number - invalid ones are usually 0x51
// std::cout << "attr " << attr->eDesc->Name() << std::endl;
// } else {
// std::cout << "attr has eDesc with pointer " << attr->eDesc << std::endl;
// }
STEPcomplex * complex = c->head;
while( complex ) {
if( complex->IsComplex() ) {
std::cout << "Complex component " << complex->getEDesc()->Name() << " at depth " << depth << " with attr list size ";
std::cout << complex->_attr_data_list.size() << std::endl;
// dumpComplexInst( complex, depth + 1 );
} else {
//probably won't ever get here...
SDAI_Application_instance * ai = dynamic_cast< SDAI_Application_instance * >( complex );
if( ai ) {
std::cout << "non-complex component at depth " << depth << ", " << ai->getEDesc()->Name() << std::endl;
} else {
std::cout << "unknown component at depth " << depth << ": " << complex << std::endl;
}
}
complex = complex->sc;
depth++;
}
}
}
@@ -143,6 +154,7 @@ int main( int argc, char ** argv ) {
std::cout << ( float )( scanStats.physMemKB * 1000 ) / instances << " bytes per instance)" << std::endl << std::endl;
fileInfo( *mgr, 0 );
//these are just common types
countTypeInstances( *mgr, "CARTESIAN_POINT" );
countTypeInstances( *mgr, "POSITIVE_LENGTH_MEASURE" );
countTypeInstances( *mgr, "VERTEX_POINT" );
@@ -168,9 +180,9 @@ int main( int argc, char ** argv ) {
instanceTypes_t::cvector * complexInsts = mgr->getInstances( "" );
if( complexInsts && complexInsts->size() > 0 ) {
std::cout << "loading lazy instance #" << complexInsts->at( 0 ) << "." << std::endl;
std::cout << "loading complex instance #" << complexInsts->at( 0 ) << "." << std::endl;
STEPcomplex * c = dynamic_cast<STEPcomplex *>( mgr->loadInstance( complexInsts->at( 0 ) ) );
dumpComplexInst( c, 0 );
dumpComplexInst( c );
std::cout << "Number of instances loaded now: " << mgr->loadedInstanceCount() << std::endl;
}
#else
+24 -18
View File
@@ -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() == '*' ) ) {
@@ -82,6 +81,7 @@ std::streampos sectionReader::findNormalString( const std::string & str, bool se
//NOTE different behavior than const char * GetKeyword( istream & in, const char * delims, ErrorDescriptor & err ) in read_func.cc
// returns pointer to the contents of a static std::string
const char * sectionReader::getDelimitedKeyword( const char * delimiters ) {
static std::string str;
char c;
@@ -129,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 '=':
@@ -155,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:
@@ -186,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();
@@ -199,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;
@@ -210,7 +210,7 @@ instanceID sectionReader::readInstanceNumber() {
digits++;
} else {
_file.unget();
_file.seekg( _file.tellg() - std::streampos(1) );
break;
}
@@ -242,17 +242,19 @@ instanceID sectionReader::readInstanceNumber() {
assert( id > 0 );
}
delete buffer;
delete [] buffer;
return id;
}
//TODO: most of the rest of readdata1, all of readdata2
/** load an instance and return a pointer to it.
* side effect: recursively loads any instances the specified instance depends upon
*/
SDAI_Application_instance * sectionReader::getRealInstance( const Registry * reg, long int begin, instanceID instance,
const std::string & typeName, const std::string & schName, bool header ) {
char c;
const char * tName = 0, * sName = 0; //these are necessary since typeName and schName are const
std::string comment;
Severity sev;
Severity sev = SEVERITY_NULL;
SDAI_Application_instance * inst = 0;
tName = typeName.c_str();
@@ -300,28 +302,29 @@ 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->eDesc );
assert( inst->getEDesc() );
_file.seekg( begin );
findNormalString( "(" );
_file.unget();
//TODO do something with 'sev'
_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();
}
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;
_file.get(); //move past the first '('
skipWS();
while( _file.good() && ( _file.peek() != ')' ) ) {
typeNames.push_back( new std::string( getDelimitedKeyword( ";( /\\" ) ) );
typeNames.push_back( new std::string( getDelimitedKeyword( ";( /\\\n" ) ) );
if( typeNames.back()->empty() ) {
delete typeNames.back();
typeNames.pop_back();
@@ -343,6 +346,9 @@ STEPcomplex * sectionReader::CreateSubSuperInstance( const Registry * reg, insta
names[ i ] = typeNames[i]->c_str();
}
//TODO still need the schema name
return new STEPcomplex( ( const_cast<Registry *>( reg ) ), ( const char ** ) names, ( int ) fileid /*, schnm*/ );
STEPcomplex * sc = new STEPcomplex( ( const_cast<Registry *>( reg ) ), names, ( int ) fileid /*, schnm*/ );
delete[] names;
//TODO also delete contents of typeNames!
return sc;
}
+20
View File
@@ -81,7 +81,27 @@ class SC_LAZYFILE_EXPORT sectionReader {
virtual const namedLazyInstance nextInstance() = 0;
/** returns the type string for an instance, read straight from the file
* if this function changes, probably need to change nextInstance() as well
* don't check errors - they would have been encountered during the initial file scan, and the file is still open so it can't have been modified */
const char * getType( long int offset ) {
if( offset <= 0 ) {
return 0;
}
_file.seekg( offset );
readInstanceNumber();
skipWS();
return getDelimitedKeyword( ";( /\\" );
}
instanceID readInstanceNumber();
void seekg( std::streampos pos ) {
_file.seekg( pos );
}
std::streampos tellg() {
return _file.tellg();
}
};
#endif //SECTIONREADER_H
+101 -38
View File
@@ -1,64 +1,127 @@
set(LIBSTEPCORE_SRCS
sdaiApplication_instance.cc
STEPcomplex.cc
STEPattribute.cc
STEPattribute.inline.cc
sdai.cc
sdaiSelect.cc
STEPaggregate.cc
STEPundefined.cc
STEPattributeList.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
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}
+9 -1797
View File
File diff suppressed because it is too large Load Diff
+45 -1933
View File
File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More