Compare commits

...
Author SHA1 Message Date
Mark Pictor 142b75ce64 initial work on skipping errors in if blocks that will never be reached 2012-04-20 16:27:08 -04:00
Mark f4a0feb33a Merge pull request #175 from mpictor/review/select_segfault
select segfault
2012-04-12 15:34:59 -07:00
Mark 4527aadff6 Merge pull request #176 from mpictor/review/scl_trace_fprintf
fedex_plus - trace code generation with fprintf
2012-04-12 15:34:38 -07:00
Mark 1c12e5d102 Merge pull request #173 from mpictor/review/p21-rw-progress
Part 21 read-write progress
2012-04-09 09:07:31 -07:00
Mark 278e45caa7 Merge pull request #177 from mpictor/review/build_fix
Fixed build problem in print_typechain function.
2012-04-08 14:50:02 -07:00
davyw a9c64bc448 Fixed build problem in print_typechain function. 2012-04-08 23:09:32 +02:00
Mark Pictor 261ae1d67e minor changes, mostly suggested by davyw 2012-04-08 16:02:54 -04:00
Mark 1d34753c03 Merge pull request #166 from mpictor/review/aggr_runtime_bounds
Runtime bounds for aggregates
2012-04-08 12:34:53 -07:00
davyw aa97040c83 remove SCL_SCHEMA_EXPORT for now 2012-04-08 15:33:23 -04:00
Mark Pictor c2b87f8f0b include scl_trace_fprintf.h in source in src/fedex_plus
only added to files which use fprintf
2012-04-08 14:10:53 -04:00
Mark Pictor 1a32be9308 add header and config option for locating source of generated code 2012-04-08 14:10:53 -04:00
Mark 52bb54d87b Merge pull request #171 from mpictor/review/scl_cf_h
fix potential scl_cf.h problem
2012-04-08 08:51:54 -07:00
Mark Pictor f9390c6f8c add segfault test 2012-04-08 09:14:58 -04:00
Mark Pictor e421f70ce0 Fix p21read segfault with selects by initializing data members that are pointers 2012-04-08 08:09:05 -04:00
Mark 767a01a8f0 Merge pull request #168 from mpictor/review/p21read_memleak_fixes
Review/p21read memleak fixes
2012-04-07 03:40:20 -07:00
Mark Pictor 5af38feaa7 fix false-positive build errors reported on cdash 2012-04-06 19:15:02 -04:00
Mark Pictor 2067e48bbd check for std::thread during configuration 2012-04-06 16:54:41 -04:00
Mark Pictor 883bc716ce add test for r/w progress 2012-04-06 16:54:41 -04:00
charliestirk 89f8807c6e Merge pull request #172 from mpictor/review/schemas
add ap238 schema, move and update pdm schema
2012-04-06 13:50:22 -07:00
Mark Pictor 6c76d7b184 fix potential scl_cf.h problem 2012-04-06 16:35:33 -04:00
Mark Pictor 1e18361351 add ap238 schema, move and update pdm schema 2012-04-06 16:28:40 -04:00
Mark Pictor 0bea3efca0 make it possible to check STEPfile r/w progress
Adds member functions `float GetReadProgress() const` and `float GetWriteProgress() const`,
and some protected data members. The new functions are intended to be thread safe.
2012-04-06 15:38:53 -04:00
Mark Pictor 225180f35d make some funcs const 2012-04-06 15:38:53 -04:00
Mark Pictor 6f60a8a7f9 cleanup 2012-04-06 15:38:53 -04:00
davyw 910faf0198 make aggr_runtime_bounds branch compile with MSVC 2012-04-05 17:57:34 -04:00
davyw dd6ef88aa1 Fixed memory leaks for STEPcomplex attribute data.
* STEPcomplex creates attribute data in BuildAttrs method that never
  got destroyed.
2012-04-05 20:40:15 +02:00
davyw 6b1ba4aa5d TypeDescriptor::~TypeDescriptor body removed from ExpDict.h.
* Since TypeDescriptor destructor body was added to ExpDict.inline.cc it
  needed to be removed from ExpDict.h.
2012-04-05 20:40:14 +02:00
davyw 5aca33785c Fixed memory leak for entity names in STEPfile.cc.
* STEPFILE::entNmArr 's content never got destroyed.
2012-04-05 20:40:12 +02:00
davyw a1d6b25e75 Fixed some memory leaks in ExpDict.cc.
* TypeDescriptor::_where_rules never got destroyed.
* Where_rule__list, Uniqueness_rule__set and Global_rule__set never
  destroyed their content.
* Inverse_attributeList never destroyed it's content.
2012-04-05 20:40:11 +02:00
davyw 626bb73cb9 Fixed memory leak for Registry TypeDescriptors.
* Registry class creates a number of standard TypeDescriptors that never
  got destroyed.
2012-04-05 20:40:10 +02:00
davyw 8a2665e980 Fixed memory leaks for STEPaggregate data.
* Data was created for use with STEPaggregate types in fedex_plus generated
  code but never destroyed.
* Fixed some code style alignment.
* STEPaggregate's STEPnodes never got destroyed.
2012-04-05 20:40:09 +02:00
davyw 4740f4d45c Added SCL_ prefix to hash functions of scl_hash.cc.
* Linking went wrong because functions from hash.c and scl_hash.cc had
  the same names. By adding SCL_ prefix to the scl_hash.cc function names
  this issue is resolved.
* Fixed minor issue in scl_hash.cc.
2012-04-05 20:40:07 +02:00
davyw 04f4c1da66 Added unnamed types to Schema.
* Unnamed types where created, but never destroyed, added unnamed types
  list to Schema and delete the unnamed types in Schema destructor.
2012-04-05 20:40:06 +02:00
davyw 0a12237f8b Memory leak fix in dirobj.cc.
* DirObj::fileList was created but never destroyed.
2012-04-05 20:40:04 +02:00
davyw c77471a5f8 Delete STEPattributes from sdaiApplication_instance::attributes.
* The attributes list content from sdaiApplication_instance never got
  deleted, added clean up code to sdaiApplication_instance destructor.
* Added refCount to STEPattribute to prevent multiple deletions of the
  same instance in case an instance is added to attributes more than once.
2012-04-05 20:40:04 +02:00
davyw a9173c8b41 Moved Registry::DeleteContents to Registry::~Registry.
* DeleteContents was only called for _headerRegistry, not for the Schema
  Registry, by moving it to the destructor this fixes a number of memory
  leaks.
2012-04-05 20:40:02 +02:00
Mark 521f4427ea Merge pull request #167 from mpictor/review/brlcad-man-dir
make man page install path flexible
2012-04-04 05:28:21 -07:00
Mark 7628642baf Merge pull request #165 from mpictor/review/brlcad-paths
change paths to match BRL-CAD convention
2012-04-04 05:27:30 -07:00
starseeker c446fc391b make man page install path flexible 2012-04-01 12:54:43 -04:00
Mark Pictor 473223d831 add missing files, make tests work 2012-04-01 12:08:06 -04:00
Mark Pictor b4cf4236f2 declare some AggrTypeDescriptor member functions const 2012-03-31 22:08:29 -04:00
Mark Pictor 52635e7d8b add files to test runtime aggregate bounds 2012-03-31 22:08:29 -04:00
Mark Pictor 6817e1b868 change schema name, remove tabs 2012-03-31 13:17:31 -04:00
Mark Pictor a72fa6eb86 use the aggregate's name instead of the data member's name 2012-03-31 10:08:14 -04:00
Mark Pictor a86b035dc7 cleanup 2012-03-30 18:27:39 -04:00
Mark Pictor 7425e55db7 Add support for aggregate bounds that are not compile-time constants.
This renames or adds several functions in class AggrTypeDescriptor. Bounds
dependent on a function call are supported, but only as strings. Bounds
dependent on attributes need some work - the schema-specific libs won't
compile if they use the SetBound[12]FromMemberAccessor functions.
2012-03-30 18:27:39 -04:00
starseeker 905254125e change paths to match BRL-CAD convention 2012-03-30 18:05:44 -04:00
Mark db31ea0455 Merge pull request #163 from mpictor/review/brlcad-cmake
brlcad cmake patch, with two minor changes
2012-03-29 14:28:53 -07:00
Mark Pictor 7b54e23e1a update comment in scl_version_string.h 2012-03-26 20:40:17 -04:00
Mark Pictor c676850fab make CMAKE_BUILD_TYPE work for sub-builds 2012-03-26 20:39:02 -04:00
starseeker b507ee8179 Two more of Cliff's patches 2012-03-26 20:31:36 -04:00
Mark Pictor 347df4f231 cmake variables have been renamed 2012-03-26 19:56:02 -04:00
Mark 00ad279a63 Merge pull request #162 from mpictor/review/p21read_scl_memmgr
Review/p21read scl memmgr
2012-03-26 16:46:40 -07:00
charliestirk 0878a6d359 Merge pull request #164 from mpictor/review/doc-pdf
Added pdf version of documentation files
2012-03-26 16:19:01 -07:00
tpaviot 77ab82b571 Added pdf version of documentation files 2012-03-26 05:12:38 +02:00
Mark Pictor 0a954f1976 unittesting should default to off, minor whitespace change
unittesting had been turned on accidentally
made a few whitespace changes for readability (I assume the whitespace had been removed by a script)
2012-03-21 21:20:50 -04:00
starseeker 75706a942a starseeker's patch from http://bzflag.bz/~starseeker/scl_cmake_files.patch 2012-03-21 21:18:38 -04:00
davyw d8d293bbf8 Added scl_memmgr to fedex_plus generated schema libraries. 2012-03-20 21:15:06 +01:00
davyw 3be42207ee Added scl_memmgr to cleditor library. 2012-03-20 21:12:45 +01:00
davyw b49d2beb6a Added scl_memmgr to cldai library. 2012-03-20 21:11:48 +01:00
davyw 245ff1458b Added scl_memmgr to clstepcore library. 2012-03-20 21:08:45 +01:00
davyw 010e02b7a6 Added scl_memmgr to clutils library. 2012-03-20 21:07:02 +01:00
davyw c84330b26a Updated leak message with total leaks (in bytes). 2012-03-20 21:04:24 +01:00
Mark 88e09ca813 Merge pull request #160 from mpictor/review/memleak_fixes_fedex_plus
Review/memleak fixes fedex plus
2012-03-17 05:58:52 -07:00
davyw ee13cdaca3 Removed disabled code from src/express/resolve.c. 2012-03-15 21:08:26 +01:00
davyw b60f85be1d Fixed parameter inconsistency for ERRORdestroy function. 2012-03-13 22:24:40 +01:00
davyw f7cde9fc20 Fixed memory leak reported by scl_memmgr in multpass.c.
* Function initializeMarks allocates an int and stores the pointer in
  schema->clientData, this was not cleaned up anywhere. The function
  cleanupMarks destroys these allocated ints.
2012-03-13 21:30:50 +01:00
davyw 3010afa7ea Fixed some memory leaks reported by scl_memmgr. 2012-03-13 21:19:47 +01:00
davyw f5d0cc59aa Added fedex_plus/express cleanup functions.
* A lot of memory allocated in EXPRESSinitialize was not cleaned up.
  Added EXPRESScleanup function and subfunctions to clean up that memory.
2012-03-13 21:17:49 +01:00
charliestirk bd320c403d Merge pull request #158 from mpictor/review/npp-express-syntax
Added express syntax highlighting file for notepad ++.
2012-03-13 12:47:36 -07:00
davyw e83fc64bc9 Added express syntax highlighting file for notepad ++. 2012-03-13 20:39:53 +01:00
Mark 0e9cc5c6ae Merge pull request #156 from mpictor/review/add-ap219
add ap219 schema
2012-03-13 04:54:49 -07:00
Mark a215cae560 Merge pull request #157 from mpictor/review/matrix-and-highlight
add syntax highlighting file, changes to ctest matrix script
2012-03-13 04:54:18 -07:00
Mark Pictor 6c708845bf add ap219 schema 2012-03-12 21:07:50 -04:00
Mark Pictor 2e1befa0bf fix ctest matrix script 2012-03-12 21:07:00 -04:00
Mark Pictor 884949bbab add EXPRESS syntax highlighting file for Kate editor 2012-03-12 21:07:00 -04:00
Mark ea7adb4d18 Merge pull request #153 from mpictor/tp/new_unitary_schema
Added unitary schema to test issue #132
2012-03-08 16:35:15 -08:00
charliestirk 6ada55b7fe Update AUTHORS 2012-03-08 11:50:50 -07:00
charliestirk f705842bb7 added davy 2012-03-08 11:50:21 -07:00
Mark c1636b4d01 Merge pull request #152 from mpictor/review/msvc_fix_ap210
Replaced if...else if to if...return in selects.c.
2012-03-06 17:50:09 -08:00
tpaviot 0c424b4eb5 Added unitary schema to test issue #132 2012-03-04 22:01:09 +01:00
davyw dea7f8c3a1 Replaced if...else if to if...return in selects.c.
* On MSVC the number of nested if...else if statements is limited to 128.
  For AP210e2, AP210e3 and AP239, this number was reached, therefore
  the if...else if statements are now replaced with if...return statements.
* Increased buffer size from 5000 to 6000 in classes.c function TypeDescription.
  (Overflow occured for AP210e3.)
2012-03-04 13:22:17 +01:00
Mark 16e3749b8f Merge pull request #143 from mpictor/review/cmake-improvements
Improvements in the cmake builder
2012-03-02 03:34:05 -08:00
tpaviot 3953a2268e MSVC build type is set to Debug, as for Linux or OSX 2012-03-02 07:57:27 +01:00
tpaviot 5f1465e4e6 Fixed small bug in ABI versioning 2012-03-02 07:56:09 +01:00
tpaviot f3eab5d91a Added ABI versioning 2012-03-02 07:49:03 +01:00
tpaviot 7f588a64cf Fixed fedex_python build 2012-03-02 07:49:03 +01:00
tpaviot 38d2a49967 Improvements in the cmake builder 2012-03-02 07:49:02 +01:00
Mark 89035cdb2c Merge pull request #148 from mpictor/review/scl_memmgr
Review/scl memmgr
2012-03-01 05:53:55 -08:00
davyw 16743b297b Fixed malloc.h include for OSX (patch from @tpaviot) 2012-02-28 20:49:07 +01:00
davyw 7ec9f7d8fb Fixed fedex_python issues for msvc build.
* Mixed code/declarations are not allowed for c files on msvc.
  Moved variable declarations to top of function where needed.
* Added base library usage to fedex_python application.
2012-02-27 21:47:37 +01:00
davyw 4e0d73d001 Added use of scl_memmgr to fedex_plus application.
* Replaced malloc, calloc, realloc and free with scl_memmgr versions.
* Added scl_memmgr.h includes.
2012-02-27 21:21:55 +01:00
davyw 7ce8bcbefb Added use of scl_memmgr to exppp library.
* Replaced malloc, calloc, realloc and free with scl_memmgr versions.
* Added scl_memmgr.h includes.
2012-02-27 21:21:31 +01:00
davyw 4d6d249dad Added use of scl_memmgr to express library.
* Replaced malloc, calloc, realloc and free with scl_memmgr versions.
* Added scl_memmgr.h includes.
2012-02-27 21:21:08 +01:00
davyw 82c84e7337 Added base library with scl_memmgr implementation.
* scl_memmgr supports both c and c++ memory management.
  malloc, calloc, realloc and free for c.
  new, delete operators for c++.
  (in c++ files scl_memmgr.h should be included last because a macro
   is used to replace new and delete with scl versions. If not included
   last, this would break build.)
2012-02-27 21:20:15 +01:00
Mark 4d68ec0b19 Merge pull request #146 from mpictor/ver-0.5
Release v0.5 - update INSTALL, NEWS, README
2012-02-23 14:53:29 -08:00
Mark Pictor 69e0813cf7 improve installation instructions 2012-02-23 17:41:11 -05:00
Mark d0e2c156a1 Merge pull request #145 from mpictor/tp/python-generator-dev
Tp/python generator dev
2012-02-23 05:58:30 -08:00
tpaviot b84921e9d8 Fixed unittest failure 2012-02-23 05:25:28 +01:00
Mark Pictor d3418ed48c add python to README 2012-02-22 19:58:33 -05:00
Mark Pictor 96f5f28058 update docs for v0.5 2012-02-22 19:34:30 -05:00
tpaviot ca155ce50d Fixed regression 2012-02-22 23:16:24 +01:00
tpaviot 1bbbc219ba Fixed version and url in setup.py 2012-02-22 23:09:04 +01:00
tpaviot 59cf7ec1ed Fixed unbounded list support 2012-02-22 23:06:51 +01:00
tpaviot f053df82db Added other examples from unitary_schemas directory 2012-02-22 17:58:55 +01:00
tpaviot 8cad6ec2aa Improvements in SELECT and ENUMERATION support 2012-02-22 17:57:23 +01:00
tpaviot 5f345c700e Better support for enum and aggr typedefs 2012-02-22 17:57:23 +01:00
tpaviot 37594fc4a2 Code clean-up: remove unused code 2012-02-22 17:57:23 +01:00
tpaviot d6da97ec30 Small spelling fix 2012-02-22 17:57:23 +01:00
tpaviot 5f88f509b2 Improved docstring for aggregate 2012-02-22 17:57:22 +01:00
tpaviot d87d07a26c Added Model module/class 2012-02-22 17:57:22 +01:00
tpaviot 50b9032d32 LIST better implementation 2012-02-22 17:57:22 +01:00
tpaviot d56795946c Improvements in the aggregates support and Part21 importer as well 2012-02-22 17:57:22 +01:00
tpaviot 117ba3972f SCL unittest fix 2012-02-22 17:57:22 +01:00
tpaviot 8595a291cb Code cleanup 2012-02-22 17:57:22 +01:00
tpaviot ee78ba9c52 Moved AggregationDataType module name to AggregationDataTypes 2012-02-22 17:57:22 +01:00
tpaviot 575c77dda9 Bugfix: segfault when processing ap203 schema 2012-02-22 17:57:22 +01:00
tpaviot bd9942dc36 * Made ARRAY implementation strictly comply with ISO 10303-11:1994
* Updated SCL unittest.
2012-02-22 17:57:22 +01:00
tpaviot 10999e7a48 First draft for a SCL python generator 2012-02-22 17:57:21 +01:00
Mark becb8405ba Merge pull request #135 from mpictor/review/gcc_incomplete_type
Fix the incomplete type errors in AP210, AP235, AP242
2012-02-21 17:09:12 -08:00
Mark Pictor dca5e0c843 add 4 ap210e2 exchange files from wikistep
one had DOS line endings - "warning: CRLF will be replaced by LF in data/ap210e2/PDES-181.stp"
2012-02-21 20:06:02 -05:00
Mark Pictor 47ecd2088f fix linker issue on OSX 2012-02-21 20:04:42 -05:00
Mark Pictor 1cc2774b52 rewrite format_for_std_stringout(), eliminate use of 'tmpstr' buffer 2012-02-16 20:51:13 -05:00
Mark f12e16b3a7 Merge pull request #139 from mpictor/review/multiple-declarations
fix multiple declaration error when compiling ap210e3 (issue 138), add test schema

the problem @davyw is having isn't specific to this branch, so I'm going to merge
2012-02-14 18:09:38 -08:00
Mark ee689a10e1 Merge pull request #140 from mpictor/review/memory-leak-fix
Fixed memory leak in HASHfind() function
2012-02-14 18:07:20 -08:00
Mark Pictor 3fd222218f Replace the scl_char_str__list class with std::deque
Also use std::string in place of char * in various places
2012-02-14 21:00:40 -05:00
Mark Pictor 212c11453e break up huge strings in generated code 2012-02-14 20:00:48 -05:00
Mark 92d83ef14a Merge pull request #137 from mpictor/review/embarcadero_fixes
Review/embarcadero fixes
2012-02-13 14:32:35 -08:00
tpaviot 950407a067 Fixed memory leak in HASHfind() function 2012-02-12 13:33:54 +01:00
Mark Pictor fb79eb2183 fix multiple declaration error when compiling ap210e3 (#138), add test schema 2012-02-11 17:35:46 -05:00
davyw 572e9adc0b Added comment for StrCmpIns function. 2012-02-10 22:57:43 +01:00
davyw ac702af7f3 Fix segfault when file not found for p21read.
* When invalid file name passed to p21read, a segfault occured because
  p21read tried to continue parsing even though no file was found.
  An extra check for errors and early exit fixes this issue.
2012-02-10 22:39:47 +01:00
davyw c316f21fe6 Use of internal StrCmpIns function in stead of runtime stricmp/strcasecmp.
* Because of incompatible implementations of string comparison functions
  on different platforms (uppercase vs lowercase compares) it is better
  to have an scl specific StrCmpIns function. This fixes issues creating
  and validating complex structures in stepfile.cc.
2012-02-10 22:37:18 +01:00
davyw 14926414c3 Cleanup of unused variable exchange_file. 2012-02-10 22:34:43 +01:00
Mark Pictor 260fd55f10 fix segfault - initialize members that are pointer-to-aggregate 2012-02-09 19:02:37 -05:00
Mark Pictor d94a44944b a little cleanup in src/fedex_plus 2012-02-09 19:02:37 -05:00
Mark Pictor 2be1cc40be add small schema exposing incomplete type bug 2012-02-09 19:02:36 -05:00
Mark Pictor 809e1dd495 in generated code, use pointer for all aggregate members 2012-02-09 19:02:36 -05:00
Mark Pictor 3aee5f353c selects.c: don't print tabs into schema files, also some minor cleanup 2012-02-09 19:02:36 -05:00
Mark 6e6fb8197c Merge pull request #134 from mpictor/review/cleanup_for_issue30
Review/cleanup for issue30
2012-02-09 12:48:06 -08:00
Mark 235b1e6ca3 Merge pull request #131 from mpictor/review/cleanup
cleanup src/express and include/express
2012-02-08 15:16:00 -08:00
davyw e99240a780 Removed CORBA (PART26) references.
* Cleaned up all PART26 references for issue #30.
2012-02-05 22:07:58 +01:00
davyw ca0824dd0d Removed __O3DB__ references.
* Cleaned up all __O3DB__ references for issue #30.
2012-02-05 21:48:47 +01:00
Mark Pictor 5dc04396ad cleanup and doxify files in include/express 2012-02-02 19:07:54 -05:00
Mark Pictor 3e8c11661d cleanup and doxify src/express 2012-02-02 19:06:50 -05:00
Mark Pictor a63ac738af eliminate "backwards compatibility" types from type.h, remove unused func
Removed macros and typedefs from type.h

Removed unused function from type.c that used those macros, and
 replaced the macros where used in fedex_plus/. For example:
 sed -i -e 's/Class_Integer_Type/integer_/g;' *

The typedefs were not in use anywhere.
2012-02-02 19:01:29 -05:00
Mark Pictor 7a6ba24f81 remove 'typedef char* String', 'STRINGequal' macro 2012-02-02 18:56:54 -05:00
Mark Pictor 1481950409 Remove obsolete fn macros OBJequal OBJfree OBJreference OBJget_data
These macros were defined in object.h as being "for backwards compatibility".
The only code that used them was in #if 0...#endif blocks. Additionally,
OBJfree is mentioned in express/Changes, dated 1992, as being unnecessary. It
seems safe to remove all of this code - it is very very old.
2012-02-02 18:55:13 -05:00
Mark Pictor 0073b386ef remove useless header src/express/conf.h 2012-02-02 18:48:00 -05:00
Mark Pictor 2d7ed17697 remove unused function PrintModelContentsSchema() 2012-02-02 18:48:00 -05:00
Mark ffdeac2552 Merge pull request #125 from mpictor/review/second-edition-error
Add a warning for unsupported language features, and print it for indexing upon a binary
2012-02-02 12:48:14 -08:00
Mark 8dcfec46c9 Merge pull request #129 from mpictor/review/enums
fix segfault in review/enums
2012-02-02 12:48:04 -08:00
Mark Pictor 14985062f7 fix segfault 2012-01-31 18:25:24 -05:00
Mark e9e576e4f8 Merge pull request #124 from mpictor/review/enums
put enums in separate table
2012-01-29 05:02:40 -08:00
Mark fad0cf4b3d Merge pull request #127 from mpictor/review/embarcadero
Fixed issue for bcc32 v6.30 and up.
2012-01-29 05:01:27 -08:00
Mark Pictor 4cd7e7c806 Add a warning for unsupported language features, and print it for indexing upon a binary 2012-01-26 20:11:59 -05:00
davyw 22cbb3efcf Fixed issue for bcc32 v6.30 and up.
* _Bool type is a known keyword for bcc32 v6.30 and up.
2012-01-18 21:09:49 +01:00
Mark Pictor c415e49894 put enums in separate table 2012-01-17 20:38:31 -05:00
Mark 064a2b41b5 Merge pull request #120 from mpictor/review/borland
Review/borland
2012-01-06 15:00:38 -08:00
Mark fffaba61f2 Merge pull request #119 from mpictor/review/msvc_fixes
Review/msvc fixes
2012-01-06 15:00:21 -08:00
davyw 4ab01a7773 Ran astyle to fix code style. 2012-01-06 19:56:32 +01:00
davyw 873a86de8b Ran astyle to fix code style. 2012-01-06 19:54:57 +01:00
davyw 3a9fa997b3 Added default namespace for Boolean type.
* In borland type Boolean conflicts with System::Boolean so it is needed
  to replace Boolean with ::Boolean.
2012-01-04 23:12:47 +01:00
davyw 2d26da7d24 Changed xgetopt module to remove unicode support.
* Since the unicode support (TCHAR, _T, ...) did not build with borland
  makefiles target I removed unicode support temporarily since most scl
  code does not support unicode yet.
2012-01-04 23:12:46 +01:00
davyw c0c423c625 Added support for cmake 'Borland Makefiles' generator.
* Added __BORLAND__ flag to a number of places in the code.
* Added BORLAND specific stuff to CMakeLists.txt files.
2012-01-04 23:12:46 +01:00
davyw 555a574eef Added support for cmake 'Borland Makefiles'.
* Added BORLAND target to several CMakeLists.txt.
  (MSVC and BORLAND require similar behaviour for imports/exports)
* Added __BORLAND__ ifdefs where needed.
2012-01-04 23:12:45 +01:00
davyw 82898d74a4 Changed classes inherited from std::string from is-a to has-a std::string.
* Removed std::string base class for SDAI_String and SDAI_Binary.
* Added necessary std::string interface functions to SDAI_String and SDAI_Binary.
* Removed msvc specific code from sdaiString.h
2012-01-04 22:24:54 +01:00
davyw 09f347234b Fixed local variable declarations to be msvc compliant. 2012-01-04 21:00:59 +01:00
Mark 3ce06bce27 Merge pull request #117 from mpictor/review/matrix-python-ctest
Create schema matrix using python and ctest
2012-01-03 01:10:47 -08:00
Mark Pictor e7d3c2a075 python/ctest for matrix seems to work now 2011-12-30 09:21:31 -05:00
Mark Pictor e1b374a7d6 initial work on creating matrix with ctest and python 2011-12-29 22:06:31 -05:00
Mark 33c66b0954 Merge pull request #116 from mpictor/review/msvc2010
Fixed linker error for MSVC2010.
2011-12-26 04:00:08 -08:00
Mark eb61193bcf Merge pull request #115 from mpictor/review/aggr-index
Indexing on aggregates and generics
2011-12-24 03:16:02 -08:00
davyw 2535a4f8b2 Fixed linker error for MSVC2010.
* In MSVC2010 std::string::npos is not exported from std libs but
  since it's a constant value it's safe to declare this in the header
  file so every lib that's using it has a local instance.
2011-12-19 13:55:34 +01:00
Mark Pictor ed76f0b625 handle indexing on GENERICs 2011-12-18 19:34:14 -05:00
Mark Pictor f3a82debec forgot to add the test express schema for aggregate indexing 2011-12-17 20:41:35 -05:00
Mark Pictor 1da31f6501 cleanup 2011-12-17 20:37:55 -05:00
Mark Pictor 67f8897429 avoid index error on select types (issue #96) 2011-12-17 20:37:55 -05:00
Mark 81b82cdd24 Merge pull request #113 from mpictor/review/msvc2
[no regressions](http://my.cdash.org/buildSummary.php?buildid=272314), so I'm going to merge
2011-12-17 07:02:03 -08:00
Mark 28a988854f Merge pull request #114 from mpictor/review/doc
add some documents, and rename existing ones (substitute underscore for space)
2011-12-17 05:48:06 -08:00
Mark e36a1a69bd Merge pull request #112 from mpictor/review/p21-comments
Part 21: look for comments within entities
2011-12-17 05:47:53 -08:00
Mark Pictor defd675944 add some files, and rename existing ones (substitute underscore for space) 2011-12-14 20:15:35 -05:00
davyw ec97362602 Fixed generation of nextnn variables.
* Added one more nextnn variable.
2011-12-14 22:08:13 +01:00
davyw 586b8f8996 Fixed typo in create_builtin_type_decl.
* Forgot a ',' which is now added.
2011-12-12 15:06:38 +01:00
davyw c1b57435b2 Fixed warnings in generated code nextnn variables unused.
* maxlevel is determined to create the amount of variables
  needed in the generated code, no more, no less.
2011-12-12 15:00:21 +01:00
davyw 2b0da3fd41 Fixed possible loss of data.
* The old implementation (still in comment) had a possible loss of data
  warning in msvc.
2011-12-12 15:00:20 +01:00
davyw 15f9c40c54 Removes inconsistent dll-linkage warning.
* Removes warning for inconsistent dll-linkage on CheckRemainingInput function.
2011-12-12 15:00:18 +01:00
davyw 0aa9b5dd97 Removed SCL_EXPRESS_EXPORT flag for EXPRESSgetopt_options[].
* Since EXPRESSgetopt_options[] is locally defined for each usage (fedex.c and fedex_main.c)
  it should not be exported from express lib.
* This also removes 3 warnings in MSVC.
2011-12-12 15:00:17 +01:00
davyw 97ef6d97ed Added dependency on utils lib in p21read.
* Added utils lib to p21read dependencies.
* Added SCL_UTILS_DLL_IMPORTS flag for p21read.
2011-12-12 15:00:15 +01:00
davyw d0293fd0c7 Added dependency on utils lib in editor lib.
* Since editor lib uses gennode.cc, gennodearray.cc and gennodelist.cc
  from utils lib it should be dependent on it.
2011-12-12 15:00:14 +01:00
davyw 355f08f50e Removed unused variable list.
* Linked_List list was never used.
2011-12-12 15:00:13 +01:00
davyw f688f2a0c9 Removes warning for one path not returning a value.
* Default returns empty string even though this path is never reached.
2011-12-12 15:00:12 +01:00
davyw 07ed8f6968 Removes performance warning in MSVC.
* Removes performance warning about forcing int to true/false.
2011-12-12 15:00:11 +01:00
davyw 993167ede1 Added io.h include and check if available through cmake.
* io.h defines chmod on WIN32 systems.
2011-12-12 15:00:09 +01:00
davyw 870edbffa8 Added process.h include and check if available through cmake.
* process.h defines getpid on WIN32 systems.
2011-12-12 15:00:08 +01:00
davyw 0f3b6262cd Removes warnings by adding explicit casts for float/double conversions.
* Added ( float ) casts to prevent warnings in MSVC.
2011-12-12 15:00:07 +01:00
davyw 03fd892382 Removes several times warning C4018 in MSVC.
* Removes signed/unsigned mismatch warning.
2011-12-12 15:00:06 +01:00
davyw 7712b9bb23 Removes several times warning C4133 in MSVC.
* Removes incompatible types warning by adding casts.
2011-12-12 15:00:05 +01:00
davyw dcdd77a49d Removes several times warning C4133 in MSVC.
* Removes incompatible types from '...' to 'Generic' warning.
2011-12-12 15:00:04 +01:00
davyw 166425a9b8 Removes several times warning C4018 in MSVC.
* Removes signed/unsigned mismatch warning.
2011-12-12 15:00:03 +01:00
davyw ca4940e6e9 Removes several times warning C4018 in MSVC.
* Removes signed/unsigned mismatch warning.
2011-12-12 15:00:02 +01:00
davyw 3156ea7fb6 Removes 3 times warning C4355 in MSVC.
* Removes 'this': used in base member initializer list warning.
2011-12-12 15:00:01 +01:00
davyw 2179c8a83b Removes 3 times warning C4113 in MSVC.
* Removes 'void (__cdecl*)()' differs in parameter list from 'void (__cdecl*)(void)' warning.
2011-12-12 15:00:00 +01:00
davyw 80208dcdd6 Added msvc import/export scheme for fedex_plus generated code.
* Added IMPORTS/EXPORTS flags in data/CmakeLists.txt.
* Added EXPORT flags for fedex_plus generated code variables and functions.
2011-12-12 14:59:59 +01:00
davyw 737c53ef28 Fixed struct inconsistency for struct Hash_Table.
* scl_hash.h and hash.h have similar struct for struct Hash_Table
  and should have same members and types.
* fixed signed/unsigned comparison warning in HASHCreate function.
2011-12-12 14:59:58 +01:00
Mark Pictor ae9dbbd70e add p21 test for comments within entities 2011-12-11 19:51:32 -05:00
Mark Pictor 4ddce869b2 Look for comments within entities 2011-12-11 19:33:26 -05:00
Mark 3bff65bc9b Merge pull request #111 from mpictor/review/fix-parallel-ctest
change scl_version_string.cmake to fix parallel ctest issue
2011-12-11 16:23:33 -08:00
Mark 81dc369b03 Merge pull request #110 from mpictor/rebase/msvc
Windows / MSVC support - rebase
2011-12-11 16:23:19 -08:00
Mark Pictor 388901d20c run astyle on all files. changed args to catch more files (src/*.h) 2011-12-07 19:03:07 -05:00
davyw 90dc1d6592 Fixed check-express linkage for MSVC.
* Added SCL_EXPRESS_EXPORT flag for yydebug,yydbg_upper_limit,yydbg_lower_limit and yydbg_verbose
* Added xgetopt.cc for check-express/MSVC.
* Added inithook for check-express/MSVC?
* Used set_target_properties COMPILE_DEFINITIONS in stead of add_definitions
  for SCL_EXPRESS_EXPORTS/SCL_EXPRESS_IMPORTS.
2011-12-07 18:57:51 -05:00
davyw d0a425f403 Fixed HAVE_SYS_PARAM_H.
* Include file check for sys/param.h fixed.
2011-12-07 18:57:51 -05:00
davyw 2647e16a53 Added editor files to core lib.
* Added editor files to prevent link editor on core library.
2011-12-07 18:57:51 -05:00
davyw 0869e41b28 Uncommented lines of code that should not have been commented.
* Undo of commenting that should not have made it into a previous commit.
2011-12-07 18:57:51 -05:00
davyw 5e9dfd7e94 Fix array overflows in classes_misc.c
* Functions EnumName and SelectName had an array overflow bug.
2011-12-07 18:57:51 -05:00
davyw dc302ea085 Moved xgetopt.h.
* Moved 'xgetopt.h' from src/fedex_plus to include folder.
2011-12-07 18:57:51 -05:00
davyw c771b270f3 Added editor dll import/export scheme for MSVC.
* Added SCL_EDITOR_EXPORT flag.
* Added SCL_EDITOR_DLL_EXPORTS flag.
* Added SCL_CORE_DLL_IMPORTS flag.
* Added SCL_DAI_DLL_IMPORTS flag.
* Removed double EntityClassName function declarations.
2011-12-07 18:57:51 -05:00
davyw 5c8c5aaca6 Removed double CheckRemainingInput declarations.
* CheckRemainingInput is an utils function, but was also declared in a
  core header file.
2011-12-07 18:57:51 -05:00
davyw 2e01a01bf5 Updated scl_export.h include references.
* Moved around some includes of scl_export.h
2011-12-07 18:57:50 -05:00
davyw 0705c500a5 Added core dll import/export scheme for MSVC.
* Added SCL_CORE_EXPORT flag.
* Added SCL_CORE_DLL_EXPORTS flag.
* Added SCL_EXPRESS_DLL_IMPORTS flag.
* Added SCL_DAI_DLL_IMPORTS flag.
* Added SCL_CORE_DLL_IMPORTS flag.
* Removed sdaiEnum/sdaiString/sdaiBinary (moved to cldai).
2011-12-07 18:57:50 -05:00
davyw c409145b25 Added dai dll import/export scheme for MSVC.
* Added SCL_DAI_EXPORT flag.
* Added SCL_DAI_DLL_EXPORTS flag.
* Added SCL_UTILS_DLL_IMPORTS flag.
2011-12-07 18:57:50 -05:00
davyw 457d51e303 Added utils dll import/export scheme for MSVC.
* Added SCL_UTILS_EXPORT flag.
* Added SCL_UTILS_DLL_EXPORTS flag for exppp CMakeLists.txt
2011-12-07 18:57:50 -05:00
davyw 69acdf329d Moved sources to prevent circular deps.
* Moved sdaiEnum.cc/sdaiBinary.cc/sdaiString.cc from clstepcore to cldai.
2011-12-07 18:57:50 -05:00
davyw c3f9ff563f Made fedex_plus MSVC compatible.
* Selected correct PROTO define for __MSVC__.
* Renamed static function min to minimum to prevent conflict in MSVC.
* Added condition __MSVC__ when __attribute( ( unused ) ) was used.
* Added {} in classes.c to prevent local variable definitions which
  are not allowed in MSVC for c files.
* Added xgetopt.cc/xgetopt.h for getopt functionality.
* Added SCL_EXPRESS_DLL_IMPORTS/SCL_EXPPP_DLL_IMPORTS to CMakeLists.txt.
2011-12-07 18:57:50 -05:00
davyw d6b1570894 Removed __STDC__ defined for MSVC. 2011-12-07 18:45:42 -05:00
davyw f853b997d7 Added exppp dll import/export scheme for MSVC.
* Added SCL_EXPPP_EXPORT flag for all global variables in headers.
* Added SCL_EXPPP_EXPORT flag for all function prototypes in headers.
* Added SCL_EXPRESS_DLL_IMPORTS flag for exppp CMakeLists.txt
* Added SCL_EXPPP_DLL_EXPORTS flag for exppp CMakeLists.txt

Signed-off-by: davyw <davy.wouters@gmail.com>
2011-12-07 18:45:42 -05:00
davyw ba12196a88 Added dll import/export scheme for MSVC.
* Added scl_export.h with conditional flags for import/export.
* Added SCL_EXPRESS_EXPORT flag for all global variables in headers.
* Added SCL_EXPRESS_EXPORT flag for all function prototypes in headers.
* Added SCL_EXPRESS_DLL_EXPORTS flag for express CMakeLists.txt
2011-12-07 18:45:42 -05:00
davyw 879f5092b7 Made changes to prevent compiler/linker errors of express.
* Renamed __in to __i in LISTdo_links macro because __in is a reserved macro for MSVC.
* Renamed isascii to __isascii for MSVC.
* Added __MSVC__ to compiler flags and use it.
2011-12-07 18:45:42 -05:00
davyw 6226717d18 Made changes to prevent compiler/linker errors of clutils.
* Added shlwapi.lib for MSVC target.
* Added pure Win32 alternative implementation for DirObj::Reset function.
2011-12-07 18:45:42 -05:00
davyw 784285605e Added MSVC Global Compiler flags.
* Added __STDC__ and __WIN32__ define since MSVC defaults are different.
* Added _CRT_SECURE_NO_WARNINGS to prevent warnings for secure crt functions.
  (for example strcpy should be strcpy_s)
* Added _CRT_NONSTDC_NO_WARNINGS to prevent deprecated warning for posix functions.
2011-12-07 18:45:41 -05:00
davyw 71bd7b235a Made non MSVC include files conditional.
* Made unistd.h include conditional by cmake HAVE_UNISTD_H flag.
* Made dirent.h include conditional by cmake HAVE_DIRENT_H flag.
* Made sys/params.h include conditional by cmake HAVE_SYS_PARAMS_H flag.
* Made stdbool.h include conditinal by cmake HAVE_STDBOOL_H flag.
* Added scl_stdbool.h as an alternative for stdbool.h.
* Added xgetopt.cc/xgetopt.h to be included when HAVE_GETOPT flag false.
2011-12-07 18:45:41 -05:00
Mark Pictor 13204e4027 change scl_version_string.cmake to fix parallel ctest issue
This replaces use of the system time command with __DATE__ and __TIME__

I think the following two errors are caused by fedex_plus being rebuilt for each test:

Linking CXX executable ../../bin/fedex_plus
CMakeFiles/fedex_plus.dir/__/express/fedex.c.o: file not recognized: File truncated

and

[ 87%] Running fedex_plus for AP214E3_2010...
/bin/sh: /opt/step/test-scl/build_ctest/bin/fedex_plus: Text file busy

fedex_plus is being rebuilt because the version string changes, since it contains the date and time.
2011-12-07 18:44:43 -05:00
Mark 48dff49299 Merge pull request #108 from mpictor/review/namespace
Review/namespace
2011-12-07 15:36:51 -08:00
Mark Pictor 3ed8797097 use namespace for globals, part 3. fix problems with ifc2x3 2011-12-03 19:43:12 -05:00
Mark Pictor a13ba2152a remove goto 2011-12-03 19:19:52 -05:00
Mark Pictor ed8474e132 move one func decl to header, remove a CORBA function 2011-12-03 19:19:52 -05:00
Mark Pictor da0a395c2d use namespace for global variables, part 2. example schema builds now. 2011-12-03 19:19:27 -05:00
Mark Pictor 0bb182b4e7 cleanup classes_wrapper 2011-12-03 19:19:27 -05:00
Mark Pictor 1cfb41d6b3 cleanup generated code, including tabs printed in classes_wrapper.cc 2011-12-03 19:19:27 -05:00
Mark Pictor 65791a2812 doxify some comments in classes.c 2011-12-03 19:19:27 -05:00
Mark Pictor ca50d5352f remove variables marked with __attribute__((unused)) 2011-12-03 19:19:27 -05:00
Mark Pictor cb35164af7 clean up classes.h, remove two macros 2011-12-03 19:19:27 -05:00
Mark Pictor 88e9634541 use namespace for global variables, part 1 2011-12-03 19:19:09 -05:00
Mark Pictor e54780743a add assertions to STEPattribute ctors 2011-11-30 21:29:33 -05:00
Mark Pictor 6aa4695322 use ?: in STEPattribute::NonRefType() to ensure that aDesc ptr is valid 2011-11-30 21:29:33 -05:00
Mark deb55618fe Merge pull request #107 from mpictor/review/cleanup-classes.c
Review/cleanup
2011-11-30 12:59:10 -08:00
Mark c4dd81a0bc Merge pull request #106 from mpictor/review/git-version
Generate version info and timestamp at build time
2011-11-30 12:58:03 -08:00
Mark Pictor 402225e3e8 [warning-fix][-Wsign-compare] classes.c 2011-11-28 19:08:58 -05:00
Mark Pictor 73cc97f8ff [warning-fix][-Wunused-variable] classes.c 2011-11-28 19:06:56 -05:00
Mark Pictor 86b9f12098 remove all tabs from code generated by classes.c, replace with spaces 2011-11-27 18:14:27 -05:00
Mark Pictor d6aa13f4b2 remove almost all of the rest of the corba code from classes.c 2011-11-27 18:02:49 -05:00
Mark Pictor 93678232d8 remove more corba and oodb, misc cleanup 2011-11-27 18:01:51 -05:00
Mark Pictor 04d29c0bfb comment out unused variable in fedex_plus output 2011-11-27 18:01:35 -05:00
Mark Pictor 4dc08910c6 change TYPEis_builtin() return type to bool 2011-11-27 17:50:16 -05:00
Mark Pictor 4c5a8e038d Skip printing some oodb/part26/corba stuff. Also doxify a few comments. 2011-11-27 17:50:03 -05:00
Mark Pictor d06753403c no need to print OODB stuff 2011-11-27 17:49:54 -05:00
Mark Pictor d35f73f87f change return type to bool for one func, remove a const_cast elsewhere 2011-11-27 17:49:39 -05:00
Mark Pictor d190a1e042 for version info, read SCL_VERSION.txt if git fails 2011-11-27 11:41:27 -05:00
Mark Pictor dc30ee21fd Generate version info and timestamp at build time
* Print this info from `p21read -v` and in a comment in generated source, not just from `fedex_plus -v`

* Use a function `const char* scl_version()`, instead of using the macro `SCL_COMMIT_ID`

* Fail gracefully if the `.git` directory does not exist (thanks CY!)

* Fixes issue #89
2011-11-27 11:12:54 -05:00
Mark Pictor fa615a1786 print fedex version in generated code 2011-11-27 11:04:24 -05:00
Mark 59349657da Merge pull request #102 from mpictor/review/create-missing-attributes
Review/create missing attributes
2011-11-27 07:27:55 -08:00
Mark dbdf7a99f1 Merge pull request #103 from mpictor/review/warnings
turn on more gcc warnings
2011-11-17 14:26:58 -08:00
Mark ee908d69ed Merge pull request #105 from mpictor/review/lexact-fix
Fixed SCANsave_comment
2011-11-17 13:52:03 -08:00
Mark d2e40ddf91 Merge pull request #104 from mpictor/review/ifc2x3_sample
Add two ifc2x3 files. Currently, p21read fails with both.
2011-11-16 08:29:22 -08:00
tpaviot c6bc7ec185 Fixed SCANsave_comment 2011-11-16 10:02:56 +01:00
Mark Pictor f491d500a6 Add two ifc2x3 files. Currently, p21read fails with both.
* Need to fix issue #87 before p21read will load PlayersTheater.stp
* Bien-Zenker_Jasmin-Sun-AC14-V2.ifc causes a segfault
2011-11-15 20:27:47 -05:00
Mark Pictor 3ed94ababd p21read should exit(1) for write errors _and_ read errors 2011-11-14 21:18:19 -05:00
Mark Pictor 96fdcf9e54 add two tests for 'missing and required' attributes 2011-11-14 21:01:20 -05:00
Mark Pictor dd4538ce50 turn on more warnings 2011-11-14 20:37:05 -05:00
Mark Pictor 373d415a07 Use bool strict - if false, create values for numeric and string attrs
If strict is true, behavior should be identical to old behavior
2011-11-14 20:34:11 -05:00
Mark Pictor de3495d03f add bool strict 2011-11-14 20:34:08 -05:00
Mark Pictor 6871bc4eca use peek() and ignore() instead of get() and putback() 2011-11-14 20:33:13 -05:00
Mark Pictor 6b95067732 remove another BUFSIZ char array 2011-11-14 20:30:46 -05:00
Mark Pictor 99abb18825 print more details in STEPread_error() 2011-11-14 20:28:41 -05:00
Mark Pictor c4971681e5 cleanup 2011-11-13 21:01:33 -05:00
Mark Pictor b277759f58 int useTechCor -> bool useTechCor 2011-11-13 21:01:33 -05:00
Mark Pictor 88a1229a23 update NEWS and README for v0.4 2011-11-13 11:26:57 -05:00
Mark c987ad03d2 Merge pull request #100 from mpictor/review/matrix
update matrix script, change schema name in ap210e3 WIP
2011-11-13 07:33:44 -08:00
Mark Pictor 6418c44e30 update schema matrix, change schema name for ap210e3 WIP so that it will work alongside ap210e2 2011-11-12 15:55:40 -05:00
Mark d4517fbe64 Merge pull request #85 from mpictor/review/more-tests
ctest - add p21read schema name tests, re-enable unitary_schema tests, etc
2011-11-12 11:31:20 -08:00
charliestirk 6d84278f86 Merge pull request #97 from mpictor/review/ap210
Add ap210e2, rename ap210e3 to conform with data/README and to remove extra '.'
2011-11-12 11:09:40 -08:00
Mark Pictor 5eeba5b34b Add ap210e2, rename ap210e3 to conform with data/README and to remove extra '.' 2011-11-12 13:06:02 -05:00
Mark Pictor f2cafe04ff ctest - add p21read schema name tests, re-enable unitary_schema tests, etc
* data/CMakeLists.txt
   * don't install anything
   * add 'cpp' to c++ test names and labels
* test/CMakeLists.txt: add label for run_ctest.cmake script
* add test/p21 for part 21 tests
   * all that's in here now is part 21 schema name tests
* fix test/unitary_schemas/aggregate_array.exp - ctest works, no sense having this fail
* update run_ctest.cmake
2011-11-12 08:20:29 -05:00
Mark Pictor d08ffa5eb4 update build_all.sh, fix schema dir name in data/CMakeLists.txt 2011-11-12 08:20:29 -05:00
Mark 89055ea452 Merge pull request #95 from mpictor/review/enum-redeclaration
Fix issue #71 - it is legal for enum values and entities have the same name
2011-11-12 03:51:12 -08:00
Mark d0c9541679 Merge pull request #92 from mpictor/review/local-label
Fix issue #72 - incorrect handling of GENERICs
2011-11-12 03:50:59 -08:00
Mark Pictor 392dfc6352 add two small schemas that should compile successfully 2011-11-06 20:15:55 -05:00
Mark Pictor 157c747d18 minor cleanup 2011-11-06 20:15:54 -05:00
Mark Pictor f5a130a3b7 Fix issue #71 - it is legal for enum values and entities have the same name 2011-11-06 20:15:54 -05:00
Mark 79e77ff65c Merge pull request #93 from mpictor/review/fedex-optimization
fedex_plus optimization - dramatically speed up fedex_plus.
2011-11-06 16:32:01 -08:00
Mark dba8c3fd9d Merge pull request #86 from mpictor/review/p21read-exit-err
p21read - exit(1) if errors occur
2011-11-06 03:12:30 -08:00
Mark Pictor 1faaf698fd remove a function which does nothing 2011-11-05 19:18:29 -04:00
Mark Pictor 27ce5604c2 make utype_member faster 2011-11-05 19:16:50 -04:00
tpaviot 1ad14e1334 check for upper or lower case SELF 2011-11-05 19:13:16 -04:00
Mark Pictor fffd710005 terminate string, fix infinite loop when string contains space or newline 2011-11-05 13:45:00 -04:00
tpaviot 770e4a885e Modified generate_attribute_name function 2011-11-05 16:48:47 +01:00
Mark Pictor 254b5a3dfb Fix issue #72 - incorrect handling of GENERICS
Part 11 does not require a variable defined in a LOCAL to have a type label.
ap242 error: Return type or local variable requires type label in
             'validate_dependently_instantiable_entity_data_types'
2011-11-05 11:18:52 -04:00
Mark Pictor b12562a639 p21read - exit(1) if errors occur. previously, p21read always reported success 2011-11-04 14:29:02 -04:00
Mark db00ec914f Merge pull request #88 from mpictor/review/apple
on osx, link libs with -flat_namespace -undefined suppress
2011-11-04 11:26:53 -07:00
Mark Pictor 73b69e2df6 on osx, link libs with -flat_namespace -undefined suppress 2011-11-04 12:22:22 -04:00
Mark bbaed49beb Merge pull request #70 from mpictor/review/remove-sclp
remove SCLP23 macros, sclprefixes.h, and HAVE_CONFIG_H checks

http://my.cdash.org/buildSummary.php?buildid=253754 - doesn't affect tests
2011-10-30 07:39:03 -07:00
Mark Pictor d6d7c48230 remove SCLP23 macros, sclprefixes.h, and HAVE_CONFIG_H
* remove all uses of SCLP23 and SCLP23_NAME macros, and don't include sclprefixes.h anywhere:
    for i in `grep -rl SCLP23 *`; do echo $i; sed -i 's/SCLP23_NAME( *\([A-Za-z][a-zA-Z0-9_]*\) *)/SDAI_\1/g;' $i; done
    for i in `grep -rl SCLP23 *`; do echo $i; sed -i 's/SCLP23( *\([A-Za-z][a-zA-Z0-9_]*\) *)/SDAI_\1/g;' $i; done
    for i in `grep -nr sclprefixes.h *`; do sed -i 's/#include <sclprefixes.h>//g;' $i; done
* delete sclprefixes.h
* remove HAVE_CONFIG_H in all *.c, *.cc, *.h, and */CMakeLists.txt - with cmake, we'll always have scl_cf.h
2011-10-30 10:00:53 -04:00
Mark 995c19d6da Merge pull request #83 from mpictor/review/strncpy
Review/strncpy - improve p21read speed by ~ 30%

CTest pass/fail numbers are the same, so I'm merging this
2011-10-30 06:16:18 -07:00
Mark Pictor aef6e73a60 include cmath, remove extern ceil 2011-10-30 09:13:18 -04:00
Mark Pictor b8fc557543 avoid using strncpy in STEPFile::schemaName() 2011-10-30 09:13:18 -04:00
Mark Pictor be58f09ec0 make numbers in formula floats
The original compiler must have assumed that numbers were floats.
With that assumption, the formula makes sense.
2011-10-30 09:13:18 -04:00
Mark Pictor e72ca29407 cleanup while working on dp 2011-10-30 09:13:18 -04:00
Mark da7639aa2f Merge pull request #82 from mpictor/review/doc
add sclnotes.ps, replace two mangled .ps docs with .pdf
2011-10-30 06:11:54 -07:00
Mark Pictor ec7e8ac2d1 add sclnotes, replace two other mangled ps docs with pdf 2011-10-25 20:18:08 -04:00
336 changed files with 506318 additions and 113482 deletions
+1
View File
@@ -13,6 +13,7 @@ Morrison, Christopher Sean (sean, morrison, brlcad)
Paviot, Thomas (tpaviot)
Pictor, Mark (mpictor)
Thomas, Dawn (homovulgaris, madant)
Wouters, Dave (davyw)
Yapp, Clifford (starseeker)
Special thanks:
+216 -108
View File
@@ -38,36 +38,61 @@
# This file contains the top level CMakeLists.txt logic for the
# SCL software package.
PROJECT(SCL)
# SCL version
SET(SCL_VERSION_MAJOR 0)
SET(SCL_VERSION_MINOR 5-dev)
SET(SCL_VERSION ${SCL_VERSION_MAJOR}.${SCL_VERSION_MINOR})
# SCL ABI version. SCL_ABI_SOVERSION should be incremented
# for each release introducing API incompatibilities
SET(SCL_ABI_SOVERSION 2)
SET(SCL_ABI_VERSION ${SCL_ABI_SOVERSION}.0.0)
# Minimum required version of CMake
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
IF(COMMAND CMAKE_POLICY)
CMAKE_POLICY(SET CMP0003 NEW)
CMAKE_POLICY(SET CMP0003 NEW)
ENDIF(COMMAND CMAKE_POLICY)
# set CMake project name
PROJECT(SCL)
IF( NOT DEFINED SCL_BUILD_TYPE )
SET( SCL_BUILD_TYPE "Debug" CACHE STRING "Build type" ) # By default set debug build
ENDIF( NOT DEFINED SCL_BUILD_TYPE )
IF(NOT SCL_IS_SUBBUILD)
SET(CMAKE_BUILD_TYPE ${SCL_BUILD_TYPE} CACHE INTERNAL "Build type, immutable" FORCE )
ELSE(NOT SCL_IS_SUBBUILD)
SET(CMAKE_BUILD_TYPE ${SCL_BUILD_TYPE} )
ENDIF(NOT SCL_IS_SUBBUILD)
if( CMAKE_BUILD_TYPE STREQUAL "" )
message( "Debug build - to override, rerun cmake with '-DCMAKE_BUILD_TYPE=Release'." )
set( CMAKE_BUILD_TYPE Debug )
endif()
# Define helper macro OPTION_WITH_DEFAULT
MACRO( OPTION_WITH_DEFAULT OPTION_NAME OPTION_STRING OPTION_DEFAULT )
IF( NOT DEFINED ${OPTION_NAME} )
SET( ${OPTION_NAME} ${OPTION_DEFAULT} )
ENDIF( NOT DEFINED ${OPTION_NAME} )
OPTION( ${OPTION_NAME} "${OPTION_STRING}" ${${OPTION_NAME}} )
ENDMACRO( OPTION_WITH_DEFAULT OPTION_NAME OPTION_STRING OPTION_DEFAULT )
# build shared libs by default
OPTION(BUILD_SHARED_LIBS "Build shared libraries" ON)
OPTION_WITH_DEFAULT(SCL_BUILD_SHARED_LIBS "Build shared libs" ON )
# build static libs by default
OPTION(BUILD_STATIC_LIBS "Build static libraries" OFF)
# don't build static libs by default
OPTION_WITH_DEFAULT(SCL_BUILD_STATIC_LIBS "Build static libs" OFF)
# Set version
SET(SCL_VERSION_MAJOR "3")
SET(SCL_VERSION_MINOR "2")
SET(SCL_VERSION_PATCH "0")
SET(SCL_VERSION "${SCL_VERSION_MAJOR}.${SCL_VERSION_MINOR}.${SCL_VERSION_PATCH}")
OPTION_WITH_DEFAULT(SCL_PYTHON_GENERATOR "Compile fedex_python" ON)
OPTION_WITH_DEFAULT(SCL_CPP_GENERATOR "Compile fedex_plus" ON)
OPTION_WITH_DEFAULT(SCL_MEMMGR_ENABLE_CHECKS "Enable scl_memmgr's memory leak detection" OFF)
OPTION_WITH_DEFAULT(SCL_TRACE_FPRINTF "Enable extra comments in generated code so the code's source in fedex_plus may be located" OFF)
# CMake derives much of its functionality from modules, typically
# stored in one directory - let CMake know where to find them.
SET(SCL_CMAKE_DIR "${SCL_SOURCE_DIR}/cmake")
SET(CMAKE_MODULE_PATH "${SCL_CMAKE_DIR};${CMAKE_MODULE_PATH}")
if(NOT IS_SUBBUILD)
SET(CMAKE_MODULE_PATH "${SCL_CMAKE_DIR};${CMAKE_MODULE_PATH}")
else(NOT IS_SUBBUILD)
SET(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${SCL_CMAKE_DIR}")
endif(NOT IS_SUBBUILD)
INCLUDE(${SCL_CMAKE_DIR}/SCL_Utils.cmake)
@@ -77,92 +102,89 @@ SET(_orig_lc_all $ENV{LC_ALL})
SET(_orig_lc_messages $ENV{LC_MESSAGES})
SET(_orig_lang $ENV{LANG})
IF(_orig_lc_all)
SET(ENV{LC_ALL} C)
SET(ENV{LC_ALL} C)
ENDIF(_orig_lc_all)
IF(_orig_lc_messages)
SET(ENV{LC_MESSAGES} C)
SET(ENV{LC_MESSAGES} C)
ENDIF(_orig_lc_messages)
IF(_orig_lang)
SET(ENV{LANG} C)
SET(ENV{LANG} C)
ENDIF(_orig_lang)
# For NFS volumes, to ensure proper file creation.
IF(NOT WIN32)
IF(NOT UMASK)
EXEC_PROGRAM(umask ARGS 022 OUTPUT_VARIABLE exec_out)
ELSE(NOT UMASK)
EXEC_PROGRAM(umask ARGS ${UMASK} OUTPUT_VARIABLE exec_out)
ENDIF(NOT UMASK)
ENDIF(NOT WIN32)
#---------------------------------------------------------------------
# Testing option
OPTION( ENABLE_TESTING "Enable unittesting framework" OFF )
IF(ENABLE_TESTING)
set( CMAKE_EXE_LINKER_FLAGS "-fprofile-arcs -ftest-coverage" ) #for code coverage
set( CMAKE_SHARED_LINKER_FLAGS "-fprofile-arcs -ftest-coverage" )
if( NOT DEFINED BUILD_SCHEMAS )
set( BUILD_SCHEMAS "ALL" ) #test all schemas, unless otherwise specified
endif()
INCLUDE(CTest)
ENABLE_TESTING()
SUBDIRS(test)
ENDIF(ENABLE_TESTING)
OPTION_WITH_DEFAULT( SCL_ENABLE_TESTING "Enable unittesting framework" OFF )
IF(SCL_ENABLE_TESTING)
if( NOT DEFINED SCL_BUILD_SCHEMAS )
set( SCL_BUILD_SCHEMAS "ALL" ) #test all schemas, unless otherwise specified
endif()
INCLUDE(CTest)
ENABLE_TESTING()
ENDIF(SCL_ENABLE_TESTING)
#---------------------------------------------------------------------
# The following logic is what allows binaries to run successfully in
# the build directory AND install directory. Thanks to plplot for
# Coverage option
OPTION_WITH_DEFAULT( SCL_ENABLE_COVERAGE "Enable code coverage test" OFF )
IF(SCL_ENABLE_COVERAGE)
SET(SCL_ENABLE_TESTING ON CACHE BOOL "Testing enabled by coverage option" FORCE)
# build static libs, better coverage report
SET(SCL_BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libs" FORCE )
SET(SCL_BUILD_STATIC_LIBS ON CACHE BOOL "Build static libs" FORCE )
SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -fprofile-arcs -ftest-coverage" CACHE STRING "Extra compile flags required by code coverage" FORCE)
SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -fprofile-arcs -ftest-coverage" CACHE STRING "Extra compile flags required by code coverage" FORCE)
SET(CMAKE_MODULE_LINKER_FLAGS_DEBUG "-fprofile-arcs -ftest-coverage" CACHE STRING "Extra linker flags required by code coverage" FORCE)
SET(SCL_BUILD_TYPE "Debug" CACHE STRING "Build type required by testing framework" FORCE)
ENDIF(SCL_ENABLE_COVERAGE)
#---------------------------------------------------------------------
# The following logic is what allows binaries to run successfully in
# the build directory AND install directory. Thanks to plplot for
# identifying the necessity of setting CMAKE_INSTALL_NAME_DIR on OSX.
# Documentation of these options is available at
# http://www.cmake.org/Wiki/CMake_RPATH_handling
# use, i.e. don't skip the full RPATH for the build tree
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
set(CMAKE_SKIP_BUILD_RPATH FALSE)
# when building, don't use the install RPATH already
# (but later on when installing)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
# the RPATH/INSTALL_NAME_DIR to be used when installing
if (NOT APPLE)
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib:\$ORIGIN/../lib")
endif(NOT APPLE)
SET(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
# On OSX, we need to set INSTALL_NAME_DIR instead of RPATH
# http://www.cmake.org/cmake/help/cmake-2-8-docs.html#variable:CMAKE_INSTALL_NAME_DIR
set(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
# add the automatically determined parts of the RPATH which point to
# add the automatically determined parts of the RPATH which point to
# directories outside the build tree to the install RPATH
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
#-----------------------------------------------------------------------------
# Output directories.
IF(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
IF(WIN32)
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${SCL_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all libraries.")
ELSE(WIN32)
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${SCL_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all libraries.")
ENDIF(WIN32)
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${SCL_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all libraries.")
ENDIF(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
IF(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${SCL_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all archives.")
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${SCL_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all archives.")
ENDIF(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
IF(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${SCL_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all executables.")
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${SCL_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all executables.")
ENDIF(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
FOREACH(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
STRING(TOUPPER "${CFG_TYPE}" CFG_TYPE)
IF(NOT "CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE}")
IF(WIN32)
SET("CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE}" ${SCL_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all libraries.")
ELSE(WIN32)
SET("CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE}" ${SCL_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all libraries.")
ENDIF(WIN32)
ENDIF(NOT "CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE}")
IF(NOT "CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFG_TYPE}")
SET("CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFG_TYPE}" ${SCL_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all archives.")
ENDIF(NOT "CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFG_TYPE}")
IF(NOT "CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE}")
SET("CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE}" ${SCL_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all executables.")
ENDIF(NOT "CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE}")
STRING(TOUPPER "${CFG_TYPE}" CFG_TYPE)
IF(NOT "CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE}")
SET("CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE}" ${SCL_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all libraries.")
ENDIF(NOT "CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE}")
IF(NOT "CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFG_TYPE}")
SET("CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFG_TYPE}" ${SCL_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all archives.")
ENDIF(NOT "CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFG_TYPE}")
IF(NOT "CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE}")
SET("CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE}" ${SCL_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all executables.")
ENDIF(NOT "CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE}")
ENDFOREACH()
@@ -172,85 +194,171 @@ ENDFOREACH()
# The location in which to install SCL. Need a good Debug location
# for Windows. Only do this if CMAKE_INSTALL_PREFIX hasn't been set
# already, to try and allow parent builds (if any) some control.
IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
IF(NOT WIN32)
IF ("${CMAKE_BUILD_TYPE}" MATCHES "Release")
SET(CMAKE_INSTALL_PREFIX "/usr")
ELSEIF ("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
MESSAGE("setting debug output dir")
SET(CMAKE_INSTALL_PREFIX "${SCL_SOURCE_DIR}/../scl-install")
ELSE("${CMAKE_BUILD_TYPE}" MATCHES "Release")
SET(CMAKE_INSTALL_PREFIX "/usr/local")
ENDIF ("${CMAKE_BUILD_TYPE}" MATCHES "Release")
ENDIF(NOT WIN32)
SET(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE STRING "SCL install prefix" FORCE)
SET(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT 0)
ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
if(NOT SCL_IS_SUBBUILD)
IF(NOT WIN32)
IF (${CMAKE_BUILD_TYPE} MATCHES "Debug")
SET(SCL_INSTALL_PREFIX "${SCL_SOURCE_DIR}/../scl-install")
ELSE()
SET(SCL_INSTALL_PREFIX "/usr/local")
ENDIF()
ENDIF(NOT WIN32)
SET( SCL_INSTALL_PREFIX ${SCL_INSTALL_PREFIX} CACHE
PATH "Install prefix prepended to target to create install location" )
SET( CMAKE_INSTALL_PREFIX ${SCL_INSTALL_PREFIX} CACHE INTERNAL "Prefix prepended to install directories if target destination is not absolute, immutable" FORCE )
endif(NOT SCL_IS_SUBBUILD)
OPTION(SCL-BUILD_EXPRESS_ONLY "Only build express parser." OFF)
MARK_AS_ADVANCED(SCL-BUILD_EXPRESS_ONLY)
OPTION(SCL_BUILD_EXPRESS_ONLY "Only build express parser." OFF)
MARK_AS_ADVANCED(SCL_BUILD_EXPRESS_ONLY)
# Take the scl config file template and copy it to the build directory so CMake
# scripts can append to it if need be
configure_file(${SCL_SOURCE_DIR}/include/scl_cf_cmake.h.in ${SCL_BINARY_DIR}/include/scl_cf.h.in COPYONLY)
# Take the scl config file template as the starting point for
# scl_cf.h.in - scripts may need to append to the template, so
# it is read into memory initially.
SET(CONFIG_H_FILE ${SCL_BINARY_DIR}/include/scl_cf.h.in)
set(CMAKE_CURRENT_PROJECT SCL)
define_property(GLOBAL PROPERTY SCL_CONFIG_H_CONTENTS BRIEF_DOCS "config.h.in contents" FULL_DOCS "config.h.in contents for SCL project")
if(NOT COMMAND CONFIG_H_APPEND)
macro(CONFIG_H_APPEND PROJECT_NAME NEW_CONTENTS)
if(PROJECT_NAME)
get_property(${PROJECT_NAME}_CONFIG_H_CONTENTS GLOBAL PROPERTY ${PROJECT_NAME}_CONFIG_H_CONTENTS)
set(${PROJECT_NAME}_CONFIG_H_FILE_CONTENTS "${${PROJECT_NAME}_CONFIG_H_CONTENTS}${NEW_CONTENTS}")
set_property(GLOBAL PROPERTY ${PROJECT_NAME}_CONFIG_H_CONTENTS "${${PROJECT_NAME}_CONFIG_H_FILE_CONTENTS}")
endif(PROJECT_NAME)
endmacro(CONFIG_H_APPEND NEW_CONTENTS)
endif(NOT COMMAND CONFIG_H_APPEND)
file(READ ${SCL_SOURCE_DIR}/include/scl_cf_cmake.h.in CONFIG_H_FILE_CONTENTS)
CONFIG_H_APPEND(SCL "${CONFIG_H_FILE_CONTENTS}")
INCLUDE(CheckLibraryExists)
INCLUDE(CheckIncludeFile)
INCLUDE(CheckFunctionExists)
INCLUDE(CheckTypeSize)
INCLUDE(CMakePushCheckState)
INCLUDE(CheckCXXSourceRuns)
INCLUDE(${SCL_CMAKE_DIR}/FindLEX.cmake)
INCLUDE(${SCL_CMAKE_DIR}/FindYACC.cmake)
CHECK_INCLUDE_FILE(ndir.h HAVE_NDIR_H)
CHECK_INCLUDE_FILE(stdarg.h HAVE_STDARG_H)
CHECK_INCLUDE_FILE(sys/stat.h HAVE_SYS_STAT_H)
CHECK_INCLUDE_FILE(sys/param.h HAVE_SYS_PARAM_H)
CHECK_INCLUDE_FILE(sysent.h HAVE_SYSENT_H)
CHECK_INCLUDE_FILE(unistd.h HAVE_UNISTD_H)
CHECK_INCLUDE_FILE(dirent.h HAVE_DIRENT_H)
CHECK_INCLUDE_FILE(stdbool.h HAVE_STDBOOL_H)
CHECK_INCLUDE_FILE(process.h HAVE_PROCESS_H)
CHECK_INCLUDE_FILE(io.h HAVE_IO_H)
CHECK_FUNCTION_EXISTS(abs HAVE_ABS)
CHECK_FUNCTION_EXISTS(memcpy HAVE_MEMCPY)
CHECK_FUNCTION_EXISTS(memmove HAVE_MEMMOVE)
CHECK_FUNCTION_EXISTS(getopt HAVE_GETOPT)
CHECK_TYPE_SIZE("ssize_t" SSIZE_T)
#set GIT_COMMIT_ID to the output of `git describe`
find_package(Git)
if(GIT_FOUND)
execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags RESULT_VARIABLE res_var OUTPUT_VARIABLE GIT_COM_ID )
if( NOT ${res_var} EQUAL 0 )
set( GIT_COMMIT_ID "unknown (git failed!)")
message( WARNING "Git failed (not a repo?). Build will not contain git revision info." )
endif()
string( REPLACE "\n" "" GIT_COMMIT_ID ${GIT_COM_ID} )
else()
set( GIT_COMMIT_ID "unknown (git not found!)")
message( WARNING "Git not found. Build will not contain git revision info." )
endif()
set( TEST_STD_THREAD "
#include <iostream>
#include <thread>
void do_work() {
std::cout << \"thread\" << std::endl;
}
int main() {
std::thread t(do_work);
t.join();
}
" )
cmake_push_check_state()
if( UNIX )
set( CMAKE_REQUIRED_FLAGS "-pthread -std=c++0x" )
else( UNIX )
# vars probably need set for MSVC11, embarcadero, etc
endif( UNIX )
CHECK_CXX_SOURCE_RUNS( "${TEST_STD_THREAD}" HAVE_STD_THREAD ) #quotes are *required*!
cmake_pop_check_state()
# Now that all the tests are done, configure the scl_cf.h file:
configure_file(${SCL_BINARY_DIR}/include/scl_cf.h.in ${SCL_BINARY_DIR}/include/scl_cf.h)
get_property(CONFIG_H_FILE_CONTENTS GLOBAL PROPERTY SCL_CONFIG_H_CONTENTS)
file(WRITE ${CONFIG_H_FILE} "${CONFIG_H_FILE_CONTENTS}")
configure_file(${CONFIG_H_FILE} ${SCL_BINARY_DIR}/include/scl_cf.h)
add_definitions(
-DHAVE_CONFIG_H -Wall
)
################ create scl_version_string.h, http://stackoverflow.com/questions/3780667
# Using 'ver_string' instead of 'scl_version_string.h' is a trick to force the
# command to always execute when the custom target is built. It works because
# a file by that name never exists.
configure_file(${SCL_CMAKE_DIR}/scl_version_string.cmake ${SCL_BINARY_DIR}/scl_version_string.cmake @ONLY)
add_custom_target(version_string ALL DEPENDS ver_string )
# creates scl_version_string.h using cmake script
add_custom_command(OUTPUT ver_string ${CMAKE_CURRENT_BINARY_DIR}/include/scl_version_string.h
COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${SCL_SOURCE_DIR}
-DBINARY_DIR=${SCL_BINARY_DIR}
-P ${SCL_BINARY_DIR}/scl_version_string.cmake)
# scl_version_string.h is a generated file
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/include/scl_version_string.h
PROPERTIES GENERATED TRUE
HEADER_FILE_ONLY TRUE )
################
if(MSVC)
# add_definitions( -Wall )
add_definitions( -D__MSVC__ -D__WIN32__ )
# Disable warning for preferred usage of secure functions (example strcpy should be strcpy_s, ...)
add_definitions( -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS )
elseif(BORLAND)
add_definitions( -D__BORLAND__ -D__WIN32__ )
else()
add_definitions( -pedantic -W -Wall -Wundef -Wfloat-equal -Wshadow -Winline -Wno-long-long )
endif()
include_directories(
${SCL_SOURCE_DIR}/include
${SCL_BINARY_DIR}/include
)
${SCL_SOURCE_DIR}/include
${SCL_BINARY_DIR}/include
)
ADD_SUBDIRECTORY(src/base)
ADD_SUBDIRECTORY(src/express)
ADD_SUBDIRECTORY(src/exppp)
ADD_SUBDIRECTORY(src/fedex_plus)
ADD_SUBDIRECTORY(src/fedex_python)
ADD_SUBDIRECTORY(src/clstepcore)
ADD_SUBDIRECTORY(src/cleditor)
ADD_SUBDIRECTORY(src/cldai)
ADD_SUBDIRECTORY(src/clutils)
ADD_SUBDIRECTORY(include)
ADD_SUBDIRECTORY(data)
IF(SCL_ENABLE_TESTING)
ADD_SUBDIRECTORY( test )
ENDIF(SCL_ENABLE_TESTING)
ADD_SUBDIRECTORY(doc)
# this is for testing - 'make core' builds everything that isn't generated
add_custom_target( core )
add_dependencies( core stepdai check-express stepeditor fedex_plus )
if(NOT SCL_IS_SUBBUILD)
###############################################################################
# SCL Packaging #
# $make package #
###############################################################################
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "STEP Class Library")
SET(CPACK_SET_DESTDIR "ON")
SET(CPACK_PACKAGE_VERSION_MAJOR ${SCL_VERSION_MAJOR})
SET(CPACK_PACKAGE_VERSION_MINOR ${SCL_VERSION_MINOR})
SET(CPACK_PACKAGE_NAME SCL )
SET(CPACK_PACKAGE_CONTACT "SCL Developers <scl-dev@googlegroups.com>")
INCLUDE(CPack)
########################################################################################
# Uninstall code #
# From http://www.cmake.org/Wiki/CMake_FAQ#Can_I_do_.22make_uninstall.22_with_CMake.3F #
# ######################################################################################
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
endif(NOT SCL_IS_SUBBUILD)
+30 -7
View File
@@ -6,7 +6,7 @@ STEP Class Library.
These installation requires that you have the following software
available:
- C and C++ compilers (only gcc has been tested recently)
- C and C++ compilers (Tested with GCC, MSVC, Embarcadero)
- bison, byacc, or yacc (only bison has been tested recently)
- flex or lex (only flex has been tested recently)
- CMake
@@ -21,12 +21,22 @@ Installation
* Build system uses CMake now: configure, Makefile, and all
autotools files have been removed, as has mkProbe.
* To build:
cd scl
mkdir build
cd build
cmake ..
make
* Building SCL from the command prompt:
- cd scl
- mkdir build
- cd build
- cmake ..
- make
- make install # optional
* Building SCL from the GUI:
- Run cmake-gui, set it to build in scl/build
- Select the correct build file generator
- Press Configure
- Change options as necessary, configuring again afterwards
- If there are errors, some options may not be visible until the error is resolved
- Press Generate
- Open the main build file using your preferred build tool
* Build options (append to the 'cmake ..' line):
-DBUILD_SCHEMAS="path/to/schema.exp;path/to/schema2.exp"
@@ -45,3 +55,16 @@ Installation
-DCMAKE_BUILD_TYPE=Release
- this causes binaries to be built without debugging information
- without this, cmake defaults to a Debug build
* Using CTest to test SCL:
- Read the comments in run_ctest.cmake
- (OPTIONAL) Create scl/../.SCL_CTEST_PREFS.cmake, and set variables
in it (this file is required for CDash submission to be enabled)
- Run tests with `ctest -S run_ctest.cmake`
* Using CTest to regenerate the schema matrix on the github SCL wiki:
- Requires:
- git
- python
- a clone of the git repo for the wiki at scl/../wiki-scl
- run `ctest -S ctest_matrix.cmake`
+32 -1
View File
@@ -1,5 +1,36 @@
STEP Class Library ------ https://github.com/mpictor/StepClassLibrary
STEP Class Library ------ http://github.com/mpictor/StepClassLibrary
************************************************************************
Release 0.5 (Feb 23, 2012)
New since v0.4:
* MSVC and Embarcadero support, along with many warning fixes
* Experimental Python support
* Now handles most features of EXPRESS - all included schemas,
with the exception of AP209 CD, are parsed without error. Enums are
now in their own dictionary. Allow indexing on aggregates, generics,
and binaries.
* Changes to fedex_plus that improve the generated c++ - use a
namespace, break up large static strings, make EXPRESS multiple
inheritance work by not printing multiple copies of inherited members.
All schemas now compile without error, but there are numerous warnings.
* Exchange files: handle all comments, fill in some missing attributes.
* More cleanup of source code, more documentation in scl/doc
* Special thanks to @davyw and @tpaviot for their large contributions
(MSVC and Python, respectively)
************************************************************************
Release 0.4 (Nov 13, 2011)
New since v0.3:
* Improve p21read performance by ~30%
* Improve fedex_plus performance by ~4300% (!)
* A variable defined in a LOCAL is not required to have a type label
(affected ap242,210e3,209)
* Enums and entities are allowed to have the same names
(affected ap242,210e3,209)
* Remove the SCLP23 macro
http://github.com/mpictor/StepClassLibrary/wiki/changelog-v0.4
************************************************************************
Release 0.3 (Oct 29, 2011)
What's new since v0.2?
+5 -36
View File
@@ -1,12 +1,10 @@
***********************************************************************
Step Class Library v0.3 -- https://github.com/mpictor/StepClassLibrary
Step Class Library v0.5 -- http://github.com/mpictor/StepClassLibrary
* What is SCL? SCL reads ISO10303-11 EXPRESS schemas and generates
C++ source code that can read and write Part 21 files conforming
to that schema. SCL once worked with ObjectStore, OODB, and
CORBA IDL - but that code has not been used in a very long time.
We are in the process of removing this code because ObjectStore,
CORBA, etc. are no longer part of the STEP standard.
C++ source code that can read and write Part 21 files conforming
to that schema. In addition to C++, v0.5 includes experimental
support for Python.
* SCL is packaged along with some other tools. See
"THE NIST STEP TOOLSET", below. In particular, Data Probe
@@ -21,36 +19,7 @@ Step Class Library v0.3 -- https://github.com/mpictor/StepClassLibrary
* Build system uses only CMake now: configure, Makefile, and all
autotools files have been removed, as has mkProbe.
* To build:
cd scl
mkdir build
cd build
cmake ..
make
* Build options (append to the 'cmake ..' line):
-DBUILD_SCHEMAS="path/to/schema.exp;path/to/schema2.exp"
- this generates c++ for the schema, and compiles it into a
library. Also works with directories, as long as each dir only
has one express file.
- multiple files/directories are separated by semicolons
- this also builds a 'p21read' program, which reads one step file
and writes another. It may change whitespace or remove comments;
otherwise, the input and output files should be identical. If
they are not identical, either the file does not match the
schema, or SCL generated incorrect source code.
-DBUILD_SCHEMAS=ALL
- Added to make use of ctest easier. If BUILD_SCHEMAS == ALL,
then CMake adds each *.exp file found in data/.
-DCMAKE_BUILD_TYPE=Release
- this causes binaries to be built without debugging information
- without this, cmake defaults to a Debug build
* Using CTest to test SCL:
- Read the comments in run_ctest.cmake
- (OPTIONAL) Create scl/../.SCL_CTEST_PREFS.cmake, and set variables
in it (this file is required for CDash submission to be enabled)
- Run tests with `ctest -S run_ctest.cmake`
* Building and testing SCL - see the INSTALL file
***********************************************************************
+1
View File
@@ -0,0 +1 @@
0.5
-3
View File
@@ -151,9 +151,6 @@ IF(LEX_EXECUTABLE)
SET(FILE_RUN_DEFINITIONS "-DYYTEXT_POINTER=1")
CHECK_C_FILE_RUNS(${CMAKE_CURRENT_SOURCE_DIR}/cmake/test_srcs/sys_wait_test.c YYTEXT_POINTER)
SET(FILE_RUN_DEFINITIONS)
IF(CONFIG_H_FILE)
FILE(APPEND ${CONFIG_H_FILE} "#cmakedefine YYTEXT_POINTER 1\n")
ENDIF(CONFIG_H_FILE)
ENDIF(LEX_EXECUTABLE)
+5 -5
View File
@@ -33,15 +33,15 @@ MACRO(SCL_ADDLIB libname srcs libs)
STRING(REGEX REPLACE " " ";" libslist1 "${libs}")
STRING(REGEX REPLACE "-framework;" "-framework " libslist "${libslist1}")
DLL_DEFINE(${libname})
IF(BUILD_SHARED_LIBS)
IF(SCL_BUILD_SHARED_LIBS)
add_library(${libname} SHARED ${srcslist})
if(NOT ${libs} MATCHES "NONE")
target_link_libraries(${libname} ${libslist})
endif(NOT ${libs} MATCHES "NONE")
SET_TARGET_PROPERTIES(${libname} PROPERTIES VERSION ${SCL_VERSION_MAJOR}.${SCL_VERSION_MINOR} SOVERSION ${SCL_VERSION_MAJOR} )
SET_TARGET_PROPERTIES(${libname} PROPERTIES VERSION ${SCL_ABI_VERSION} SOVERSION ${SCL_ABI_SOVERSION} )
INSTALL(TARGETS ${libname} DESTINATION lib)
ENDIF(BUILD_SHARED_LIBS)
IF(BUILD_STATIC_LIBS AND NOT MSVC)
ENDIF(SCL_BUILD_SHARED_LIBS)
IF(SCL_BUILD_STATIC_LIBS AND NOT MSVC)
add_library(${libname}-static STATIC ${srcslist})
if(NOT ${libs} MATCHES "NONE")
target_link_libraries(${libname}-static ${libslist})
@@ -56,7 +56,7 @@ MACRO(SCL_ADDLIB libname srcs libs)
SET_TARGET_PROPERTIES(${libname}-static PROPERTIES PREFIX "lib")
ENDIF(WIN32)
INSTALL(TARGETS ${libname}-static DESTINATION lib)
ENDIF(BUILD_STATIC_LIBS AND NOT MSVC)
ENDIF(SCL_BUILD_STATIC_LIBS AND NOT MSVC)
# Enable extra compiler flags if local libraries and/or global options dictate
SET(LOCAL_COMPILE_FLAGS "")
FOREACH(extraarg ${ARGN})
+22
View File
@@ -0,0 +1,22 @@
if (NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
string(REGEX REPLACE "\n" ";" files "${files}")
list(REVERSE files)
foreach (file ${files})
message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
if (EXISTS "$ENV{DESTDIR}${file}")
execute_process(
COMMAND ${CMAKE_COMMAND} -E remove "$ENV{DESTDIR}${file}"
OUTPUT_VARIABLE rm_out
RESULT_VARIABLE rm_retval
)
if(NOT ${rm_retval} EQUAL 0)
message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
endif (NOT ${rm_retval} EQUAL 0)
else (EXISTS "$ENV{DESTDIR}${file}")
message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
endif (EXISTS "$ENV{DESTDIR}${file}")
endforeach(file)
+58
View File
@@ -0,0 +1,58 @@
#use git for a pretty commit id
#uses 'git describe --tags', so tags are required in the repo
#create a tag with 'git tag <name>' and 'git push --tags'
# http://stackoverflow.com/questions/3780667
# http://www.cmake.org/pipermail/cmake/2009-February/027014.html
#scl_version_string.h defines scl_version() which returns a pretty commit description and a build timestamp.
set(SCL_IS_SUBBUILD "@SCL_IS_SUBBUILD@")
set(VERS_FILE ${SOURCE_DIR}/SCL_VERSION.txt )
if( EXISTS ${SOURCE_DIR}/.git )
find_package(Git QUIET)
if(GIT_FOUND)
execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags RESULT_VARIABLE res_var OUTPUT_VARIABLE GIT_COMMIT_ID )
if( NOT ${res_var} EQUAL 0 )
file( READ ${VERS_FILE} GIT_COMMIT_ID LIMIT 255 )
if(NOT SCL_IS_SUBBUILD)
message( WARNING "Git failed (probably no tags in repo). Build will contain revision info from ${VERS_FILE}." )
endif(NOT SCL_IS_SUBBUILD)
endif()
else(GIT_FOUND)
file( READ ${VERS_FILE} GIT_COMMIT_ID LIMIT 255 )
if(NOT SCL_IS_SUBBUILD)
message( WARNING "Git not found. Build will contain revision info from ${VERS_FILE}." )
endif(NOT SCL_IS_SUBBUILD)
endif(GIT_FOUND)
else()
file( READ ${VERS_FILE} GIT_COMMIT_ID LIMIT 255 )
if(NOT SCL_IS_SUBBUILD)
message( WARNING "Git failed ('.git' not found). Build will contain revision info from ${VERS_FILE}." )
endif(NOT SCL_IS_SUBBUILD)
endif()
string( REPLACE "\n" "" GIT_COMMIT_ID ${GIT_COMMIT_ID} )
set( vstring "//scl_version_string.h - written by cmake. Changes will be lost!\n"
"#ifndef SCL_VERSION_STRING\n"
"#define SCL_VERSION_STRING\n\n"
"/*\n** Returns a string like \"test-1-g5e1fb47, built at TIME on DATE\", where test is the\n"
"** name of the last tagged git revision, 1 is the number of commits since that tag,\n"
"** 'g' is unknown, 5e1fb47 is the first 7 chars of the git sha1 commit id, and TIME\n"
"** and DATE are substituted by the compiler.\n*/\n\n"
"const char* scl_version() {\n"
" return \"git commit id ${GIT_COMMIT_ID}, built at \"__TIME__\" on \"__DATE__\;\n"
"}\n\n"
"#endif\n"
)
file(WRITE scl_version_string.h.txt ${vstring} )
# copy the file to the final header only if the version changes
# reduces needless rebuilds
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
scl_version_string.h.txt ${BINARY_DIR}/include/scl_version_string.h)
if(NOT SCL_IS_SUBBUILD)
message("-- scl_version_string.h is up-to-date.")
endif(NOT SCL_IS_SUBBUILD)
+25
View File
@@ -0,0 +1,25 @@
# run_ctest.cmake
# `ctest -S run_ctest.cmake`
set( CTEST_SOURCE_DIRECTORY . )
set( CTEST_BINARY_DIRECTORY build_matrix )
set( CTEST_CMAKE_GENERATOR "Unix Makefiles" )
set( CTEST_MEMORYCHECK_COMMAND /usr/bin/valgrind )
set( CTEST_INITIAL_CACHE "
SITE:STRING=${CTEST_SITE}
BUILDNAME:STRING=${CTEST_BUILD_NAME}
SCL_ENABLE_TESTING:BOOL=ON
SCL_BUILD_TYPE:STRING=Debug
")
ctest_start(matrix)
ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})
ctest_configure( BUILD "${CTEST_BINARY_DIRECTORY}" OPTIONS -DSCL_ENABLE_TESTING=ON )
ctest_build( BUILD "${CTEST_BINARY_DIRECTORY}" )
message("running tests")
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" INCLUDE_LABEL "cpp_schema_....*" )
message("running python script")
execute_process( COMMAND python ../misc/wiki-scripts/update-matrix.py
WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY} )
+37 -54
View File
@@ -1,49 +1,14 @@
IF( INSTALL_DATA )
SET(ap203_data
ap203/203wseds.exp
ap203/cube1.p21
ap203/cube2.p21
ap203/g_r_assembly1.p21
ap203/gasket1.p21
ap203/gasket2.p21
ap203/gasket3.p21
ap203/hex_prism1.p21
ap203/rod_aspect1.p21
ap203/star1.p21
)
INSTALL(FILES ${ap203_data} DESTINATION ${DATA_DIR}/data/ap203)
SET(ap227_data
ap227/ap227.exp
ap227/mitre.p21
ap227/mitre.step.txt
)
INSTALL(FILES ${ap227_data} DESTINATION ${DATA_DIR}/data/ap227)
SET(step_example_data
example/example.exp
)
INSTALL(FILES ${step_example_data} DESTINATION ${DATA_DIR}/data/example)
SET(step_datafiles
pdmnet.exp
select.exp
)
INSTALL(FILES ${step_datafiles} DESTINATION ${DATA_DIR}/data)
ENDIF( INSTALL_DATA )
#this sets a property so that the target doesn't get built by 'make' or 'make all'
#useful when testing generation of schema code/compiling schem libs/etc
FUNCTION( TESTABLE_TARGET target )
if(ENABLE_TESTING)
if(SCL_ENABLE_TESTING)
set_target_properties( ${target} PROPERTIES EXCLUDE_FROM_ALL ON )
endif()
ENDFUNCTION( TESTABLE_TARGET )
# To build one or more schemas, configure with
# 'cmake -DBUILD_SCHEMAS="path/to/schema.exp;path/to/schema2.exp"
# 'cmake -DSCL_BUILD_SCHEMAS="path/to/schema.exp;path/to/schema2.exp"
# This function runs fedex on one express file. The generated source goes in a dir
# in the build dir, and it is compiled into a library. A p21read executable is
@@ -69,7 +34,8 @@ FUNCTION(BUILD_A_SCHEMA SCHEMA_FILE)
file(STRINGS ${SCHEMA_FILE} SCHEMA_STATEMENT LIMIT_COUNT 1 REGEX "^SCHEMA .*")
string(REGEX REPLACE "^SCHEMA \(.*\)\;$" "\\1" SCHEMA_N ${SCHEMA_STATEMENT} )
string(TOUPPER ${SCHEMA_N} SCHEMA_LONG_NAME) #fedex_plus always uses upper case for file names
get_filename_component(SCHEMA_SHORT_NAME ${SCHEMA_FILE} NAME_WE)
get_filename_component( SCHEMA_SN ${SCHEMA_FILE} NAME )
string( REGEX REPLACE "\(.*\).[Ee][Xx][Pp]" "\\1" SCHEMA_SHORT_NAME ${SCHEMA_SN} )
project( sdai_${SCHEMA_SHORT_NAME} )
message( STATUS "Generating code for ${SCHEMA_SHORT_NAME}.")
@@ -85,9 +51,9 @@ FUNCTION(BUILD_A_SCHEMA SCHEMA_FILE)
# multiple schemas, each one will use the include dirs from all previous schemas. Since
# one header (schema.h) is always named the same, this will not work. only workaround
# seems to be set_target_properties( <target> PROPERTIES COMPILE_FLAGS <flags> )
set( ${PROJECT_NAME}_COMPILE_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR} -I${SCL_SOURCE_DIR}/src/cldai -I${SCL_SOURCE_DIR}/src/cleditor -I${SCL_SOURCE_DIR}/src/clutils -I${SCHEMA_OUTPUT_DIR} -I${SCL_SOURCE_DIR}/src/clstepcore" )
set( ${PROJECT_NAME}_COMPILE_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR} -I${SCL_SOURCE_DIR}/src/cldai -I${SCL_SOURCE_DIR}/src/cleditor -I${SCL_SOURCE_DIR}/src/clutils -I${SCHEMA_OUTPUT_DIR} -I${SCL_SOURCE_DIR}/src/clstepcore -I${SCL_SOURCE_DIR}/src/base" )
add_custom_target( generate_${SCHEMA_SHORT_NAME} SOURCES ${FEDEX_OUT} )
add_custom_target( generate_cpp_${SCHEMA_SHORT_NAME} SOURCES ${FEDEX_OUT} )
add_custom_command( OUTPUT ${SCHEMA_OUTPUT_DIR}
COMMAND cmake ARGS -E make_directory ${SCHEMA_OUTPUT_DIR}
COMMENT "Creating ${SCHEMA_OUTPUT_DIR} for schema ${SCHEMA_SHORT_NAME}")
@@ -97,29 +63,46 @@ FUNCTION(BUILD_A_SCHEMA SCHEMA_FILE)
WORKING_DIRECTORY ${SCHEMA_OUTPUT_DIR}
COMMENT "Running fedex_plus for ${SCHEMA_SHORT_NAME}..."
VERBATIM )
if(MSVC OR BORLAND)
add_definitions( -DSCL_SCHEMA_DLL_EXPORTS )
add_definitions( -DSCL_BASE_DLL_IMPORTS )
add_definitions( -DSCL_EXPRESS_DLL_IMPORTS )
add_definitions( -DSCL_UTILS_DLL_IMPORTS )
add_definitions( -DSCL_DAI_DLL_IMPORTS )
add_definitions( -DSCL_CORE_DLL_IMPORTS )
add_definitions( -DSCL_EDITOR_DLL_IMPORTS )
endif()
add_library( ${PROJECT_NAME} SHARED ${FEDEX_OUT} )
target_link_libraries(${PROJECT_NAME} stepdai stepcore express stepeditor )
add_dependencies( ${PROJECT_NAME} generate_${SCHEMA_SHORT_NAME} )
target_link_libraries(${PROJECT_NAME} stepdai stepcore express stepeditor steputils base )
add_dependencies( ${PROJECT_NAME} generate_cpp_${SCHEMA_SHORT_NAME} )
set_target_properties( ${PROJECT_NAME} PROPERTIES COMPILE_FLAGS
${${PROJECT_NAME}_COMPILE_FLAGS} )
if(APPLE)
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-flat_namespace -undefined suppress")
endif(APPLE)
TESTABLE_TARGET( ${PROJECT_NAME} )
add_test( NAME generate_${SCHEMA_SHORT_NAME}
add_test( NAME generate_cpp_${SCHEMA_SHORT_NAME}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} --build .
--target generate_${SCHEMA_SHORT_NAME}
--target generate_cpp_${SCHEMA_SHORT_NAME}
--config $<CONFIGURATION> )
add_test( NAME build_${PROJECT_NAME}
add_test( NAME build_cpp_${PROJECT_NAME}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} --build .
--target p21read_${PROJECT_NAME}
--config $<CONFIGURATION> )
# label the tests and set dependencies
set_tests_properties( generate_${SCHEMA_SHORT_NAME} PROPERTIES LABELS schema_gen )
set_tests_properties( build_${PROJECT_NAME} PROPERTIES DEPENDS generate_${SCHEMA_SHORT_NAME} LABELS schema_build )
set_tests_properties( generate_cpp_${SCHEMA_SHORT_NAME} PROPERTIES LABELS cpp_schema_gen )
set_tests_properties( build_cpp_${PROJECT_NAME} PROPERTIES DEPENDS generate_cpp_${SCHEMA_SHORT_NAME} LABELS cpp_schema_build )
add_executable( p21read_${PROJECT_NAME} ${SCL_SOURCE_DIR}/src/test/p21read/p21read.cc )
if(MSVC OR BORLAND)
add_executable( p21read_${PROJECT_NAME} ${SCL_SOURCE_DIR}/src/test/p21read/p21read.cc ${SCL_SOURCE_DIR}/src/fedex_plus/xgetopt.cc )
else()
add_executable( p21read_${PROJECT_NAME} ${SCL_SOURCE_DIR}/src/test/p21read/p21read.cc )
endif()
add_dependencies( p21read_${PROJECT_NAME} version_string )
target_link_libraries( p21read_${PROJECT_NAME} ${PROJECT_NAME} )
set_target_properties( p21read_${PROJECT_NAME} PROPERTIES COMPILE_FLAGS
${${PROJECT_NAME}_COMPILE_FLAGS} )
@@ -130,19 +113,19 @@ FUNCTION(BUILD_A_SCHEMA SCHEMA_FILE)
file( GLOB_RECURSE P21_FILES ${SCHEMA_DIR}/*.stp ${SCHEMA_DIR}/*.step ${SCHEMA_DIR}/*.p21 )
foreach( TEST_FILE ${P21_FILES} )
get_filename_component( FNAME ${TEST_FILE} NAME_WE )
add_test( NAME read_write_${SCHEMA_SHORT_NAME}_${FNAME}
add_test( NAME read_write_cpp_${SCHEMA_SHORT_NAME}_${FNAME}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMAND p21read_${PROJECT_NAME} ${TEST_FILE} )
set_tests_properties( read_write_${SCHEMA_SHORT_NAME}_${FNAME} PROPERTIES DEPENDS build_${PROJECT_NAME} LABELS schema_rw )
set_tests_properties( read_write_cpp_${SCHEMA_SHORT_NAME}_${FNAME} PROPERTIES DEPENDS build_cpp_${PROJECT_NAME} LABELS cpp_schema_rw )
endforeach()
ENDFUNCTION(BUILD_A_SCHEMA)
if( DEFINED BUILD_SCHEMAS )
if( BUILD_SCHEMAS STREQUAL "ALL" )
file( GLOB_RECURSE BUILD_SCHEMAS ${SCL_SOURCE_DIR}/data/*.exp )
if( DEFINED SCL_BUILD_SCHEMAS )
if( SCL_BUILD_SCHEMAS STREQUAL "ALL" )
file( GLOB_RECURSE SCL_BUILD_SCHEMAS ${SCL_SOURCE_DIR}/data/*.exp )
endif()
foreach( ap ${BUILD_SCHEMAS} )
foreach( ap ${SCL_BUILD_SCHEMAS} )
BUILD_A_SCHEMA( ${ap} )
endforeach()
endif()
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -5,7 +5,7 @@
(* The schema is converted from ISO10303 P11-2003 to ISO10303 P11-1994 *)
(* ===================================================================================== *)
SCHEMA Ap210_electronic_assembly_interconnect_and_packaging_design_mim_LF;
SCHEMA wip210_electronic_assembly_interconnect_and_packaging_design_mim_LF;
CONSTANT
@@ -15,7 +15,7 @@ CONSTANT
dummy_gri : geometric_representation_item := representation_item('')||
geometric_representation_item();
schema_prefix : STRING := 'AP210_ELECTRONIC_ASSEMBLY_INTERCONNECT_AND_PACKAGING_DESIGN_MIM_LF.';
schema_prefix : STRING := 'WIP210_ELECTRONIC_ASSEMBLY_INTERCONNECT_AND_PACKAGING_DESIGN_MIM_LF.';
the_empty_maths_tuple : maths_tuple := [];
File diff suppressed because it is too large Load Diff
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
+12 -5
View File
@@ -1,7 +1,14 @@
SET(scl_MANS
man/man1/dataprobe.1
man/man1/fedex.1
man/man1/fedex_plus.1
man/man1/mkProbe.1
man/man1/dataprobe.1
man/man1/fedex.1
man/man1/fedex_plus.1
man/man1/mkProbe.1
)
INSTALL(FILES ${scl_MANS} DESTINATION ${MAN_DIR}/man1)
if(NOT DEFINED MAN_DIR)
set(MAN_DIR share/man)
endif(NOT DEFINED MAN_DIR)
IF(NOT WIN32)
INSTALL(FILES ${scl_MANS} DESTINATION ${CMAKE_INSTALL_PREFIX}/${MAN_DIR}/man1)
ENDIF(NOT WIN32)
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because it is too large Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+49 -48
View File
@@ -1,57 +1,58 @@
extern int exppp_nesting_indent; /* default nesting indent */
extern int exppp_continuation_indent; /* default nesting indent for */
#include <scl_export.h>
extern SCL_EXPPP_EXPORT int exppp_nesting_indent; /* default nesting indent */
extern SCL_EXPPP_EXPORT int exppp_continuation_indent; /* default nesting indent for */
/* continuation lines */
extern int exppp_linelength; /* leave some slop for closing */
extern SCL_EXPPP_EXPORT int exppp_linelength; /* leave some slop for closing */
/* parens. \n is not included in */
/* this count either */
extern bool exppp_rmpp; /* if true, create rmpp */
extern bool exppp_alphabetize; /* if true, alphabetize */
extern bool exppp_terse; /* don't describe action to stdout */
extern bool exppp_reference_info; /* if true, add commentary */
extern SCL_EXPPP_EXPORT bool exppp_rmpp; /* if true, create rmpp */
extern SCL_EXPPP_EXPORT bool exppp_alphabetize; /* if true, alphabetize */
extern SCL_EXPPP_EXPORT bool exppp_terse; /* don't describe action to stdout */
extern SCL_EXPPP_EXPORT bool exppp_reference_info; /* if true, add commentary */
/* about where things came from */
extern bool exppp_preserve_comments; /* if true, preserve comments where */
extern SCL_EXPPP_EXPORT bool exppp_preserve_comments; /* if true, preserve comments where */
/* possible */
extern char * exppp_output_filename; /* force output filename */
extern bool exppp_output_filename_reset; /* if true, force output filename */
extern SCL_EXPPP_EXPORT char * exppp_output_filename; /* force output filename */
void EXPRESSout( Express e );
SCL_EXPPP_EXPORT void EXPRESSout( Express e );
void ENTITYout( Entity e );
void EXPRout( Expression expr );
void FUNCout( Function f );
void PROCout( Procedure p );
void RULEout( Rule r );
char * SCHEMAout( Schema s );
void SCHEMAref_out( Schema s );
void STMTout( Statement s );
void TYPEout( Type t );
void TYPEhead_out( Type t );
void TYPEbody_out( Type t );
void WHEREout( Linked_List w );
SCL_EXPPP_EXPORT void ENTITYout( Entity e );
SCL_EXPPP_EXPORT void EXPRout( Expression expr );
SCL_EXPPP_EXPORT void FUNCout( Function f );
SCL_EXPPP_EXPORT void PROCout( Procedure p );
SCL_EXPPP_EXPORT void RULEout( Rule r );
SCL_EXPPP_EXPORT char * SCHEMAout( Schema s );
SCL_EXPPP_EXPORT void SCHEMAref_out( Schema s );
SCL_EXPPP_EXPORT void STMTout( Statement s );
SCL_EXPPP_EXPORT void TYPEout( Type t );
SCL_EXPPP_EXPORT void TYPEhead_out( Type t );
SCL_EXPPP_EXPORT void TYPEbody_out( Type t );
SCL_EXPPP_EXPORT void WHEREout( Linked_List w );
char * REFto_string( Dictionary refdict, Linked_List reflist, char * type, int level );
char * ENTITYto_string( Entity e );
char * SUBTYPEto_string( Expression e );
char * EXPRto_string( Expression expr );
char * FUNCto_string( Function f );
char * PROCto_string( Procedure p );
char * RULEto_string( Rule r );
char * SCHEMAref_to_string( Schema s );
char * STMTto_string( Statement s );
char * TYPEto_string( Type t );
char * TYPEhead_to_string( Type t );
char * TYPEbody_to_string( Type t );
char * WHEREto_string( Linked_List w );
SCL_EXPPP_EXPORT char * REFto_string( Dictionary refdict, Linked_List reflist, char * type, int level );
SCL_EXPPP_EXPORT char * ENTITYto_string( Entity e );
SCL_EXPPP_EXPORT char * SUBTYPEto_string( Expression e );
SCL_EXPPP_EXPORT char * EXPRto_string( Expression expr );
SCL_EXPPP_EXPORT char * FUNCto_string( Function f );
SCL_EXPPP_EXPORT char * PROCto_string( Procedure p );
SCL_EXPPP_EXPORT char * RULEto_string( Rule r );
SCL_EXPPP_EXPORT char * SCHEMAref_to_string( Schema s );
SCL_EXPPP_EXPORT char * STMTto_string( Statement s );
SCL_EXPPP_EXPORT char * TYPEto_string( Type t );
SCL_EXPPP_EXPORT char * TYPEhead_to_string( Type t );
SCL_EXPPP_EXPORT char * TYPEbody_to_string( Type t );
SCL_EXPPP_EXPORT char * WHEREto_string( Linked_List w );
int REFto_buffer( Dictionary refdict, Linked_List reflist, char * type, int level, char * buffer, int length );
int ENTITYto_buffer( Entity e, char * buffer, int length );
int EXPRto_buffer( Expression e, char * buffer, int length );
int FUNCto_buffer( Function e, char * buffer, int length );
int PROCto_buffer( Procedure e, char * buffer, int length );
int RULEto_buffer( Rule e, char * buffer, int length );
int SCHEMAref_to_buffer( Schema s, char * buffer, int length );
int STMTto_buffer( Statement s, char * buffer, int length );
int TYPEto_buffer( Type t, char * buffer, int length );
int TYPEhead_to_buffer( Type t, char * buffer, int length );
int TYPEbody_to_buffer( Type t, char * buffer, int length );
int WHEREto_buffer( Linked_List w, char * buffer, int length );
SCL_EXPPP_EXPORT int REFto_buffer( Dictionary refdict, Linked_List reflist, char * type, int level, char * buffer, int length );
SCL_EXPPP_EXPORT int ENTITYto_buffer( Entity e, char * buffer, int length );
SCL_EXPPP_EXPORT int EXPRto_buffer( Expression e, char * buffer, int length );
SCL_EXPPP_EXPORT int FUNCto_buffer( Function e, char * buffer, int length );
SCL_EXPPP_EXPORT int PROCto_buffer( Procedure e, char * buffer, int length );
SCL_EXPPP_EXPORT int RULEto_buffer( Rule e, char * buffer, int length );
SCL_EXPPP_EXPORT int SCHEMAref_to_buffer( Schema s, char * buffer, int length );
SCL_EXPPP_EXPORT int STMTto_buffer( Statement s, char * buffer, int length );
SCL_EXPPP_EXPORT int TYPEto_buffer( Type t, char * buffer, int length );
SCL_EXPPP_EXPORT int TYPEhead_to_buffer( Type t, char * buffer, int length );
SCL_EXPPP_EXPORT int TYPEbody_to_buffer( Type t, char * buffer, int length );
SCL_EXPPP_EXPORT int WHEREto_buffer( Linked_List w, char * buffer, int length );
+22 -43
View File
@@ -1,10 +1,8 @@
#ifndef ALGORITHM_H
#define ALGORITHM_H
/* $Id: alg.h,v 1.4 1997/01/21 19:17:11 dar Exp $ */
/************************************************************************
** Module: Algorithm
/** **********************************************************************
** Module: Algorithm \file alg.h
** Description: This module implements the Algorithm abstraction. An
** algorithm can be a procedure, a function, or a rule. It consists
** of a name, a return type (for functions and rules), a list of
@@ -69,50 +67,47 @@ typedef struct Where_ * Where;
/* hidden type definitions */
/***************************/
/* each formal tag has one of these structs allocated to it */
/* As each (real) call is resolved, the tag->type is temporarily borrowed */
/** each formal tag has one of these structs allocated to it
* As each (real) call is resolved, the tag->type is temporarily borrowed
*/
struct tag {
char * name;
Type type;
};
/* location of fulltext of algorithm in source file */
/** location of fulltext of algorithm in source file */
struct FullText {
char * filename;
unsigned int start, end;
};
/* 'parameters' are lists of lists of (type) expressions */
/** 'parameters' are lists of lists of (type) expressions */
struct Procedure_ {
int pcount; /* # of parameters */
int tag_count; /* # of different parameter tags */
int pcount; /**< # of parameters */
int tag_count; /**< # of different parameter tags */
Linked_List parameters;
Linked_List body;
struct FullText text;
int builtin; /* builtin if true */
int builtin; /**< builtin if true */
};
struct Function_ {
int pcount; /* # of parameters */
int tag_count; /* # of different parameter/return value tags */
int pcount; /**< # of parameters */
int tag_count; /**< # of different parameter/return value tags */
Linked_List parameters;
Linked_List body;
Type return_type;
struct FullText text;
int builtin; /* builtin if true */
int builtin; /**< builtin if true */
};
struct Rule_ {
Linked_List parameters;
Linked_List body;
struct FullText text;
/*
Linked_List where;
moved to Scope - DEL 22-Jul-1993
*/
};
/* define a where clause */
/** define a where clause */
struct Where_ {
Symbol * label;
Expression expr;
@@ -128,11 +123,11 @@ struct Where_ {
#include "decstart.h"
#endif /* ALGORITHM_C */
GLOBAL struct freelist_head ALG_fl;
GLOBAL struct freelist_head FUNC_fl;
GLOBAL struct freelist_head RULE_fl;
GLOBAL struct freelist_head PROC_fl;
GLOBAL struct freelist_head WHERE_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head ALG_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head FUNC_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head RULE_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head PROC_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head WHERE_fl;
#include "de_end.h"
@@ -175,32 +170,16 @@ GLOBAL struct freelist_head WHERE_fl;
#define FUNCget_return_type(f) ((f)->u.func->return_type)
#define RULEget_where(r) ((r)->where)
#define RULEput_where(r,w) ((r)->where = (w))
/*
#define RULEget_where_clause(r) ((r)->u.rule->where)
*/
#define WHEREget_label(w) ((w)->label)
#define WHEREget_expression(w) ((w)->expr)
#if 0
extern void ALGput_parameters PROTO( ( Algorithm, Linked_List ) );
extern void ALGput_body PROTO( ( Algorithm, Linked_List ) );
extern void FUNCput_return_type PROTO( ( Algorithm, Type ) );
extern void RULEput_where_clause PROTO( ( Algorithm, Linked_List ) );
#endif
/***********************/
/* function prototypes */
/***********************/
extern Scope ALGcreate PROTO( ( char ) );
extern void ALGinitialize PROTO( ( void ) );
extern void ALGput_full_text PROTO( ( Scope, int, int ) );
extern SCL_EXPRESS_EXPORT Scope ALGcreate PROTO( ( char ) );
extern SCL_EXPRESS_EXPORT void ALGinitialize PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void ALGput_full_text PROTO( ( Scope, int, int ) );
/********************/
/* inline functions */
/********************/
#if supports_inline_functions || defined(ALGORITHM_C)
#endif /* supports_inline_functions || defined(ALGORITHM_C) */
#endif /* ALGORITHM_H */
+9 -16
View File
@@ -1,7 +1,6 @@
#ifndef BASIC_H
#define BASIC_H
/* $Id: basic.h,v 1.8 1997/10/22 16:06:28 sauderd Exp $ */
/*
* This work was supported by the United States Government, and is
@@ -72,14 +71,19 @@
*
*/
#include <scl_cf.h>
#include <scl_export.h>
#include <stdio.h>
/******************************/
/* type Boolean and constants */
/******************************/
#include <stdbool.h>
#ifdef HAVE_STDBOOL_H
# include <stdbool.h>
#else
# include <scl_stdbool.h>
#endif
/************************/
/* Generic pointer type */
@@ -107,7 +111,7 @@ typedef int ( *intFuncptr )();
/******************************/
#if !defined(static_inline)
#if !defined(__GNUC__) || defined(__STRICT_ANSI)
#if (!defined(__GNUC__) && !defined(__MSVC__)) || defined(__STRICT_ANSI)
#define static_inline
#undef supports_inline_functions
#else
@@ -132,7 +136,7 @@ typedef int ( *intFuncptr )();
# define PROTO(x) x
# else
# ifdef __CLCC__
# if defined(__CLCC__) || defined(__MSVC__) || defined(__BORLAND__)
# define PROTO(x) x
#else
# define PROTO(x) ()
@@ -141,17 +145,6 @@ typedef int ( *intFuncptr )();
# endif
#endif
/* pacify IBM's c89 */
#if !defined(_POSIX_SOURCE)
#define _POSIX_SOURCE
#endif
/* backward compatibility */
typedef char * String;
#define STRINGequal(x,y) (0 == strcmp((x),(y)))
#endif /* */
+5 -14
View File
@@ -1,10 +1,8 @@
#ifndef CASE_ITEM_H
#define CASE_ITEM_H
/* $Id: caseitem.h,v 1.3 1997/01/21 19:17:11 dar Exp $ */
/************************************************************************
** Module: Case_Item
/** **********************************************************************
** Module: Case_Item \file caseitem.h
** Description: This module implements the Case_Item abstraction. A
** case item represents a single branch in a case statement; it
** thus consists of a list of labels and a statement to execute
@@ -78,7 +76,7 @@ struct Case_Item_ {
#include "decstart.h"
#endif /*CASE_ITEM_C*/
GLOBAL struct freelist_head CASE_IT_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head CASE_IT_fl;
#include "de_end.h"
@@ -96,14 +94,7 @@ GLOBAL struct freelist_head CASE_IT_fl;
#define CASE_IT_new() (struct Case_Item_ *)MEM_new(&CASE_IT_fl)
#define CASE_IT_destroy(x) MEM_destroy(&CASE_IT_fl,(Freelist *)(Generic)x)
extern Case_Item CASE_ITcreate PROTO( ( Linked_List, struct Statement_ * ) );
extern void CASE_ITinitialize PROTO( ( void ) );
/********************/
/* inline functions */
/********************/
#if supports_inline_functions || defined(CASE_ITEM_C)
#endif /* supports_inline_functions || defined(CASE_ITEM_C) */
extern SCL_EXPRESS_EXPORT Case_Item CASE_ITcreate PROTO( ( Linked_List, struct Statement_ * ) );
extern SCL_EXPRESS_EXPORT void CASE_ITinitialize PROTO( ( void ) );
#endif /*CASE_ITEM_H*/
+14 -24
View File
@@ -1,10 +1,8 @@
#ifndef DICTIONARY_H
#define DICTIONARY_H
/* $Id: dict.h,v 1.4 1997/01/21 19:17:11 dar Exp $ */
/************************************************************************
** Module: Dictionary
/** **********************************************************************
** Module: Dictionary \file dict.h
** Description: This module implements the dictionary abstraction. A
** dictionary is a repository for a number of objects, all of which
** can be named using the same function. A dictionary is limited to
@@ -52,7 +50,6 @@
#include "hash.h"
#include "error.h"
#include "dict.h"
/************/
/* typedefs */
@@ -81,8 +78,7 @@ typedef HashEntry DictionaryEntry;
#include "decstart.h"
#endif /*DICTIONARY_C*/
GLOBAL char DICT_type; /* set as a side-effect of DICT lookup routines */
/* to type of object found */
GLOBAL SCL_EXPRESS_EXPORT char DICT_type; /**< set as a side-effect of DICT lookup routines to type of object found */
#include "de_end.h"
@@ -91,12 +87,12 @@ GLOBAL char DICT_type; /* set as a side-effect of DICT lookup routines */
/*******************************/
#define DICTcreate(estimated_max_size) HASHcreate(estimated_max_size)
/* should really can DICTdo_init and rename do_type_init to do_init! */
/** should really can DICTdo_init and rename do_type_init to do_init! */
#define DICTdo_init(dict,de) HASHlistinit((dict),(de))
#define DICTdo_type_init(dict,de,t) HASHlistinit_by_type((dict),(de),(t))
#define DICTdo_end(hash_entry) HASHlistend(hash_entry)
/* modify dictionary entry in-place */
/** modify dictionary entry in-place */
#define DICTchange(e,obj,sym,typ) { \
(e)->data = (obj); \
(e)->symbol = (sym); \
@@ -109,20 +105,14 @@ GLOBAL char DICT_type; /* set as a side-effect of DICT lookup routines */
/* function prototypes */
/***********************/
extern void DICTinitialize PROTO( ( void ) );
extern int DICTdefine PROTO( ( Dictionary, char *, Generic, Symbol *, char ) );
extern int DICT_define PROTO( ( Dictionary, char *, Generic, Symbol *, char ) );
extern void DICTundefine PROTO( ( Dictionary, char * ) );
extern Generic DICTlookup PROTO( ( Dictionary, char * ) );
extern Generic DICTlookup_symbol PROTO( ( Dictionary, char *, Symbol ** ) );
extern Generic DICTdo PROTO( ( DictionaryEntry * ) );
extern void DICTprint PROTO( ( Dictionary ) );
/********************/
/* inline functions */
/********************/
#if supports_inline_functions || defined(DICTIONARY_C)
#endif /*supports_inline_functions || defined(DICTIONARY_C)*/
extern SCL_EXPRESS_EXPORT void DICTinitialize PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void DICTcleanup PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT int DICTdefine PROTO( ( Dictionary, char *, Generic, Symbol *, char ) );
extern SCL_EXPRESS_EXPORT int DICT_define PROTO( ( Dictionary, char *, Generic, Symbol *, char ) );
extern SCL_EXPRESS_EXPORT void DICTundefine PROTO( ( Dictionary, char * ) );
extern SCL_EXPRESS_EXPORT Generic DICTlookup PROTO( ( Dictionary, char * ) );
extern SCL_EXPRESS_EXPORT Generic DICTlookup_symbol PROTO( ( Dictionary, char *, Symbol ** ) );
extern SCL_EXPRESS_EXPORT Generic DICTdo PROTO( ( DictionaryEntry * ) );
extern SCL_EXPRESS_EXPORT void DICTprint PROTO( ( Dictionary ) );
#endif /*DICTIONARY_H*/
+31 -60
View File
@@ -1,10 +1,8 @@
#ifndef ENTITY_H
#define ENTITY_H
/* $Id: entity.h,v 1.12 1997/01/21 19:17:11 dar Exp $ */
/************************************************************************
** Module: Entity
/** **********************************************************************
** Module: Entity \file entity.h
** Description: This module represents Express entity definitions. An
** entity definition consists of a name, a list of attributes, a
** collection of uniqueness sets, a specification of the entity's
@@ -62,6 +60,7 @@
/* packages used */
/*****************/
#include <scl_export.h>
#include "expbasic.h" /* get basic definitions */
#include "symbol.h"
#include "scope.h"
@@ -85,25 +84,18 @@ typedef struct Scope_ * Entity;
/***************************/
struct Entity_ {
Linked_List supertype_symbols; /* linked list of original symbols*/
/* as generated by parser */
Linked_List supertypes; /* linked list of supertypes (as entities) */
Linked_List subtypes; /* simple list of subtypes */
/* useful for simple lookups */
Expression subtype_expression; /* DAG of subtypes, with complete */
/* information including, OR, AND, and ONEOF */
Linked_List attributes; /* explicit attributes */
int inheritance; /* total number of attributes */
/* inherited from supertypes */
int attribute_count;
Linked_List unique; /* list of identifiers that are unique */
Linked_List instances; /* hook for applications */
int mark; /* usual hack - prevent traversing sub/super */
/* graph twice */
bool abstract;/* is this an abstract supertype? */
Type type; /* type pointing back to ourself */
/* Useful to have when evaluating */
/* expressions involving entities */
Linked_List supertype_symbols; /**< linked list of original symbols as generated by parser */
Linked_List supertypes; /**< linked list of supertypes (as entities) */
Linked_List subtypes; /**< simple list of subtypes useful for simple lookups */
Expression subtype_expression; /**< DAG of subtypes, with complete information including, OR, AND, and ONEOF */
Linked_List attributes; /**< explicit attributes */
int inheritance; /**< total number of attributes inherited from supertypes */
int attribute_count;
Linked_List unique; /**< list of identifiers that are unique */
Linked_List instances; /**< hook for applications */
int mark; /**< usual hack - prevent traversing sub/super graph twice */
bool abstract; /**< is this an abstract supertype? */
Type type; /**< type pointing back to ourself, useful to have when evaluating expressions involving entities */
};
/********************/
@@ -116,9 +108,9 @@ struct Entity_ {
#include "decstart.h"
#endif /* ENTITY_C */
GLOBAL struct freelist_head ENTITY_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head ENTITY_fl;
GLOBAL int ENTITY_MARK INITIALLY( 0 );
GLOBAL SCL_EXPRESS_EXPORT int ENTITY_MARK INITIALLY( 0 );
#include "de_end.h"
@@ -157,40 +149,19 @@ GLOBAL int ENTITY_MARK INITIALLY( 0 );
/* function prototypes */
/***********************/
extern struct Scope_ * ENTITYcreate PROTO( ( struct Symbol_ * ) );
extern void ENTITYinitialize PROTO( ( void ) );
extern void ENTITYadd_attribute PROTO( ( struct Scope_ *, struct Variable_ * ) );
extern struct Scope_ * ENTITYcopy PROTO( ( struct Scope_ * ) );
extern Entity ENTITYfind_inherited_entity PROTO( ( struct Scope_ *, char *, int ) );
extern Variable ENTITYfind_inherited_attribute PROTO( ( struct Scope_ *, char *, struct Symbol_ ** ) );
extern Variable ENTITYresolve_attr_ref PROTO( ( Entity, Symbol *, Symbol * ) );
extern bool ENTITYhas_immediate_supertype PROTO( ( Entity, Entity ) );
extern Variable ENTITYget_named_attribute PROTO( ( Entity, char * ) );
extern Linked_List ENTITYget_all_attributes PROTO( ( Entity ) );
extern bool ENTITYhas_supertype PROTO( ( Entity, Entity ) );
extern void ENTITYadd_instance PROTO( ( Entity, Generic ) );
extern int ENTITYget_initial_offset PROTO( ( Entity ) );
extern bool ENTITYdeclares_variable PROTO( ( Entity, struct Variable_ * ) );
#if 0
extern void ENTITYdelete_instance PROTO( ( Entity, Generic ) );
extern bool ENTITYhas_subtype PROTO( ( Entity, Entity ) );
extern Entity ENTITYget_supertype PROTO( ( Entity, String ) );
extern Entity ENTITYget_subtype PROTO( ( Entity, String ) );
extern bool ENTITYhas_immediate_subtype PROTO( ( Entity, Entity ) );
extern Expression ENTITYget_subtype_expression PROTO( ( Entity ) );
extern int ENTITYget_attribute_offset PROTO( ( Entity, Variable ) );
extern int ENTITYget_named_attribute_offset PROTO( ( Entity, String ) );
extern Linked_List ENTITYget_uniqueness_list PROTO( ( Entity ) );
extern Linked_List ENTITYget_constraints PROTO( ( Entity ) );
extern Linked_List ENTITYget_instances PROTO( ( Entity ) );
#endif /*0*/
/********************/
/* inline functions */
/********************/
#if supports_inline_functions || defined(ENTITY_C)
#endif /* supports_inline_functions || defined(ENTITY_C) */
extern SCL_EXPRESS_EXPORT struct Scope_ * ENTITYcreate PROTO( ( struct Symbol_ * ) );
extern SCL_EXPRESS_EXPORT void ENTITYinitialize PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void ENTITYadd_attribute PROTO( ( struct Scope_ *, struct Variable_ * ) );
extern SCL_EXPRESS_EXPORT struct Scope_ * ENTITYcopy PROTO( ( struct Scope_ * ) );
extern SCL_EXPRESS_EXPORT Entity ENTITYfind_inherited_entity PROTO( ( struct Scope_ *, char *, int ) );
extern SCL_EXPRESS_EXPORT Variable ENTITYfind_inherited_attribute PROTO( ( struct Scope_ *, char *, struct Symbol_ ** ) );
extern SCL_EXPRESS_EXPORT Variable ENTITYresolve_attr_ref PROTO( ( Entity, Symbol *, Symbol * ) );
extern SCL_EXPRESS_EXPORT bool ENTITYhas_immediate_supertype PROTO( ( Entity, Entity ) );
extern SCL_EXPRESS_EXPORT Variable ENTITYget_named_attribute PROTO( ( Entity, char * ) );
extern SCL_EXPRESS_EXPORT Linked_List ENTITYget_all_attributes PROTO( ( Entity ) );
extern SCL_EXPRESS_EXPORT bool ENTITYhas_supertype PROTO( ( Entity, Entity ) );
extern SCL_EXPRESS_EXPORT void ENTITYadd_instance PROTO( ( Entity, Generic ) );
extern SCL_EXPRESS_EXPORT int ENTITYget_initial_offset PROTO( ( Entity ) );
extern SCL_EXPRESS_EXPORT bool ENTITYdeclares_variable PROTO( ( Entity, struct Variable_ * ) );
#endif /* ENTITY_H */
+58 -59
View File
@@ -1,10 +1,8 @@
#ifndef ERROR_H
#define ERROR_H
/* $Id: error.h,v 1.8 1997/01/21 19:16:55 dar Exp $ */
/************************************************************************
** Module: Error
/** **********************************************************************
** Module: Error \file error.h
** Description: This module implements the ERROR abstraction.
************************************************************************/
@@ -30,8 +28,9 @@
* prettied up interface to print_objects_when_running
*/
#include <scl_export.h>
#include "basic.h" /* get basic definitions */
#include "setjmp.h"
#include <setjmp.h>
/*************/
/* constants */
@@ -88,29 +87,29 @@ typedef struct Error_Warning_ {
#include "decstart.h"
#endif /* ERROR_C */
GLOBAL bool __ERROR_buffer_errors INITIALLY( false );
GLOBAL char * current_filename INITIALLY( "stdin" );
GLOBAL SCL_EXPRESS_EXPORT bool __ERROR_buffer_errors INITIALLY( false );
GLOBAL SCL_EXPRESS_EXPORT char * current_filename INITIALLY( "stdin" );
/* flag to remember whether non-warning errors have occurred */
GLOBAL bool ERRORoccurred INITIALLY( false );
GLOBAL SCL_EXPRESS_EXPORT bool ERRORoccurred INITIALLY( false );
GLOBAL Error experrc INITIALLY( ERROR_none );
GLOBAL Error ERROR_subordinate_failed INITIALLY( ERROR_none );
GLOBAL Error ERROR_syntax_expecting INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error experrc INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_subordinate_failed INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_syntax_expecting INITIALLY( ERROR_none );
/* all of these are 1 if true, 0 if false switches */
/* for debugging fedex */
GLOBAL int ERRORdebugging INITIALLY( 0 );
GLOBAL SCL_EXPRESS_EXPORT int ERRORdebugging INITIALLY( 0 );
/* for debugging malloc during resolution */
GLOBAL int malloc_debug_resolve INITIALLY( 0 );
GLOBAL SCL_EXPRESS_EXPORT int malloc_debug_resolve INITIALLY( 0 );
/* for debugging yacc/lex */
GLOBAL int debug INITIALLY( 0 );
GLOBAL SCL_EXPRESS_EXPORT int debug INITIALLY( 0 );
GLOBAL struct Linked_List_ * ERRORwarnings;
GLOBAL struct freelist_head ERROR_OPT_fl;
GLOBAL SCL_EXPRESS_EXPORT struct Linked_List_ * ERRORwarnings;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head ERROR_OPT_fl;
GLOBAL void ( *ERRORusage_function ) PROTO( ( void ) );
GLOBAL SCL_EXPRESS_EXPORT void ( *ERRORusage_function ) PROTO( ( void ) );
#include "de_end.h"
@@ -121,6 +120,14 @@ GLOBAL void ( *ERRORusage_function ) PROTO( ( void ) );
#define ERROR_OPT_new() (struct Error_Warning_ *)MEM_new(&ERROR_OPT_fl)
#define ERROR_OPT_destroy(x) MEM_destroy(&ERROR_OPT_fl,(Freelist *)(Generic)x)
/***********************/
/* function prototypes */
/***********************/
#if defined(__MSVC__) || defined(__BORLAND__)
extern SCL_EXPRESS_EXPORT void ERROR_start_message_buffer PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void ERROR_flush_message_buffer PROTO( ( void ) );
#endif
/********************/
/* Inline functions */
@@ -128,34 +135,27 @@ GLOBAL void ( *ERRORusage_function ) PROTO( ( void ) );
#if supports_inline_functions || defined(ERROR_C)
static_inline
void
ERRORdisable( Error error ) {
static_inline void ERRORdisable( Error error ) {
if( error != ERROR_none ) {
error->enabled = false;
}
}
static_inline
void
ERRORenable( Error error ) {
static_inline void ERRORenable( Error error ) {
if( error != ERROR_none ) {
error->enabled = true;
}
}
static_inline
bool
ERRORis_enabled( Error error ) {
static_inline bool ERRORis_enabled( Error error ) {
return error->enabled;
}
static_inline
void
ERRORbuffer_messages( bool flag ) {
static_inline void ERRORbuffer_messages( bool flag ) {
#if !defined(__MSVC__) && !defined(__BORLAND__)
extern void ERROR_start_message_buffer( void ),
ERROR_flush_message_buffer( void );
#endif
__ERROR_buffer_errors = flag;
if( __ERROR_buffer_errors ) {
ERROR_start_message_buffer();
@@ -164,11 +164,11 @@ ERRORbuffer_messages( bool flag ) {
}
}
static_inline
void
ERRORflush_messages( void ) {
static_inline void ERRORflush_messages( void ) {
#if !defined(__MSVC__) && !defined(__BORLAND__)
extern void ERROR_start_message_buffer( void ),
ERROR_flush_message_buffer( void );
#endif
if( __ERROR_buffer_errors ) {
ERROR_flush_message_buffer();
@@ -182,33 +182,32 @@ ERRORflush_messages( void ) {
/* function prototypes */
/***********************/
extern void ERRORinitialize PROTO( ( void ) );
extern void ERRORinitialize_after_LIST PROTO( ( void ) );
extern void ERRORnospace PROTO( ( void ) );
extern void ERRORabort PROTO( ( int ) );
extern Error ERRORcreate PROTO( ( char *, Severity ) );
extern void ERRORreport PROTO( ( Error, ... ) );
/*SUPPRESS 652*/ /* 1.? */
/*SUPPRESS 842*/ /* 4.0.2 */
extern SCL_EXPRESS_EXPORT void ERRORinitialize PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void ERRORinitialize_after_LIST PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void ERRORcleanup PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void ERRORnospace PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void ERRORabort PROTO( ( int ) );
extern SCL_EXPRESS_EXPORT Error ERRORcreate PROTO( ( char *, Severity ) );
extern SCL_EXPRESS_EXPORT void ERRORreport PROTO( ( Error, ... ) );
extern SCL_EXPRESS_EXPORT void ERRORdestroy PROTO( ( Error ) );
struct Symbol_; /* mention Symbol to avoid warning on following line */
extern void ERRORreport_with_symbol PROTO( ( Error, struct Symbol_ *, ... ) );
extern void ERRORreport_with_line PROTO( ( Error, int, ... ) );
extern void ERRORbuffer_messages PROTO( ( bool ) );
extern void ERRORflush_messages PROTO( ( void ) );
extern void ERROR_start_message_buffer PROTO( ( void ) );
extern void ERROR_flush_message_buffer PROTO( ( void ) );
extern void ERRORcreate_warning PROTO( ( char *, Error ) );
extern void ERRORset_warning PROTO( ( char *, int ) );
extern void ERRORset_all_warnings PROTO( ( int ) );
extern void ERRORsafe PROTO( ( jmp_buf env ) );
extern void ERRORunsafe PROTO( ( void ) );
#if deprecated
extern void ERRORdisable PROTO( ( Error ) );
extern void ERRORenable PROTO( ( Error ) );
extern Boolean ERRORis_enabled PROTO( ( Error ) );
extern SCL_EXPRESS_EXPORT void ERRORreport_with_symbol PROTO( ( Error, struct Symbol_ *, ... ) );
extern SCL_EXPRESS_EXPORT void ERRORreport_with_line PROTO( ( Error, int, ... ) );
#if !supports_inline_functions
extern SCL_EXPRESS_EXPORT void ERRORbuffer_messages PROTO( ( bool ) );
extern SCL_EXPRESS_EXPORT void ERRORflush_messages PROTO( ( void ) );
#endif
#if !defined(__MSVC__) && !defined(__BORLAND__)
extern SCL_EXPRESS_EXPORT void ERROR_start_message_buffer PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void ERROR_flush_message_buffer PROTO( ( void ) );
#endif
extern SCL_EXPRESS_EXPORT void ERRORcreate_warning PROTO( ( char *, Error ) );
extern SCL_EXPRESS_EXPORT void ERRORset_warning PROTO( ( char *, int ) );
extern SCL_EXPRESS_EXPORT void ERRORset_all_warnings PROTO( ( int ) );
extern SCL_EXPRESS_EXPORT void ERRORsafe PROTO( ( jmp_buf env ) );
extern SCL_EXPRESS_EXPORT void ERRORunsafe PROTO( ( void ) );
#endif /* ERROR_H */
+29 -33
View File
@@ -1,4 +1,3 @@
/* $Id: expbasic.h,v 1.7 1997/01/21 19:17:11 dar Exp $ */
/*
* This software was developed by U.S. Government employees as part of
@@ -72,84 +71,81 @@ typedef char * Binary;
#define UNRESOLVED 0x0
#define RESOLVED 0x1
#define RESOLVE_FAILED 0x2
#define RESOLVE_IN_PROGRESS 0x4 /* only if actively being resolved */
/* not if it's just between passes */
#define RESOLVE_IN_PROGRESS 0x4 /**< only if actively being resolved not if it's just between passes */
/* used during rename resolution to catch recursive USE/REFs */
/** used during rename resolution to catch recursive USE/REFs */
#define is_resolve_in_progress_raw(x) ((x)->resolved & RESOLVE_IN_PROGRESS)
#define resolve_in_progress_raw(x) (x)->resolved |= RESOLVE_IN_PROGRESS
#define resolve_not_in_progress_raw(x) (x)->resolved &= ~RESOLVE_IN_PROGRESS
/* and type resolution to catch recursive types (A = B and B = A) */
/** and type resolution to catch recursive types (A = B and B = A) */
#define resolve_in_progress(x) (x)->symbol.resolved |= RESOLVE_IN_PROGRESS
/* test/set whether anything has failed resolution */
/** test/set whether anything has failed resolution */
#define is_resolve_failed(x) ((x)->symbol.resolved & RESOLVE_FAILED)
#define is_resolve_failed_raw(x) ((x)->resolved & RESOLVE_FAILED)
#define resolve_failed(x) (x)->symbol.resolved |= RESOLVE_FAILED
#define resolve_failed_raw(x) (x)->resolved |= RESOLVE_FAILED
/* test/set whether anything has succeeded resolution */
/** test/set whether anything has succeeded resolution */
#define is_resolved(x) ((x)->symbol.resolved & RESOLVED)
/* test possibility of future resolution */
/** test possibility of future resolution */
#define is_resolvable(x) (!is_not_resolvable(x))
#define is_not_resolvable(x) ((x)->symbol.resolved & (RESOLVE_FAILED|RESOLVED|RESOLVE_IN_PROGRESS))
/* mark something resolved */
/** mark something resolved */
#define resolved_all(x) x->symbol.resolved = RESOLVED
/* define the object types that can appear in a symbol table */
/* basically anything that is usefully named, but that cannot be */
/* differentiated from another type when handed a generic pointer */
/* Entity, schema and alg can be differentiated but it is just very */
/* useful to be able to differentiate this way. */
#define OBJ_ANY '*' /* Matches anything - special to DICT funcs */
#define OBJ_EXPRESS '!' /* I can't figure out the mnemonic either! */
/** define the object types that can appear in a symbol table
* basically anything that is usefully named, but that cannot be
* differentiated from another type when handed a generic pointer
* Entity, schema and alg can be differentiated but it is just very
* useful to be able to differentiate this way. */
#define OBJ_ANY '*' /**< Matches anything - special to DICT funcs */
#define OBJ_EXPRESS '!' /**< I can't figure out the mnemonic either! */
#define OBJ_PASS '#'
/* The following are all odd-ball scopes, that aren't ever looked up by */
/* type - but the data structures might as well be descriptive */
/** The following are all odd-ball scopes, that aren't ever looked up by
* type - but the data structures might as well be descriptive */
#define OBJ_INCREMENT '+'
#define OBJ_ALIAS 'a'
#define OBJ_QUERY 'q' /* isn't even stored anywhere! */
#define OBJ_QUERY 'q' /**< isn't even stored anywhere! */
#define OBJ_PROCEDURE 'p'
#define OBJ_RENAME 'n'
#define OBJ_RULE 'r'
#define OBJ_FUNCTION 'f'
#define OBJ_TAG 'g' /* a type, but only when used as a type tag */
#define OBJ_TAG 'g' /**< a type, but only when used as a type tag */
#define OBJ_ENTITY 'e'
#define OBJ_SCHEMA 's'
#define OBJ_TYPE 't'
#define OBJ_UNKNOWN 'u' /*things that won't ever be looked up by type*/
#define OBJ_UNKNOWN 'u' /**< things that won't ever be looked up by type*/
#define OBJ_VARIABLE 'v'
#define OBJ_WHERE 'w'
#define OBJ_EXPRESSION 'x' /* so far only enums get looked up by name & */
#define OBJ_ENUM 'x' /* appear this way, perhaps they should be */
/* variables? */
#define OBJ_AMBIG_ENUM 'z' /* enumerations of the same name which are */
/* visible in the same scope when qualified */
/* z is of no mnemonic significance (so far) */
#define OBJ_EXPRESSION 'x' /**< so far only enums get looked up by name & */
#define OBJ_ENUM 'x' /**< appear this way, perhaps they should be variables? */
#define OBJ_AMBIG_ENUM 'z' /**< enumerations of the same name which are
* visible in the same scope when qualified
* z is of no mnemonic significance (so far) */
#define IS_ENUM(x) (((x) == OBJ_ENUM) || ((x) == OBJ_AMBIG_ENUM))
/* these represent a different way of selecting classes of objects */
/* these are particularly useful when looking for multiple types concurrently */
/** these represent a different way of selecting classes of objects
* these are particularly useful when looking for multiple types concurrently */
#define OBJ_TYPE_BITS 0x1
#define OBJ_ENTITY_BITS 0x2
#define OBJ_FUNCTION_BITS 0x4
#define OBJ_PROCEDURE_BITS 0x8
#define OBJ_PASS_BITS 0x10 /* i.e., EXPRESSpass */
#define OBJ_PASS_BITS 0x10 /**< i.e., EXPRESSpass */
#define OBJ_RULE_BITS 0x20
#define OBJ_EXPRESSION_BITS 0x40 /* as above, only used for */
/* finding enums */
#define OBJ_EXPRESSION_BITS 0x40 /**< as above, only used for finding enums */
#define OBJ_SCHEMA_BITS 0x80
#define OBJ_VARIABLE_BITS 0x100
#define OBJ_WHERE_BITS 0x200
#define OBJ_ANYTHING_BITS 0x0fffffff
#define OBJ_UNFINDABLE_BITS 0x10000000 /* should never be found */
#define OBJ_UNFINDABLE_BITS 0x10000000 /**< should never be found */
#define OBJ_ALGORITHM_BITS (OBJ_FUNCTION_BITS | OBJ_PROCEDURE_BITS | \
OBJ_RULE_BITS)
#define OBJ_SCOPE_BITS (OBJ_ALGORITHM_BITS | OBJ_ENTITY_BITS | \
+51 -57
View File
@@ -1,10 +1,8 @@
#ifndef EXPRESSION_H
#define EXPRESSION_H
/* $Id: expr.h,v 1.4 1997/01/21 19:17:11 dar Exp $ */
/************************************************************************
** Module: Expression
/** **********************************************************************
** Module: Expression \file expr.h
** Description: This module implements the Expression abstraction.
** Several types of expressions are supported: identifiers,
** literals, operations (arithmetic, logical, array indexing,
@@ -62,6 +60,7 @@
/* packages used */
/*****************/
#include <scl_export.h>
#include <math.h>
#include "expbasic.h" /* get basic definitions */
@@ -85,7 +84,7 @@ typedef enum {
OP_NOT, OP_NOT_EQUAL, OP_OR,
OP_PLUS, OP_REAL_DIV, OP_SUBCOMPONENT,
OP_TIMES, OP_XOR, OP_UNKNOWN,
OP_LAST /* must be last - used only to size tables */
OP_LAST /**< must be last - used only to size tables */
} Op_Code;
typedef struct Qualified_Attr Qualified_Attr;
@@ -117,7 +116,7 @@ typedef Literal Aggregate_Literal, Integer_Literal,
/* expression types */
struct Qualified_Attr {
struct Expression_ * complex; /* complex entity instance */
struct Expression_ * complex; /**< complex entity instance */
Symbol * entity;
Symbol * attribute;
};
@@ -131,22 +130,20 @@ struct Op_Subexpression {
struct Query_ {
Variable local;
Expression aggregate; /* set from which to test */
Expression expression; /* logical expression */
Expression aggregate; /**< set from which to test */
Expression expression; /**< logical expression */
struct Scope_ * scope;
};
struct Funcall {
struct Scope_ * function; /* can also be an entity because entities */
/* can be called as functions */
struct Scope_ * function; /**< can also be an entity because entities can be called as functions */
Linked_List list;
};
union expr_union {
int integer;
float real;
/* char *string; find string name in symbol in Expression */
char * attribute; /* inverse .... for 'attr' */
char * attribute; /**< inverse .... for 'attr' */
char * binary;
int logical;
bool boolean;
@@ -156,35 +153,31 @@ union expr_union {
/* if etype == aggregate, list of expressions */
/* if etype == funcall, 1st element of list is funcall or entity */
/* remaining elements are parameters */
Linked_List list; /* aggregates (bags, lists, sets, arrays) */
/* or lists for oneof expressions */
Expression expression; /* derived value in derive attrs, or*/
/* initializer in local vars, or */
/* enumeration tags */
/* or oneof value */
struct Scope_ * entity; /* used by subtype exp, group expr */
/* and self expr, some funcall's and any */
/* expr that results in an entity */
Variable variable; /* attribute reference */
Linked_List list; /**< aggregates (bags, lists, sets, arrays) or lists for oneof expressions */
Expression expression; /**< derived value in derive attrs, or
* initializer in local vars, or
* enumeration tags
* or oneof value */
struct Scope_ * entity; /**< used by subtype exp, group expr
* and self expr, some funcall's and any
* expr that results in an entity */
Variable variable; /**< attribute reference */
};
/** The difference between 'type' and 'return_type' is illustrated
* by "func(a)". Here, 'type' is Type_Function while 'return_type'
* might be Type_Integer (assuming func returns an integer). */
struct Expression_ {
Symbol symbol; /* contains things like funcall names */
/* string names, binary values, */
/* enumeration names */
Symbol symbol; /**< contains things like funcall names, string names, binary values, enumeration names */
Type type;
Type return_type; /* type of value returned by expression */
/* The difference between 'type' and 'return_type' is */
/* illustrated by "func(a)". Here, 'type' is Type_Function */
/* while 'return_type' might be Type_Integer (assuming func */
/* returns an integer). */
Type return_type; /**< type of value returned by expression */
struct Op_Subexpression e;
union expr_union u;
};
/* indexed by the op enumeration values */
/** indexed by the op enumeration values */
struct EXPop_entry {
char * token; /* literal token, e.g., "<>" */
char * token; /**< literal token, e.g., "<>" */
Type( *resolve ) PROTO( ( Expression, struct Scope_ * ) );
};
@@ -198,23 +191,23 @@ struct EXPop_entry {
#include "decstart.h"
#endif /*EXPRESSION_C*/
GLOBAL struct EXPop_entry EXPop_table[OP_LAST];
GLOBAL SCL_EXPRESS_EXPORT struct EXPop_entry EXPop_table[OP_LAST];
GLOBAL Expression LITERAL_E INITIALLY( EXPRESSION_NULL );
GLOBAL Expression LITERAL_INFINITY INITIALLY( EXPRESSION_NULL );
GLOBAL Expression LITERAL_PI INITIALLY( EXPRESSION_NULL );
GLOBAL Expression LITERAL_ZERO INITIALLY( EXPRESSION_NULL );
GLOBAL Expression LITERAL_ONE;
GLOBAL SCL_EXPRESS_EXPORT Expression LITERAL_E INITIALLY( EXPRESSION_NULL );
GLOBAL SCL_EXPRESS_EXPORT Expression LITERAL_INFINITY INITIALLY( EXPRESSION_NULL );
GLOBAL SCL_EXPRESS_EXPORT Expression LITERAL_PI INITIALLY( EXPRESSION_NULL );
GLOBAL SCL_EXPRESS_EXPORT Expression LITERAL_ZERO INITIALLY( EXPRESSION_NULL );
GLOBAL SCL_EXPRESS_EXPORT Expression LITERAL_ONE;
GLOBAL Error ERROR_bad_qualification INITIALLY( ERROR_none );
GLOBAL Error ERROR_integer_expression_expected INITIALLY( ERROR_none );
GLOBAL Error ERROR_implicit_downcast INITIALLY( ERROR_none );
GLOBAL Error ERROR_ambig_implicit_downcast INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_bad_qualification INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_integer_expression_expected INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_implicit_downcast INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_ambig_implicit_downcast INITIALLY( ERROR_none );
GLOBAL struct freelist_head EXP_fl;
GLOBAL struct freelist_head OP_fl;
GLOBAL struct freelist_head QUERY_fl;
GLOBAL struct freelist_head QUAL_ATTR_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head EXP_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head OP_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head QUERY_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head QUAL_ATTR_fl;
#include "de_end.h"
@@ -244,7 +237,7 @@ GLOBAL struct freelist_head QUAL_ATTR_fl;
#define FCALLget_parameters(e) ((e)->u.funcall.list)
#define FCALLput_function(expr,func) ((e)->u.funcall.function = (func))
#define FCALLget_function(e) ((e)->u.funcall.function)
/* assumes the function is not an entity-function! */
/** assumes the function is not an entity-function! */
#define FCALLget_algorithm(e) ((e)->u.funcall.function->u.function->body)
#define INT_LITget_value(e) ((e)->u.integer)
@@ -269,16 +262,17 @@ GLOBAL struct freelist_head QUAL_ATTR_fl;
/* function prototypes */
/***********************/
extern Expression EXPcreate PROTO( ( Type ) );
extern Expression EXPcreate_simple PROTO( ( Type ) );
extern Expression EXPcreate_from_symbol PROTO( ( Type, Symbol * ) );
extern Expression UN_EXPcreate PROTO( ( Op_Code, Expression ) );
extern Expression BIN_EXPcreate PROTO( ( Op_Code, Expression, Expression ) );
extern Expression TERN_EXPcreate PROTO( ( Op_Code, Expression, Expression, Expression ) );
extern Expression QUERYcreate PROTO( ( Symbol *, Expression ) );
extern void EXPinitialize PROTO( ( void ) );
extern Type EXPtype PROTO( ( Expression, struct Scope_ * ) );
extern int EXPget_integer_value PROTO( ( Expression ) );
extern SCL_EXPRESS_EXPORT Expression EXPcreate PROTO( ( Type ) );
extern SCL_EXPRESS_EXPORT Expression EXPcreate_simple PROTO( ( Type ) );
extern SCL_EXPRESS_EXPORT Expression EXPcreate_from_symbol PROTO( ( Type, Symbol * ) );
extern SCL_EXPRESS_EXPORT Expression UN_EXPcreate PROTO( ( Op_Code, Expression ) );
extern SCL_EXPRESS_EXPORT Expression BIN_EXPcreate PROTO( ( Op_Code, Expression, Expression ) );
extern SCL_EXPRESS_EXPORT Expression TERN_EXPcreate PROTO( ( Op_Code, Expression, Expression, Expression ) );
extern SCL_EXPRESS_EXPORT Expression QUERYcreate PROTO( ( Symbol *, Expression ) );
extern SCL_EXPRESS_EXPORT void EXPinitialize PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void EXPcleanup PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT Type EXPtype PROTO( ( Expression, struct Scope_ * ) );
extern SCL_EXPRESS_EXPORT int EXPget_integer_value PROTO( ( Expression ) );
/********************/
/* inline functions */
+158 -161
View File
@@ -1,8 +1,6 @@
#ifndef EXPRESS_H
#define EXPRESS_H
/* $Id: express.h,v 1.13 1997/01/21 19:16:42 dar Exp $ */
/*
* Express package manager.
*
@@ -83,7 +81,7 @@ typedef struct Scope_ * Express;
struct Express_ {
FILE * file;
char * filename;
char * basename; /* name of file but without directory or .exp suffix */
char * basename; /**< name of file but without directory or .exp suffix */
};
/********************/
@@ -98,150 +96,158 @@ struct Express_ {
# define INITIALLY(value)
#endif /*EXPRESS_C*/
GLOBAL Linked_List EXPRESS_path;
GLOBAL int EXPRESSpass;
#ifdef YYDEBUG
extern SCL_EXPRESS_EXPORT int yydebug;
extern SCL_EXPRESS_EXPORT int yydbg_upper_limit;
extern SCL_EXPRESS_EXPORT int yydbg_lower_limit;
extern SCL_EXPRESS_EXPORT int yydbg_verbose;
#endif
GLOBAL void ( *EXPRESSinit_args ) PROTO( ( int, char ** ) ) INITIALLY( 0 );
GLOBAL void ( *EXPRESSinit_parse ) PROTO( ( void ) ) INITIALLY( 0 );
GLOBAL int ( *EXPRESSfail ) PROTO( ( Express ) ) INITIALLY( 0 );
GLOBAL int ( *EXPRESSsucceed ) PROTO( ( Express ) ) INITIALLY( 0 );
GLOBAL void ( *EXPRESSbackend ) PROTO( ( Express ) ) INITIALLY( 0 );
GLOBAL char * EXPRESSprogram_name;
extern char EXPRESSgetopt_options[]; /* initialized elsewhere */
GLOBAL int ( *EXPRESSgetopt ) PROTO( ( int, char * ) ) INITIALLY( 0 );
GLOBAL bool EXPRESSignore_duplicate_schemas INITIALLY( false );
GLOBAL SCL_EXPRESS_EXPORT Linked_List EXPRESS_path;
GLOBAL SCL_EXPRESS_EXPORT int EXPRESSpass;
GLOBAL Dictionary EXPRESSbuiltins; /* procedures/functions */
GLOBAL SCL_EXPRESS_EXPORT void ( *EXPRESSinit_args ) PROTO( ( int, char ** ) ) INITIALLY( 0 );
GLOBAL SCL_EXPRESS_EXPORT void ( *EXPRESSinit_parse ) PROTO( ( void ) ) INITIALLY( 0 );
GLOBAL SCL_EXPRESS_EXPORT int ( *EXPRESSfail ) PROTO( ( Express ) ) INITIALLY( 0 );
GLOBAL SCL_EXPRESS_EXPORT int ( *EXPRESSsucceed ) PROTO( ( Express ) ) INITIALLY( 0 );
GLOBAL SCL_EXPRESS_EXPORT void ( *EXPRESSbackend ) PROTO( ( Express ) ) INITIALLY( 0 );
GLOBAL SCL_EXPRESS_EXPORT char * EXPRESSprogram_name;
extern char EXPRESSgetopt_options[256]; /**< initialized elsewhere */
GLOBAL SCL_EXPRESS_EXPORT int ( *EXPRESSgetopt ) PROTO( ( int, char * ) ) INITIALLY( 0 );
GLOBAL SCL_EXPRESS_EXPORT bool EXPRESSignore_duplicate_schemas INITIALLY( false );
GLOBAL Error ERROR_bail_out INITIALLY( ERROR_none );
GLOBAL Error ERROR_syntax INITIALLY( ERROR_none );
GLOBAL Error ERROR_unlabelled_param_type INITIALLY( ERROR_none );
GLOBAL Error ERROR_file_unreadable;
GLOBAL Error ERROR_file_unwriteable;
GLOBAL SCL_EXPRESS_EXPORT Dictionary EXPRESSbuiltins; /**< procedures/functions */
GLOBAL struct Scope_ * FUNC_NVL;
GLOBAL struct Scope_ * FUNC_USEDIN;
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_bail_out INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_syntax INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_unlabelled_param_type INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_file_unreadable;
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_file_unwriteable;
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_warn_unsupported_lang_feat;
GLOBAL char * KW_ABS INITIALLY( "ABS" );
GLOBAL char * KW_ABSTRACT INITIALLY( "ABSTRACT" );
GLOBAL char * KW_ACOS INITIALLY( "ACOS" );
GLOBAL char * KW_AGGREGATE INITIALLY( "AGGREGATE" );
GLOBAL char * KW_ALIAS INITIALLY( "ALIAS" );
GLOBAL char * KW_AND INITIALLY( "AND" );
GLOBAL char * KW_ANDOR INITIALLY( "ANDOR" );
GLOBAL char * KW_ARRAY INITIALLY( "ARRAY" );
GLOBAL char * KW_AS INITIALLY( "AS" );
GLOBAL char * KW_ASIN INITIALLY( "ASIN" );
GLOBAL char * KW_ATAN INITIALLY( "ATAN" );
GLOBAL char * KW_BAG INITIALLY( "BAG" );
GLOBAL char * KW_BEGIN INITIALLY( "BEGIN" );
GLOBAL char * KW_BINARY INITIALLY( "BINARY" );
GLOBAL char * KW_BLENGTH INITIALLY( "BLENGTH" );
GLOBAL char * KW_BOOLEAN INITIALLY( "BOOLEAN" );
GLOBAL char * KW_BY INITIALLY( "BY" );
GLOBAL char * KW_CASE INITIALLY( "CASE" );
GLOBAL char * KW_CONST_E INITIALLY( "CONST_E" );
GLOBAL char * KW_CONSTANT INITIALLY( "CONSTANT" );
GLOBAL char * KW_CONTEXT INITIALLY( "CONTEXT" );
GLOBAL char * KW_COS INITIALLY( "COS" );
GLOBAL char * KW_DERIVE INITIALLY( "DERIVE" );
GLOBAL char * KW_DIV INITIALLY( "DIV" );
GLOBAL char * KW_ELSE INITIALLY( "ELSE" );
GLOBAL char * KW_END INITIALLY( "END" );
GLOBAL char * KW_END_ALIAS INITIALLY( "END_ALIAS" );
GLOBAL char * KW_END_CASE INITIALLY( "END_CASE" );
GLOBAL char * KW_END_CONSTANT INITIALLY( "END_CONSTANT" );
GLOBAL char * KW_END_CONTEXT INITIALLY( "END_CONTEXT" );
GLOBAL char * KW_END_ENTITY INITIALLY( "END_ENTITY" );
GLOBAL char * KW_END_FUNCTION INITIALLY( "END_FUNCTION" );
GLOBAL char * KW_END_IF INITIALLY( "END_IF" );
GLOBAL char * KW_END_LOCAL INITIALLY( "END_LOCAL" );
GLOBAL char * KW_END_MODEL INITIALLY( "END_MODEL" );
GLOBAL char * KW_END_PROCEDURE INITIALLY( "END_PROCEDURE" );
GLOBAL char * KW_END_REPEAT INITIALLY( "END_REPEAT" );
GLOBAL char * KW_END_RULE INITIALLY( "END_RULE" );
GLOBAL char * KW_END_SCHEMA INITIALLY( "END_SCHEMA" );
GLOBAL char * KW_END_TYPE INITIALLY( "END_TYPE" );
GLOBAL char * KW_ENTITY INITIALLY( "ENTITY" );
GLOBAL char * KW_ENUMERATION INITIALLY( "ENUMERATION" );
GLOBAL char * KW_ESCAPE INITIALLY( "ESCAPE" );
GLOBAL char * KW_EXISTS INITIALLY( "EXISTS" );
GLOBAL char * KW_EXP INITIALLY( "EXP" );
GLOBAL char * KW_FALSE INITIALLY( "FALSE" );
GLOBAL char * KW_FIXED INITIALLY( "FIXED" );
GLOBAL char * KW_FOR INITIALLY( "FOR" );
GLOBAL char * KW_FORMAT INITIALLY( "FORMAT" );
GLOBAL char * KW_FROM INITIALLY( "FROM" );
GLOBAL char * KW_FUNCTION INITIALLY( "FUNCTION" );
GLOBAL char * KW_GENERIC INITIALLY( "GENERIC" );
GLOBAL char * KW_HIBOUND INITIALLY( "HIBOUND" );
GLOBAL char * KW_HIINDEX INITIALLY( "HIINDEX" );
GLOBAL char * KW_IF INITIALLY( "IF" );
GLOBAL char * KW_IN INITIALLY( "IN" );
GLOBAL char * KW_INCLUDE INITIALLY( "INCLUDE" );
GLOBAL char * KW_INSERT INITIALLY( "INSERT" );
GLOBAL char * KW_INTEGER INITIALLY( "INTEGER" );
GLOBAL char * KW_INVERSE INITIALLY( "INVERSE" );
GLOBAL char * KW_LENGTH INITIALLY( "LENGTH" );
GLOBAL char * KW_LIKE INITIALLY( "LIKE" );
GLOBAL char * KW_LIST INITIALLY( "LIST" );
GLOBAL char * KW_LOBOUND INITIALLY( "LOBOUND" );
GLOBAL char * KW_LOCAL INITIALLY( "LOCAL" );
GLOBAL char * KW_LOG INITIALLY( "LOG" );
GLOBAL char * KW_LOG10 INITIALLY( "LOG10" );
GLOBAL char * KW_LOG2 INITIALLY( "LOG2" );
GLOBAL char * KW_LOGICAL INITIALLY( "LOGICAL" );
GLOBAL char * KW_LOINDEX INITIALLY( "LOINDEX" );
GLOBAL char * KW_MOD INITIALLY( "MOD" );
GLOBAL char * KW_MODEL INITIALLY( "MODEL" );
GLOBAL char * KW_NOT INITIALLY( "NOT" );
GLOBAL char * KW_NUMBER INITIALLY( "NUMBER" );
GLOBAL char * KW_NVL INITIALLY( "NVL" );
GLOBAL char * KW_ODD INITIALLY( "ODD" );
GLOBAL char * KW_OF INITIALLY( "OF" );
GLOBAL char * KW_ONEOF INITIALLY( "ONEOF" );
GLOBAL char * KW_OPTIONAL INITIALLY( "OPTIONAL" );
GLOBAL char * KW_OR INITIALLY( "OR" );
GLOBAL char * KW_OTHERWISE INITIALLY( "OTHERWISE" );
GLOBAL char * KW_PI INITIALLY( "PI" );
GLOBAL char * KW_PROCEDURE INITIALLY( "PROCEDURE" );
GLOBAL char * KW_QUERY INITIALLY( "QUERY" );
GLOBAL char * KW_REAL INITIALLY( "REAL" );
GLOBAL char * KW_REFERENCE INITIALLY( "REFERENCE" );
GLOBAL char * KW_REMOVE INITIALLY( "REMOVE" );
GLOBAL char * KW_REPEAT INITIALLY( "REPEAT" );
GLOBAL char * KW_RETURN INITIALLY( "RETURN" );
GLOBAL char * KW_ROLESOF INITIALLY( "ROLESOF" );
GLOBAL char * KW_RULE INITIALLY( "RULE" );
GLOBAL char * KW_SCHEMA INITIALLY( "SCHEMA" );
GLOBAL char * KW_SELECT INITIALLY( "SELECT" );
GLOBAL char * KW_SELF INITIALLY( "SELF" );
GLOBAL char * KW_SET INITIALLY( "SET" );
GLOBAL char * KW_SIN INITIALLY( "SIN" );
GLOBAL char * KW_SIZEOF INITIALLY( "SIZEOF" );
GLOBAL char * KW_SKIP INITIALLY( "SKIP" );
GLOBAL char * KW_SQRT INITIALLY( "SQRT" );
GLOBAL char * KW_STRING INITIALLY( "STRING" );
GLOBAL char * KW_SUBTYPE INITIALLY( "SUBTYPE" );
GLOBAL char * KW_SUPERTYPE INITIALLY( "SUPERTYPE" );
GLOBAL char * KW_TAN INITIALLY( "TAN" );
GLOBAL char * KW_THEN INITIALLY( "THEN" );
GLOBAL char * KW_TO INITIALLY( "TO" );
GLOBAL char * KW_TRUE INITIALLY( "TRUE" );
GLOBAL char * KW_TYPE INITIALLY( "TYPE" );
GLOBAL char * KW_TYPEOF INITIALLY( "TYPEOF" );
GLOBAL char * KW_UNIQUE INITIALLY( "UNIQUE" );
GLOBAL char * KW_UNKNOWN INITIALLY( "UNKNOWN" );
GLOBAL char * KW_UNTIL INITIALLY( "UNTIL" );
GLOBAL char * KW_USE INITIALLY( "USE" );
GLOBAL char * KW_USEDIN INITIALLY( "USEDIN" );
GLOBAL char * KW_VALUE INITIALLY( "VALUE" );
GLOBAL char * KW_VALUE_IN INITIALLY( "VALUE_IN" );
GLOBAL char * KW_VALUE_UNIQUE INITIALLY( "VALUE_UNIQUE" );
GLOBAL char * KW_VAR INITIALLY( "VAR" );
GLOBAL char * KW_WHERE INITIALLY( "WHERE" );
GLOBAL char * KW_WHILE INITIALLY( "WHILE" );
GLOBAL char * KW_XOR INITIALLY( "XOR" );
GLOBAL SCL_EXPRESS_EXPORT struct Scope_ * FUNC_NVL;
GLOBAL SCL_EXPRESS_EXPORT struct Scope_ * FUNC_USEDIN;
GLOBAL SCL_EXPRESS_EXPORT char * KW_ABS INITIALLY( "ABS" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_ABSTRACT INITIALLY( "ABSTRACT" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_ACOS INITIALLY( "ACOS" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_AGGREGATE INITIALLY( "AGGREGATE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_ALIAS INITIALLY( "ALIAS" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_AND INITIALLY( "AND" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_ANDOR INITIALLY( "ANDOR" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_ARRAY INITIALLY( "ARRAY" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_AS INITIALLY( "AS" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_ASIN INITIALLY( "ASIN" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_ATAN INITIALLY( "ATAN" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_BAG INITIALLY( "BAG" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_BEGIN INITIALLY( "BEGIN" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_BINARY INITIALLY( "BINARY" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_BLENGTH INITIALLY( "BLENGTH" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_BOOLEAN INITIALLY( "BOOLEAN" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_BY INITIALLY( "BY" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_CASE INITIALLY( "CASE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_CONST_E INITIALLY( "CONST_E" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_CONSTANT INITIALLY( "CONSTANT" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_CONTEXT INITIALLY( "CONTEXT" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_COS INITIALLY( "COS" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_DERIVE INITIALLY( "DERIVE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_DIV INITIALLY( "DIV" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_ELSE INITIALLY( "ELSE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_END INITIALLY( "END" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_ALIAS INITIALLY( "END_ALIAS" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_CASE INITIALLY( "END_CASE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_CONSTANT INITIALLY( "END_CONSTANT" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_CONTEXT INITIALLY( "END_CONTEXT" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_ENTITY INITIALLY( "END_ENTITY" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_FUNCTION INITIALLY( "END_FUNCTION" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_IF INITIALLY( "END_IF" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_LOCAL INITIALLY( "END_LOCAL" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_MODEL INITIALLY( "END_MODEL" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_PROCEDURE INITIALLY( "END_PROCEDURE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_REPEAT INITIALLY( "END_REPEAT" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_RULE INITIALLY( "END_RULE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_SCHEMA INITIALLY( "END_SCHEMA" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_END_TYPE INITIALLY( "END_TYPE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_ENTITY INITIALLY( "ENTITY" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_ENUMERATION INITIALLY( "ENUMERATION" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_ESCAPE INITIALLY( "ESCAPE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_EXISTS INITIALLY( "EXISTS" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_EXP INITIALLY( "EXP" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_FALSE INITIALLY( "FALSE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_FIXED INITIALLY( "FIXED" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_FOR INITIALLY( "FOR" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_FORMAT INITIALLY( "FORMAT" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_FROM INITIALLY( "FROM" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_FUNCTION INITIALLY( "FUNCTION" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_GENERIC INITIALLY( "GENERIC" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_HIBOUND INITIALLY( "HIBOUND" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_HIINDEX INITIALLY( "HIINDEX" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_IF INITIALLY( "IF" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_IN INITIALLY( "IN" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_INCLUDE INITIALLY( "INCLUDE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_INSERT INITIALLY( "INSERT" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_INTEGER INITIALLY( "INTEGER" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_INVERSE INITIALLY( "INVERSE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_LENGTH INITIALLY( "LENGTH" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_LIKE INITIALLY( "LIKE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_LIST INITIALLY( "LIST" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_LOBOUND INITIALLY( "LOBOUND" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_LOCAL INITIALLY( "LOCAL" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_LOG INITIALLY( "LOG" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_LOG10 INITIALLY( "LOG10" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_LOG2 INITIALLY( "LOG2" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_LOGICAL INITIALLY( "LOGICAL" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_LOINDEX INITIALLY( "LOINDEX" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_MOD INITIALLY( "MOD" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_MODEL INITIALLY( "MODEL" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_NOT INITIALLY( "NOT" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_NUMBER INITIALLY( "NUMBER" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_NVL INITIALLY( "NVL" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_ODD INITIALLY( "ODD" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_OF INITIALLY( "OF" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_ONEOF INITIALLY( "ONEOF" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_OPTIONAL INITIALLY( "OPTIONAL" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_OR INITIALLY( "OR" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_OTHERWISE INITIALLY( "OTHERWISE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_PI INITIALLY( "PI" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_PROCEDURE INITIALLY( "PROCEDURE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_QUERY INITIALLY( "QUERY" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_REAL INITIALLY( "REAL" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_REFERENCE INITIALLY( "REFERENCE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_REMOVE INITIALLY( "REMOVE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_REPEAT INITIALLY( "REPEAT" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_RETURN INITIALLY( "RETURN" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_ROLESOF INITIALLY( "ROLESOF" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_RULE INITIALLY( "RULE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_SCHEMA INITIALLY( "SCHEMA" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_SELECT INITIALLY( "SELECT" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_SELF INITIALLY( "SELF" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_SET INITIALLY( "SET" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_SIN INITIALLY( "SIN" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_SIZEOF INITIALLY( "SIZEOF" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_SKIP INITIALLY( "SKIP" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_SQRT INITIALLY( "SQRT" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_STRING INITIALLY( "STRING" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_SUBTYPE INITIALLY( "SUBTYPE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_SUPERTYPE INITIALLY( "SUPERTYPE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_TAN INITIALLY( "TAN" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_THEN INITIALLY( "THEN" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_TO INITIALLY( "TO" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_TRUE INITIALLY( "TRUE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_TYPE INITIALLY( "TYPE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_TYPEOF INITIALLY( "TYPEOF" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_UNIQUE INITIALLY( "UNIQUE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_UNKNOWN INITIALLY( "UNKNOWN" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_UNTIL INITIALLY( "UNTIL" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_USE INITIALLY( "USE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_USEDIN INITIALLY( "USEDIN" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_VALUE INITIALLY( "VALUE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_VALUE_IN INITIALLY( "VALUE_IN" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_VALUE_UNIQUE INITIALLY( "VALUE_UNIQUE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_VAR INITIALLY( "VAR" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_WHERE INITIALLY( "WHERE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_WHILE INITIALLY( "WHILE" );
GLOBAL SCL_EXPRESS_EXPORT char * KW_XOR INITIALLY( "XOR" );
#undef GLOBAL
#undef INITIALLY
@@ -255,29 +261,20 @@ GLOBAL char * KW_XOR INITIALLY( "XOR" );
#define EXPRESSput_basename(e,n) ((e)->u.express->basename = (n))
#define EXPRESSput_filename(e,n) ((e)->u.express->filename = (n))
/********************/
/* Inline functions */
/********************/
#if supports_inline_functions || defined(EXPRESS_C)
#endif /*supports_inline_functions || defined(EXPRESS_C)*/
/***********************/
/* function prototypes */
/***********************/
extern Express EXPRESScreate PROTO( ( void ) );
extern void EXPRESSparse PROTO( ( Express, FILE *, char * ) );
extern void EXPRESSinitialize PROTO( ( void ) );
extern void EXPRESSresolve PROTO( ( Express ) );
extern char * EXPRESSversion PROTO( ( void ) );
extern int EXPRESS_fail PROTO( ( Express ) );
extern int EXPRESS_succeed PROTO( ( Express ) );
extern SCL_EXPRESS_EXPORT Express EXPRESScreate PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void EXPRESSdestroy PROTO( ( Express ) );
extern SCL_EXPRESS_EXPORT void EXPRESSparse PROTO( ( Express, FILE *, char * ) );
extern SCL_EXPRESS_EXPORT void EXPRESSinitialize PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void EXPRESScleanup PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void EXPRESSresolve PROTO( ( Express ) );
extern SCL_EXPRESS_EXPORT char * EXPRESSversion PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT int EXPRESS_fail PROTO( ( Express ) );
extern SCL_EXPRESS_EXPORT int EXPRESS_succeed PROTO( ( Express ) );
extern void EXPRESSinit_init PROTO( ( void ) );
#if 0
extern void EXPRESSdump_model PROTO( ( Express ) );
#endif /*0*/
extern void build_complex( Express );
extern SCL_EXPRESS_EXPORT void build_complex( Express );
#endif /*EXPRESS_H*/
+32 -38
View File
@@ -1,9 +1,8 @@
#ifndef HASH_H
#define HASH_H
/* $Id: hash.h,v 1.6 1997/10/22 16:36:49 sauderd Exp $ */
/************************************************************************
/** **********************************************************************
* \file hash.h
** Hash_Table: Hash_Table
** Description:
**
@@ -90,9 +89,9 @@
#define HASH_NULL (Hash_Table)NULL
#define SEGMENT_SIZE 256
#define SEGMENT_SIZE_SHIFT 8 /* log2(SEGMENT_SIZE) */
#define SEGMENT_SIZE_SHIFT 8 /**< log2(SEGMENT_SIZE) */
#define DIRECTORY_SIZE 256
#define DIRECTORY_SIZE_SHIFT 8 /* log2(DIRECTORY_SIZE) */
#define DIRECTORY_SIZE_SHIFT 8 /**< log2(DIRECTORY_SIZE) */
#define PRIME1 37
#define PRIME2 1048583
#define MAX_LOAD_FACTOR 5
@@ -101,6 +100,7 @@
/* packages used */
/*****************/
#include <scl_export.h>
#ifdef HASH_C
#include <assert.h>
#endif /*HASH_C*/
@@ -123,42 +123,39 @@ typedef struct Element_ {
char * key;
char * data;
struct Element_ * next;
Symbol * symbol;/* for debugging hash conflicts */
char type; /* user-supplied type */
Symbol * symbol; /**< for debugging hash conflicts */
char type; /**< user-supplied type */
} * Element;
typedef Element * Segment;
typedef struct Hash_Table_ {
#if 0
int in_use; /* If someone is traversing the hash table */
int in_use; /**< If someone is traversing the hash table */
#endif
unsigned int p; /* Next bucket to be split */
unsigned int maxp; /* upper bound on p during expansion */
long KeyCount; /* current # keys */
unsigned int SegmentCount; /* current # segments */
unsigned int p; /**< Next bucket to be split */
unsigned int maxp; /**< upper bound on p during expansion */
long KeyCount; /**< current # keys */
unsigned int SegmentCount; /**< current # segments */
unsigned int MinLoadFactor;
unsigned int MaxLoadFactor;
Segment Directory[DIRECTORY_SIZE];
} * Hash_Table;
typedef struct {
int i; /* segment index (i think) */
int j; /* key index in segment (ditto) */
Element p; /* usually the next element to be returned */
unsigned int i; /**< segment index (i think) */
unsigned int j; /**< key index in segment (ditto) */
Element p; /**< usually the next element to be returned */
Hash_Table table;
char type;
Element e; /* originally thought of as a place for */
/* the caller of HASHlist to temporarily stash the return value */
/* to allow the caller (i.e., DICTdo) to be macroized, but now */
/* conveniently used by HASHlist, which both stores the ultimate */
/* value here as well as returns it via the return value of HASHlist */
Element e; /**< originally thought of as a place for
* the caller of HASHlist to temporarily stash the return value
* to allow the caller (i.e., DICTdo) to be macroized, but now
* conveniently used by HASHlist, which both stores the ultimate
* value here as well as returns it via the return value of HASHlist
*/
} HashEntry;
/****************/
/* modules used */
/****************/
/********************/
/* global variables */
/********************/
@@ -171,8 +168,8 @@ typedef struct {
# define INITIALLY(value)
#endif /*HASH_C*/
GLOBAL struct freelist_head HASH_Table_fl;
GLOBAL struct freelist_head HASH_Element_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head HASH_Table_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head HASH_Element_fl;
#undef GLOBAL
#undef INITIALLY
@@ -185,7 +182,7 @@ GLOBAL struct freelist_head HASH_Element_fl;
** Fast arithmetic, relying on powers of 2
*/
/*
/**
The centerline compiler was having problems with MUL and DIV. Where DIV
was called like this DIV(NewAddress, SEGMENT_SIZE) it is now being called like
DIV(NewAddress, SEGMENT_SIZE_SHIFT). The compiler was mentioning some kind of
@@ -211,16 +208,13 @@ This change only seems to have affected hash.h and hash.c
/* function prototypes */
/***********************/
extern void HASHinitialize PROTO( ( void ) );
extern Hash_Table HASHcreate PROTO( ( unsigned ) );
extern Hash_Table HASHcopy PROTO( ( Hash_Table ) );
extern void HASHdestroy PROTO( ( Hash_Table ) );
extern Element HASHsearch PROTO( ( Hash_Table, Element, Action ) );
extern void HASHlistinit PROTO( ( Hash_Table, HashEntry * ) );
extern void HASHlistinit_by_type PROTO( ( Hash_Table, HashEntry *, char ) );
extern Element HASHlist PROTO( ( HashEntry * ) );
#if 0
extern void HASHlistend PROTO( ( HashEntry * ) );
#endif
extern SCL_EXPRESS_EXPORT void HASHinitialize PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT Hash_Table HASHcreate PROTO( ( unsigned ) );
extern SCL_EXPRESS_EXPORT Hash_Table HASHcopy PROTO( ( Hash_Table ) );
extern SCL_EXPRESS_EXPORT void HASHdestroy PROTO( ( Hash_Table ) );
extern SCL_EXPRESS_EXPORT Element HASHsearch PROTO( ( Hash_Table, Element, Action ) );
extern SCL_EXPRESS_EXPORT void HASHlistinit PROTO( ( Hash_Table, HashEntry * ) );
extern SCL_EXPRESS_EXPORT void HASHlistinit_by_type PROTO( ( Hash_Table, HashEntry *, char ) );
extern SCL_EXPRESS_EXPORT Element HASHlist PROTO( ( HashEntry * ) );
#endif /*HASH_H*/
+35 -32
View File
@@ -1,8 +1,6 @@
#ifndef LEX_ACTIONS_H
#define LEX_ACTIONS_H
/* $Id: lexact.h,v 1.5 1995/04/05 13:55:40 clark dec96 $ */
/*
* This software was developed by U.S. Government employees as part of
* their official duties and is not subject to copyright.
@@ -40,6 +38,7 @@
/* packages used */
/*****************/
#include <scl_export.h>
#include <ctype.h>
#include "basic.h"
#include "error.h"
@@ -77,19 +76,19 @@ typedef struct Scan_Buffer {
# define INITIALLY(value)
#endif /* LEX_ACTIONS_C */
GLOBAL Scan_Buffer SCAN_buffers[SCAN_NESTING_DEPTH];
GLOBAL int SCAN_current_buffer INITIALLY( 0 );
GLOBAL char * SCANcurrent;
GLOBAL SCL_EXPRESS_EXPORT Scan_Buffer SCAN_buffers[SCAN_NESTING_DEPTH];
GLOBAL SCL_EXPRESS_EXPORT int SCAN_current_buffer INITIALLY( 0 );
GLOBAL SCL_EXPRESS_EXPORT char * SCANcurrent;
GLOBAL Error ERROR_include_file INITIALLY( ERROR_none );
GLOBAL Error ERROR_unmatched_close_comment INITIALLY( ERROR_none );
GLOBAL Error ERROR_unmatched_open_comment INITIALLY( ERROR_none );
GLOBAL Error ERROR_unterminated_string INITIALLY( ERROR_none );
GLOBAL Error ERROR_encoded_string_bad_digit INITIALLY( ERROR_none );
GLOBAL Error ERROR_encoded_string_bad_count INITIALLY( ERROR_none );
GLOBAL Error ERROR_bad_identifier INITIALLY( ERROR_none );
GLOBAL Error ERROR_unexpected_character INITIALLY( ERROR_none );
GLOBAL Error ERROR_nonascii_char;
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_include_file INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_unmatched_close_comment INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_unmatched_open_comment INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_unterminated_string INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_encoded_string_bad_digit INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_encoded_string_bad_count INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_bad_identifier INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_unexpected_character INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_nonascii_char;
#undef GLOBAL
@@ -112,27 +111,27 @@ GLOBAL Error ERROR_nonascii_char;
/* function prototypes */
/***********************/
extern int yylex PROTO( ( void ) ); /* the scanner */
extern SCL_EXPRESS_EXPORT int yylex PROTO( ( void ) ); /* the scanner */
extern void SCANinitialize PROTO( ( void ) );
extern int SCANprocess_real_literal PROTO( ( void ) );
extern int SCANprocess_integer_literal PROTO( ( void ) );
extern int SCANprocess_binary_literal PROTO( ( void ) );
extern int SCANprocess_logical_literal PROTO( ( char * ) );
extern int SCANprocess_identifier_or_keyword PROTO( ( void ) );
extern int SCANprocess_string PROTO( ( void ) );
extern int SCANprocess_encoded_string PROTO( ( void ) );
extern int SCANprocess_semicolon PROTO( ( int ) );
extern void SCANsave_comment PROTO( ( void ) );
extern bool SCANread PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void SCANinitialize PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT int SCANprocess_real_literal PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT int SCANprocess_integer_literal PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT int SCANprocess_binary_literal PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT int SCANprocess_logical_literal PROTO( ( char * ) );
extern SCL_EXPRESS_EXPORT int SCANprocess_identifier_or_keyword PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT int SCANprocess_string PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT int SCANprocess_encoded_string PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT int SCANprocess_semicolon PROTO( ( int ) );
extern SCL_EXPRESS_EXPORT void SCANsave_comment PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT bool SCANread PROTO( ( void ) );
#if macros_bit_the_dust
extern void SCANdefine_macro PROTO( ( char *, char * ) );
extern SCL_EXPRESS_EXPORT void SCANdefine_macro PROTO( ( char *, char * ) );
#endif
extern void SCANinclude_file PROTO( ( char * ) );
void SCANlowerize PROTO( ( char * ) );
void SCANupperize PROTO( ( char * ) );
extern char * SCANstrdup PROTO( ( char * ) );
extern long SCANtell PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void SCANinclude_file PROTO( ( char * ) );
SCL_EXPRESS_EXPORT void SCANlowerize PROTO( ( char * ) );
SCL_EXPRESS_EXPORT void SCANupperize PROTO( ( char * ) );
extern SCL_EXPRESS_EXPORT char * SCANstrdup PROTO( ( char * ) );
extern SCL_EXPRESS_EXPORT long SCANtell PROTO( ( void ) );
/*******************************/
/* inline function definitions */
@@ -162,7 +161,11 @@ SCANnextchar( char * buffer ) {
SCANbuffer.numRead--;
#endif
buffer[0] = *( SCANcurrent++ );
#ifdef __MSVC__
if( !__isascii( buffer[0] ) ) {
#else
if( !isascii( buffer[0] ) ) {
#endif
ERRORreport_with_line( ERROR_nonascii_char, yylineno,
0xff & buffer[0] );
buffer[0] = ' '; /* substitute space */
+43 -39
View File
@@ -1,8 +1,6 @@
#ifndef LINKED_LIST_H
#define LINKED_LIST_H
/* $Id: linklist.h,v 1.3 1997/01/21 19:15:23 dar Exp $ */
/*
* This work was supported by the United States Government, and is
* not subject to copyright.
@@ -38,6 +36,7 @@
/* packages used */
/*****************/
#include <scl_export.h>
#include "basic.h"
#include "memory.h"
@@ -47,10 +46,6 @@
typedef struct Linked_List_ * Linked_List;
#ifdef __STDC__
#else /* old C */
#endif /*__STDC__*/
/****************/
/* modules used */
/****************/
@@ -81,10 +76,10 @@ struct Linked_List_ {
#include "decstart.h"
#endif /*LINKED_LIST_C*/
GLOBAL Error ERROR_empty_list INITIALLY( ERROR_none );
GLOBAL struct freelist_head LINK_fl;
GLOBAL struct freelist_head LIST_fl;
GLOBAL Linked_List LINK__l; /* for LISTcreate_with macro - ugh */
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_empty_list INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head LINK_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head LIST_fl;
GLOBAL SCL_EXPRESS_EXPORT Linked_List LINK__l; /* for LISTcreate_with macro - ugh */
#include "de_end.h"
@@ -97,37 +92,38 @@ GLOBAL Linked_List LINK__l; /* for LISTcreate_with macro - ugh */
#define LIST_new() (struct Linked_List_ *)MEM_new(&LIST_fl)
#define LIST_destroy(x) MEM_destroy(&LIST_fl,(Freelist *)(Generic)x)
/* following could be optimized */
/** following could be optimized */
#define LISTcreate_with(x) (LINK__l = LISTcreate()),\
LISTadd(LINK__l,x),\
LINK_l)
/* accessing links */
/** accessing links */
#define LINKdata(link) (link)->data
#define LINKnext(link) (link)->next
#define LINKprev(link) (link)->prev
/* iteration */
#define LISTdo(list, elt, type) \
{struct Linked_List_ * __l = (list); \
type elt; \
Link __p; \
if (__l) { \
/** iteration */
#define LISTdo(list, elt, type) \
{struct Linked_List_ * __l = (list); \
type elt; \
Link __p; \
if (__l) { \
for (__p = __l->mark; (__p = __p->next) != __l->mark; ) { \
(elt) = (type)((__p)->data);
#define LISTdo_links(list, link) \
{Linked_List __in = (list); \
Link link; \
if (__in != LIST_NULL) { \
for ((link) = __in->mark; ((link) = (link)->next) != __in->mark; ) {
{Linked_List __i = (list); \
Link link; \
if (__i != LIST_NULL) { \
for ((link) = __i->mark; ((link) = (link)->next) != __i->mark; ) {
#define LISTod }}}
/* accessing */
/** accessing */
#define LISTpeek_first(list) \
(((struct Linked_List_*)list)->mark->next->data)
/* function aliases */
/** function aliases */
#define LISTadd(list, item) LISTadd_last(list, item)
#define LISTadd_all(list, items) \
LISTdo(items, e, Generic) \
@@ -138,26 +134,28 @@ GLOBAL Linked_List LINK__l; /* for LISTcreate_with macro - ugh */
/* function prototypes */
/***********************/
extern void LISTinitialize PROTO( ( void ) );
extern Linked_List LISTcreate PROTO( ( void ) );
/*extern Linked_List LISTcreate_with PROTO((Generic));*/
extern Linked_List LISTcopy PROTO( ( Linked_List ) );
extern Generic LISTadd_first PROTO( ( Linked_List, Generic ) );
extern Generic LISTadd_last PROTO( ( Linked_List, Generic ) );
extern Generic LISTadd_after PROTO( ( Linked_List, Link, Generic ) );
extern Generic LISTadd_before PROTO( ( Linked_List, Link, Generic ) );
extern Generic LISTremove_first PROTO( ( Linked_List ) );
extern Generic LISTremove PROTO( ( Linked_List, Link ) );
extern Generic LISTget_first PROTO( ( Linked_List ) );
extern Generic LISTget_second PROTO( ( Linked_List ) );
extern Generic LISTget_nth PROTO( ( Linked_List, int ) );
extern void LISTfree PROTO( ( Linked_List ) );
extern int LISTget_length PROTO( ( Linked_List ) );
extern SCL_EXPRESS_EXPORT void LISTinitialize PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void LISTcleanup PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT Linked_List LISTcreate PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT Linked_List LISTcopy PROTO( ( Linked_List ) );
extern SCL_EXPRESS_EXPORT Generic LISTadd_first PROTO( ( Linked_List, Generic ) );
extern SCL_EXPRESS_EXPORT Generic LISTadd_last PROTO( ( Linked_List, Generic ) );
extern SCL_EXPRESS_EXPORT Generic LISTadd_after PROTO( ( Linked_List, Link, Generic ) );
extern SCL_EXPRESS_EXPORT Generic LISTadd_before PROTO( ( Linked_List, Link, Generic ) );
extern SCL_EXPRESS_EXPORT Generic LISTremove_first PROTO( ( Linked_List ) );
extern SCL_EXPRESS_EXPORT Generic LISTremove PROTO( ( Linked_List, Link ) );
extern SCL_EXPRESS_EXPORT Generic LISTget_first PROTO( ( Linked_List ) );
extern SCL_EXPRESS_EXPORT Generic LISTget_second PROTO( ( Linked_List ) );
extern SCL_EXPRESS_EXPORT Generic LISTget_nth PROTO( ( Linked_List, int ) );
extern SCL_EXPRESS_EXPORT void LISTfree PROTO( ( Linked_List ) );
extern SCL_EXPRESS_EXPORT int LISTget_length PROTO( ( Linked_List ) );
/*******************************/
/* inline function definitions */
/*******************************/
#if !defined(__BORLAND__)
#if supports_inline_functions || defined(LINKED_LIST_C)
static_inline
@@ -174,4 +172,10 @@ LISTempty( Linked_List list ) {
#endif /* supports_inline_functions || defined(LINKED_LIST_C) */
#else
extern SCL_EXPRESS_EXPORT bool LISTempty( Linked_List list );
#endif
#endif /*LINKED_LIST_H*/
+18 -19
View File
@@ -1,8 +1,6 @@
#ifndef MEMORY_H
#define MEMORY_H
/* $Id: memory.h,v 1.5 1997/01/21 19:17:11 dar Exp $ */
/*
* This work was supported by the United States Government, and is
* not subject to copyright.
@@ -30,29 +28,30 @@
/* packages used */
/*****************/
/* mem.h - defs for fixed size block memory allocator */
#include <scl_export.h>
/** \file memory.h - defs for fixed size block memory allocator */
typedef long Align;
union freelist {
union freelist * next; /* next block on freelist */
char memory; /* user data */
Align aligner; /* force alignment of blocks */
union freelist * next; /**< next block on freelist */
char memory; /**< user data */
Align aligner; /**< force alignment of blocks */
};
typedef union freelist Freelist;
struct freelist_head {
int size_elt; /* size of a single elt */
int size_elt; /**< size of a single elt */
#ifndef NOSTAT
int alloc; /* # of allocations */
int alloc; /**< # of allocations */
int dealloc;
int create; /* number of calls to create a new freelist */
Generic max; /* end of freelist */
int create; /**< number of calls to create a new freelist */
Generic max; /**< end of freelist */
#endif
int size; /* size of a single elt incl. next ptr */
int bytes; /* if we run out, allocate memory by this
many bytes */
int size; /**< size of a single elt incl. next ptr */
int bytes; /**< if we run out, allocate memory by this many bytes */
Freelist * freelist;
#if SPACE_PROFILE
int count;
@@ -76,17 +75,17 @@ char * nnew();
extern int yylineno;
/* CALLOC grabs and initializes to all 0s space for the indicated */
/* number of instances of the indicated type */
/** CALLOC grabs and initializes to all 0s space for the indicated
* number of instances of the indicated type */
#define CALLOC(ptr, num, type) \
if (((ptr) = (type*)calloc((num), (unsigned)sizeof(type)))==NULL) { \
fprintf(stderr,"fedex: out of space");\
} else {}
void _MEMinitialize PROTO( ( void ) );
void MEMinitialize PROTO( ( struct freelist_head *, int, int, int ) );
void MEM_destroy PROTO( ( struct freelist_head *, Freelist * ) );
Generic MEM_new PROTO( ( struct freelist_head * ) );
SCL_EXPRESS_EXPORT void _MEMinitialize PROTO( ( void ) );
SCL_EXPRESS_EXPORT void MEMinitialize PROTO( ( struct freelist_head *, int, int, int ) );
SCL_EXPRESS_EXPORT void MEM_destroy PROTO( ( struct freelist_head *, Freelist * ) );
SCL_EXPRESS_EXPORT Generic MEM_new PROTO( ( struct freelist_head * ) );
#include "de_end.h"
+14 -29
View File
@@ -1,10 +1,8 @@
#ifndef OBJECT_H
#define OBJECT_H
/* $Id: object.h,v 1.9 1997/01/21 19:17:11 dar Exp $ */
/************************************************************************
** Module: Object
/** **********************************************************************
** Module: Object \file object.h
** Description: This module implements the Object abstraction.
** Constants:
** OBJECT_NULL - the null class
@@ -48,15 +46,16 @@
/* constants */
/*************/
/* each object has an index - current the index is a mnemonic character */
/* hence the array is rather sparse, but the extra slop is only a hundred */
/* or so bytes, so it's nothing to sweat about */
/** each object has an index - current the index is a mnemonic character
* hence the array is rather sparse, but the extra slop is only a hundred
* or so bytes, so it's nothing to sweat about */
#define MAX_OBJECT_TYPES 127 /* really could be a LOT less */
/*****************/
/* packages used */
/*****************/
#include <scl_export.h>
#include "basic.h" /* get basic definitions */
#include "symbol.h"
@@ -70,9 +69,8 @@
struct Object {
struct Symbol_ * ( *get_symbol )();
char * type; /* should complete the phrase "X is ..." */
/* i.e., "an entity", "a type", "of unknown type" */
int bits; /* a bitwise selector of a type, i.e. OBJ_XX_BITS */
char * type; /**< should complete the phrase "X is ..." - i.e., "an entity", "a type", "of unknown type" */
int bits; /**< a bitwise selector of a type, i.e. OBJ_XX_BITS */
};
/****************/
@@ -89,7 +87,7 @@ struct Object {
#include "decstart.h"
#endif /*OBJECT_C */
GLOBAL struct Object * OBJ;
GLOBAL SCL_EXPRESS_EXPORT struct Object * OBJ;
#include "de_end.h"
@@ -103,28 +101,15 @@ GLOBAL struct Object * OBJ;
#define OBJtype_is_oneof(_type_,class) (OBJ[(int)_type_].bits & (class))
#define OBJget_name(obj,type) (OBJget_symbol(obj,type)->name)
/* for backwards compatibility */
#define OBJequal(x,y) ((x) == (y))
#define OBJfree(x)
#define OBJreference(x) (x)
#define OBJget_data(obj,type,err) (obj)
/* removed #define statements for obsolete fn macros OBJequal OBJfree OBJreference OBJget_data */
/***********************/
/* function prototypes */
/***********************/
extern void OBJinitialize PROTO( ( void ) );
extern void OBJcreate PROTO( ( char, struct Symbol_ * ( * )( Generic ), char *, int ) );
extern Symbol * UNK_get_symbol PROTO( ( Generic x ) );
#if 0
extern void OBJcreate( char, struct Symbol * ( * )( Generic ), char *, int );
#endif
/********************/
/* inline functions */
/********************/
#if supports_inline_functions || defined(OBJECT_C)
#endif /* supports_inline_functions || defined(OBJECT_C) */
extern SCL_EXPRESS_EXPORT void OBJinitialize PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void OBJcleanup PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void OBJcreate PROTO( ( char, struct Symbol_ * ( * )( Generic ), char *, int ) );
extern SCL_EXPRESS_EXPORT Symbol * UNK_get_symbol PROTO( ( Generic x ) );
#endif /*OBJECT_H*/
+28 -22
View File
@@ -1,8 +1,6 @@
#ifndef RESOLVE_H
#define RESOLVE_H
/* $Id: resolve.h,v 1.6 1994/11/10 19:20:03 clark dec96 $ */
/*
* This software was developed by U.S. Government employees as part of
* their official duties and is not subject to copyright.
@@ -30,6 +28,7 @@
* Initial revision
*/
#include <scl_export.h>
#include "expbasic.h" /* get basic definitions */
#include "type.h"
#include "variable.h"
@@ -54,17 +53,25 @@
# define INITIALLY(value)
#endif /*RESOLVE_C*/
GLOBAL int print_objects_while_running INITIALLY( 0 );
GLOBAL SCL_EXPRESS_EXPORT int print_objects_while_running INITIALLY( 0 );
GLOBAL Error ERROR_undefined_attribute INITIALLY( ERROR_none );
GLOBAL Error ERROR_undefined_type INITIALLY( ERROR_none );
GLOBAL Error ERROR_undefined_schema INITIALLY( ERROR_none );
GLOBAL Error ERROR_unknown_attr_in_entity INITIALLY( ERROR_none );
GLOBAL Error ERROR_unknown_subtype INITIALLY( ERROR_none );
GLOBAL Error ERROR_unknown_supertype INITIALLY( ERROR_none );
GLOBAL Error ERROR_circular_reference INITIALLY( ERROR_none );
GLOBAL Error ERROR_ambiguous_attribute INITIALLY( ERROR_none );
GLOBAL Error ERROR_ambiguous_group INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_undefined_attribute INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_undefined_type INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_undefined_schema INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_unknown_attr_in_entity INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_unknown_subtype INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_unknown_supertype INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_circular_reference INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_ambiguous_attribute INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_ambiguous_group INITIALLY( ERROR_none );
/** If we're inside a conditional statement (within a function, procedure, etc)
* then this variable points to that statement. Currently the only use is to
* suppress errors when the test in an IF...ENDIF always evaluates one way.
* Set within STMTresolve().
* \sa STMTresolve
*/
GLOBAL SCL_EXPRESS_EXPORT Statement currCondStmt INITIALLY(0);
#undef GLOBAL
#undef INITIALLY
@@ -73,7 +80,6 @@ GLOBAL Error ERROR_ambiguous_group INITIALLY( ERROR_none );
/* cheaper doing the check here, then inside the function call. Return */
/* immediately for RESOLVED, FAILED_TO_RESOLVE, and RESOLVE_IN_PROGRESS */
/*#define TYPEresolve(t,s) if (is_resolvable((*(t)))) TYPE_resolve((t),(s))*/
#define TYPEresolve(t,s) if (is_resolvable((*(t)))) TYPE_resolve((t))
#define VARresolve_types(v,s) if (is_resolvable((v)->name)) VAR_resolve_types((v),(s))
#define VARresolve_expressions(v,s) if (is_resolvable((v)->name)) VAR_resolve_expressions((v),(s))
@@ -83,14 +89,14 @@ GLOBAL Error ERROR_ambiguous_group INITIALLY( ERROR_none );
/* function prototypes */
/***********************/
extern void RESOLVEinitialize PROTO( ( void ) );
extern void SCOPEresolve_expressions_statements PROTO( ( Scope ) );
extern void SCOPEresolve_subsupers PROTO( ( Scope ) );
extern void SCOPEresolve_types PROTO( ( Scope ) );
/*extern void TYPE_resolve PROTO((Type *,Scope));*/
extern void TYPE_resolve PROTO( ( Type * ) );
extern void EXP_resolve PROTO( ( Expression, Scope, Type ) );
extern void ALGresolve PROTO( ( Scope ) );
extern void SCHEMAresolve PROTO( ( Scope ) );
extern SCL_EXPRESS_EXPORT void RESOLVEinitialize PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void RESOLVEcleanup PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void SCOPEresolve_expressions_statements PROTO( ( Scope ) );
extern SCL_EXPRESS_EXPORT void SCOPEresolve_subsupers PROTO( ( Scope ) );
extern SCL_EXPRESS_EXPORT void SCOPEresolve_types PROTO( ( Scope ) );
extern SCL_EXPRESS_EXPORT void TYPE_resolve PROTO( ( Type * ) );
extern SCL_EXPRESS_EXPORT void EXP_resolve PROTO( ( Expression, Scope, Type ) );
extern SCL_EXPRESS_EXPORT void ALGresolve PROTO( ( Scope ) );
extern SCL_EXPRESS_EXPORT void SCHEMAresolve PROTO( ( Scope ) );
#endif /*RESOLVE_H*/
+34 -52
View File
@@ -1,10 +1,8 @@
#ifndef SCHEMA_H
#define SCHEMA_H
/* $Id: schema.h,v 1.11 1997/02/25 19:49:01 dar Exp $ */
/************************************************************************
** Module: Schema
/** **********************************************************************
** Module: Schema \file schema.h
** Description: This module implements the Schema abstraction, which
** basically amounts to a named symbol table.
** Constants:
@@ -48,23 +46,15 @@
* prettied up interface to print_objects_when_running
*/
/*************/
/* constants */
/*************/
/*****************/
/* packages used */
/*****************/
#include <scl_export.h>
#include "expbasic.h" /* get basic definitions */
#include "symbol.h"
#include "scope.h"
/************/
/* typedefs */
/************/
/*typedef struct Scope *Schema;*/
/****************/
/* modules used */
@@ -86,30 +76,28 @@ typedef struct Rename {
Schema schema;
struct Symbol_ * old;
struct Symbol_ * nnew;
Generic object; /* once object has been looked up */
char type; /* drat, need to remember this */
/* once renames have been resolved to avoid */
/* looking them up in the dictionary again */
Generic object; /**< once object has been looked up */
char type; /**< drat, need to remember this once renames have been
* resolved to avoid looking them up in the dictionary again */
enum rename_type rename_type;
int userdata; /* generic for user */
int userdata; /**< generic for user */
} Rename;
struct Schema_ {
Linked_List rules;
#if 0
struct Express_ * express;
#endif
Linked_List reflist;
Linked_List uselist;
/* dictionarys into which are entered renames for each specific */
/* object specified in a rename clause (even if it uses the same */
/* name */
/** \var refdict, usedict
* dictionarys into which are entered renames for each specific
* object specified in a rename clause (even if it uses the same
* name */
Dictionary refdict;
Dictionary usedict;
/* lists of schemas that are fully ref/use'd */
/* entries can be 0 if schemas weren't found during RENAMEresolve */
Linked_List use_schemas;
Linked_List ref_schemas;
Linked_List use_schemas; /**< lists of schemas that are fully use'd
* entries can be 0 if schemas weren't found during RENAMEresolve */
Linked_List ref_schemas; /**< lists of schemas that are fully ref'd
* entries can be 0 if schemas weren't found during RENAMEresolve */
};
/********************/
@@ -124,11 +112,11 @@ struct Schema_ {
# define INITIALLY(value)
#endif /* SCHEMA_C */
GLOBAL struct freelist_head REN_fl;
GLOBAL struct freelist_head SCOPE_fl;
GLOBAL struct freelist_head SCHEMA_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head REN_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head SCOPE_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head SCHEMA_fl;
GLOBAL int __SCOPE_search_id INITIALLY( 0 );
GLOBAL SCL_EXPRESS_EXPORT int __SCOPE_search_id INITIALLY( 0 );
#undef GLOBAL
#undef INITIALLY
@@ -156,26 +144,20 @@ GLOBAL int __SCOPE_search_id INITIALLY( 0 );
/* function prototypes */
/***********************/
extern Variable VARfind PROTO( ( Scope, char *, int ) );
extern Schema SCHEMAcreate PROTO( ( void ) );
extern void SCHEMAinitialize PROTO( ( void ) );
extern void SCHEMAadd_use PROTO( ( Schema, Symbol *, Symbol *, Symbol * ) );
extern void SCHEMAadd_reference PROTO( ( Schema, Symbol *, Symbol *, Symbol * ) );
extern void SCHEMAdefine_use PROTO( ( Schema, Rename * ) );
extern void SCHEMAdefine_reference PROTO( ( Schema, Rename * ) );
extern Generic SCHEMAfind PROTO( ( Schema, char * name, int search_refs ) );
extern Scope SCOPEcreate PROTO( ( char ) );
extern Scope SCOPEcreate_tiny PROTO( ( char ) );
extern Scope SCOPEcreate_nostab PROTO( ( char ) );
extern Linked_List SCHEMAget_entities_use PROTO( ( Scope ) );
extern Linked_List SCHEMAget_entities_ref PROTO( ( Scope ) );
/********************/
/* inline functions */
/********************/
#if supports_inline_functions || defined(SCHEMA_C)
#endif /* supports_inline_functions || defined(SCHEMA_C) */
extern SCL_EXPRESS_EXPORT Variable VARfind PROTO( ( Scope, char *, int ) );
extern SCL_EXPRESS_EXPORT Schema SCHEMAcreate PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void SCHEMAinitialize PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void SCHEMAadd_use PROTO( ( Schema, Symbol *, Symbol *, Symbol * ) );
extern SCL_EXPRESS_EXPORT void SCHEMAadd_reference PROTO( ( Schema, Symbol *, Symbol *, Symbol * ) );
extern SCL_EXPRESS_EXPORT void SCHEMAdefine_use PROTO( ( Schema, Rename * ) );
extern SCL_EXPRESS_EXPORT void SCHEMAdefine_reference PROTO( ( Schema, Rename * ) );
extern SCL_EXPRESS_EXPORT Generic SCHEMAfind PROTO( ( Schema, char * name, int search_refs ) );
extern SCL_EXPRESS_EXPORT Scope SCOPEcreate PROTO( ( char ) );
extern SCL_EXPRESS_EXPORT Scope SCOPEcreate_tiny PROTO( ( char ) );
extern SCL_EXPRESS_EXPORT Scope SCOPEcreate_nostab PROTO( ( char ) );
extern SCL_EXPRESS_EXPORT void SCOPEdestroy PROTO( ( Scope ) );
extern SCL_EXPRESS_EXPORT Linked_List SCHEMAget_entities_use PROTO( ( Scope ) );
extern SCL_EXPRESS_EXPORT Linked_List SCHEMAget_entities_ref PROTO( ( Scope ) );
#endif /* SCHEMA_H */
+16 -42
View File
@@ -1,10 +1,8 @@
#ifndef SCOPE_H
#define SCOPE_H
/* $Id: scope.h,v 1.10 1997/01/21 19:17:11 dar Exp $ */
/************************************************************************
** Module: Scope
/** **********************************************************************
** Module: Scope \file scope.h
** Description: This module implements a hierarchical (i.e., scoped)
** symbol table. The symbol table can store definitions of entities,
** types, algorithms, and variables, as well as containing a list
@@ -47,16 +45,11 @@
#define SCOPE_NULL (Scope)0
/************/
/* typedefs */
/************/
/*typedef struct Scope *Scope;*/
/****************/
/* modules used */
/****************/
#include <scl_export.h>
#include "type.h"
#include "variable.h"
#include "entity.h"
@@ -85,14 +78,13 @@
#define SCOPE_FIND_ANYTHING OBJ_ANYTHING_BITS
struct Scope_ {
Symbol symbol;
char type; /* see above */
ClientData clientData; /* user may use this for any purpose */
int search_id; /* key to avoid searching this scope twice */
Dictionary symbol_table;
Symbol symbol;
char type; /* see above */
ClientData clientData; /**< user may use this for any purpose */
int search_id; /**< key to avoid searching this scope twice */
Dictionary symbol_table,enum_table;
struct Scope_ * superscope;
union {
/* struct Constant *constant;*/
struct Procedure_ * proc;
struct Function_ * func;
struct Rule_ * rule;
@@ -101,10 +93,10 @@ struct Scope_ {
struct Express_ * express;
struct Increment_ * incr;
struct TypeHead_ * type;
/* no, query owns a scope rather than scope owning a query */
/* struct Query *query;*/
/* no, query owns a scope rather than scope owning a query
* struct Query *query; */
} u;
Linked_List where; /* optional where clause */
Linked_List where; /**< optional where clause */
};
/********************/
@@ -128,9 +120,6 @@ struct Scope_ {
#define SCOPEget_symbol(scope) (&(scope)->symbol)
#define SCOPEput_name(scope,name) ((scope)->symbol.name = name)
#define SCOPEget_name(scope) ((scope)->symbol.name)
/* get_superscope's' for backward compat */
#define SCOPEget_superscope(scope) ((scope)->superscope)
#define SCOPEget_superscope(scope) ((scope)->superscope)
#define SCOPEget_resolved(scope) ((scope)->symbol.resolved)
#define SCOPEget_clientData(s) ((s)->clientData)
@@ -149,25 +138,10 @@ struct Scope_ {
/* function prototypes */
/***********************/
extern struct Symbol_ * SCOPE_get_symbol PROTO( ( Generic ) );
/*extern struct Scope * SCOPEget_nearest_enclosing_entity PROTO((Scope));*/
extern void SCOPE_get_entities PROTO( ( Scope, Linked_List ) );
extern Linked_List SCOPEget_entities PROTO( ( Scope ) );
extern Linked_List SCOPEget_entities_superclass_order PROTO( ( Scope ) );
extern Generic SCOPEfind PROTO( ( Scope, char *, int ) );
extern SCL_EXPRESS_EXPORT struct Symbol_ * SCOPE_get_symbol PROTO( ( Generic ) );
extern SCL_EXPRESS_EXPORT void SCOPE_get_entities PROTO( ( Scope, Linked_List ) );
extern SCL_EXPRESS_EXPORT Linked_List SCOPEget_entities PROTO( ( Scope ) );
extern SCL_EXPRESS_EXPORT Linked_List SCOPEget_entities_superclass_order PROTO( ( Scope ) );
extern SCL_EXPRESS_EXPORT Generic SCOPEfind PROTO( ( Scope, char *, int ) );
#if 0
extern Linked_List SCOPEget_types PROTO( ( Scope ) );
extern Linked_List SCOPEget_variables PROTO( ( Scope ) );
extern Linked_List SCOPEget_algorithms PROTO( ( Scope ) );
extern Linked_List SCOPEget_constants PROTO( ( Scope ) );
#endif
/********************/
/* inline functions */
/********************/
#if supports_inline_functions || defined(SCOPE_C)
#endif /* supports_inline_functions || defined(SCOPE_C) */
#endif /* SCOPE_H */
+35 -44
View File
@@ -1,10 +1,8 @@
#ifndef STATEMENT_H
#define STATEMENT_H
/* $Id: stmt.h,v 1.3 1997/01/21 19:17:11 dar Exp $ */
/************************************************************************
** Module: Statement
/** **********************************************************************
** Module: Statement \file stmt.h
** Description: This module implements the Statement abstraction. A
** statement is, in effect, a typeless Expression. Due to the
** existence of complex language constructs, however, it often is
@@ -50,6 +48,7 @@
/* packages used */
/*****************/
#include <scl_export.h>
#include "expbasic.h" /* get basic definitions */
#include "scope.h"
@@ -94,9 +93,8 @@ typedef struct Scope_ * Increment;
/* these should probably all be expression types */
struct Statement_ {
Symbol symbol; /* can hold pcall or alias name */
/* but otherwise is not used for anything */
int type; /* one of STMT_XXX above */
Symbol symbol; /**< can hold pcall or alias name but otherwise is not used for anything */
int type; /**< one of STMT_XXX above */
/* hey, is there nothing in common beside symbol and private data?? */
union u_statement {
struct Alias_ * alias;
@@ -114,7 +112,7 @@ struct Statement_ {
struct Alias_ {
struct Scope_ * scope;
struct Variable_ * variable;
Linked_List statements; /* list of statements */
Linked_List statements; /**< list of statements */
};
struct Assignment_ {
@@ -133,18 +131,18 @@ struct Compound_Statement_ {
struct Conditional_ {
Expression test;
Linked_List code; /* list of statements */
Linked_List otherwise; /* list of statements */
Linked_List code; /**< list of statements */
Linked_List otherwise; /**< list of statements */
};
struct Loop_ {
struct Scope_ * scope; /* scope for increment control */
struct Scope_ * scope; /**< scope for increment control */
Expression while_expr;
Expression until_expr;
Linked_List statements; /* list of statements */
Linked_List statements; /**< list of statements */
};
/* this is an element in the optional Loop scope */
/** this is an element in the optional Loop scope */
struct Increment_ {
Expression init;
Expression end;
@@ -153,7 +151,7 @@ struct Increment_ {
struct Procedure_Call_ {
struct Scope_ * procedure;
Linked_List parameters; /* list of expressions */
Linked_List parameters; /**< list of expressions */
};
struct Return_Statement_ {
@@ -172,20 +170,20 @@ struct Return_Statement_ {
#include "decstart.h"
#endif /*STATEMENT_C*/
GLOBAL struct freelist_head STMT_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head STMT_fl;
GLOBAL struct freelist_head ALIAS_fl;
GLOBAL struct freelist_head ASSIGN_fl;
GLOBAL struct freelist_head CASE_fl;
GLOBAL struct freelist_head COMP_STMT_fl;
GLOBAL struct freelist_head COND_fl;
GLOBAL struct freelist_head LOOP_fl;
GLOBAL struct freelist_head PCALL_fl;
GLOBAL struct freelist_head RET_fl;
GLOBAL struct freelist_head INCR_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head ALIAS_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head ASSIGN_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head CASE_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head COMP_STMT_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head COND_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head LOOP_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head PCALL_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head RET_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head INCR_fl;
GLOBAL Statement STATEMENT_ESCAPE INITIALLY( STATEMENT_NULL );
GLOBAL Statement STATEMENT_SKIP INITIALLY( STATEMENT_NULL );
GLOBAL SCL_EXPRESS_EXPORT Statement STATEMENT_ESCAPE INITIALLY( STATEMENT_NULL );
GLOBAL SCL_EXPRESS_EXPORT Statement STATEMENT_SKIP INITIALLY( STATEMENT_NULL );
#include "de_end.h"
@@ -235,24 +233,17 @@ GLOBAL Statement STATEMENT_SKIP INITIALLY( STATEMENT_NULL );
/* function prototypes */
/***********************/
extern Statement STMTcreate PROTO( ( int ) );
extern Statement ALIAScreate PROTO( ( struct Scope_ *, Variable, Linked_List ) );
extern Statement CASEcreate PROTO( ( Expression , Linked_List ) );
extern Statement ASSIGNcreate PROTO( ( Expression , Expression ) );
extern Statement COMP_STMTcreate PROTO( ( Linked_List ) );
extern Statement CONDcreate PROTO( ( Expression, Linked_List, Linked_List ) );
extern Statement LOOPcreate PROTO( ( struct Scope_ *, Expression, Expression, Linked_List ) );
extern Statement PCALLcreate PROTO( ( Linked_List ) );
extern Statement RETcreate PROTO( ( Expression ) );
extern void STMTinitialize PROTO( ( void ) );
extern struct Scope_ * INCR_CTLcreate PROTO( ( Symbol *, Expression start,
extern SCL_EXPRESS_EXPORT Statement STMTcreate PROTO( ( int ) );
extern SCL_EXPRESS_EXPORT Statement ALIAScreate PROTO( ( struct Scope_ *, Variable, Linked_List ) );
extern SCL_EXPRESS_EXPORT Statement CASEcreate PROTO( ( Expression , Linked_List ) );
extern SCL_EXPRESS_EXPORT Statement ASSIGNcreate PROTO( ( Expression , Expression ) );
extern SCL_EXPRESS_EXPORT Statement COMP_STMTcreate PROTO( ( Linked_List ) );
extern SCL_EXPRESS_EXPORT Statement CONDcreate PROTO( ( Expression, Linked_List, Linked_List ) );
extern SCL_EXPRESS_EXPORT Statement LOOPcreate PROTO( ( struct Scope_ *, Expression, Expression, Linked_List ) );
extern SCL_EXPRESS_EXPORT Statement PCALLcreate PROTO( ( Linked_List ) );
extern SCL_EXPRESS_EXPORT Statement RETcreate PROTO( ( Expression ) );
extern SCL_EXPRESS_EXPORT void STMTinitialize PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT struct Scope_ * INCR_CTLcreate PROTO( ( Symbol *, Expression start,
Expression end, Expression increment ) );
/********************/
/* inline functions */
/********************/
#if supports_inline_functions || defined(STATEMENT_C)
#endif /* supports_inline_functions || defined(STATEMENT_C) */
#endif /*STATEMENT_H*/
+6 -18
View File
@@ -1,10 +1,8 @@
#ifndef SYMBOL_H
#define SYMBOL_H
/* $Id: symbol.h,v 1.8 1997/01/21 19:17:11 dar Exp $ */
/************************************************************************
** Module: Symbol
/** **********************************************************************
** Module: Symbol \file symbol.h
** Description: This module implements the Symbol abstraction.
** Constants:
** SYMBOL_NULL - the null Symbol
@@ -45,9 +43,7 @@
/* packages used */
/*****************/
#ifdef SYMBOL_C
#endif /* SYMBOL_C */
#include <scl_export.h>
#include "basic.h" /* get basic definitions */
#include "memory.h"
@@ -82,7 +78,7 @@ struct Symbol_ {
#include "decstart.h"
#endif /* SYMBOL_C */
GLOBAL struct freelist_head SYMBOL_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head SYMBOL_fl;
#include "de_end.h"
@@ -95,21 +91,13 @@ GLOBAL struct freelist_head SYMBOL_fl;
#define SYMBOLset(obj) obj->symbol.line = yylineno; \
obj->symbol.filename = current_filename
/* for backwards compatibility only, no one should ever need this */
#define SYMBOLget_name(sym) ((sym)->name)
/***********************/
/* function prototypes */
/***********************/
extern void SYMBOLinitialize PROTO( ( void ) );
Symbol * SYMBOLcreate PROTO( ( char *, int, char * ) );
extern SCL_EXPRESS_EXPORT void SYMBOLinitialize( void );
SCL_EXPRESS_EXPORT Symbol * SYMBOLcreate( char * name, int line, char * filename );
/********************/
/* inline functions */
/********************/
#if supports_inline_functions || defined(SYMBOL_C)
#endif /* supports_inline_functions || defined(SYMBOL_C) */
#endif /* SYMBOL_H */
+80 -142
View File
@@ -1,10 +1,8 @@
#ifndef TYPE_H
#define TYPE_H
/* $Id: type.h,v 1.14 1997/09/19 18:25:10 dar Exp $ */
/************************************************************************
** Module: Type
/** **********************************************************************
** Module: Type \file type.h
** Description: This module implements the type abstraction. It is
** rather unpleasant, since this abstraction is quite well suited
** to an object-oriented environment with inheritance.
@@ -55,16 +53,16 @@
/*************/
#define TYPE_NULL (Type)0
/* since we can't evaluate true size of many aggregates, prepare */
/* to grow them by chunks of this size */
/** since we can't evaluate true size of many aggregates,
* prepare to grow them by chunks of this size */
#define AGGR_CHUNK_SIZE 30
/* these are all orthogonal types */
/** these are all orthogonal types */
enum type_enum {
unknown_ = 0, /* 0 catches uninit. errors */
special_, /* placeholder, given meaning by it's owner, */
/* such as Type_Dont_Care, Type_Bad, Type_User_Def */
runtime_, /* cannot be further determined until runtime */
unknown_ = 0, /**< 0 catches uninit. errors */
special_, /**< placeholder, given meaning by it's owner, such as Type_Dont_Care, Type_Bad, Type_User_Def */
runtime_, /**< cannot be further determined until runtime */
integer_,
real_,
string_,
@@ -77,32 +75,29 @@ enum type_enum {
generic_,
/* aggregates */
aggregate_, /* as a formal */
aggregate_, /**< as a formal */
array_,
bag_,
set_,
list_,
last_aggregate_,/* not real, just for easier computation */
last_aggregate_,/**< not real, just for easier computation */
oneof_,
/* while they are really used for different */
/* purposes, it might be worth considering */
/* collapsing entity_ and entity_list_ */
entity_, /* single entity */
entity_list_, /* linked list of entities */
/** while they are really used for different purposes, it might be worth considering collapsing entity_ and entity_list_ */
entity_, /**< single entity */
entity_list_, /**< linked list of entities */
enumeration_,
select_,
reference_, /* something only defined by a base type, i.e., a */
/* type reference */
reference_, /**< something only defined by a base type, i.e., a type reference */
query_,
op_, /* something with an operand */
inverse_, /* is? an inverse */
op_, /**< something with an operand */
inverse_, /**< is? an inverse */
identifier_, /* simple identifier in an expression */
attribute_, /* attribute reference (i.e., expr->u.variable) */
derived_,/*?*/
funcall_, /* a function call and actual parameters */
identifier_, /**< simple identifier in an expression */
attribute_, /**< attribute reference (i.e., expr->u.variable) */
derived_, /**< ?*/
funcall_, /**< a function call and actual parameters */
self_
};
@@ -111,53 +106,25 @@ enum type_enum {
/* packages used */
/*****************/
#include <scl_export.h>
#include "expbasic.h" /* get basic definitions */
#include "symbol.h"
#include "object.h"
/*#include "scope.h"*/
/************/
/* typedefs */
/************/
/*typedef struct Scope *Type;*/
typedef struct TypeHead_ * TypeHead;
typedef struct TypeBody_ * TypeBody;
typedef enum type_enum TypeType;
/* following are all for backwards compatibility - not otherwise necessary */
typedef Type Aggregate_Type, Composed_Type, Sized_Type, Type_Reference;
typedef Aggregate_Type Array_Type, List_Type, Bag_Type;
typedef Bag_Type Set_Type;
typedef Composed_Type Entity_Type, Enumeration_Type, Select_Type;
typedef Sized_Type Integer_Type, Real_Type, String_Type, Binary_Type;
/* provide a replacement for Class */
typedef enum type_enum Class_Of_Type;
typedef enum type_enum Class;
#define OBJget_class(typ) ((typ)->u.type->body->type)
#define CLASSinherits_from TYPEinherits_from
/* backwards compatibility */
#define Class_Integer_Type integer_
#define Class_Number_Type number_
#define Class_Real_Type real_
#define Class_Entity_Type entity_
#define Class_Entity_List_Type entity_list_
#define Class_Enumeration_Type enumeration_
#define Class_Boolean_Type boolean_
#define Class_Logical_Type logical_
#define Class_Binary_Type binary_
#define Class_String_Type string_
#define Class_Array_Type array_
#define Class_List_Type list_
#define Class_Set_Type set_
#define Class_Bag_Type bag_
#define Class_Generic_Type generic_
#define Class_Select_Type select_
#define Class_Reference_Type reference_
#define Class_Aggregate_Type aggregate_
/****************/
/* modules used */
/****************/
@@ -172,9 +139,8 @@ typedef enum type_enum Class;
/***************************/
struct TypeHead_ {
Type head; /* if we are a defined type */
/* this is who we point to */
struct TypeBody_ * body; /* true type, ignoring defined types */
Type head; /**< if we are a defined type this is who we point to */
struct TypeBody_ * body; /**< true type, ignoring defined types */
#if 0
/* if we are concerned about memory (over time) uncomment this and */
/* other references to refcount in parser and TYPEresolve. It is */
@@ -185,30 +151,25 @@ struct TypeHead_ {
struct TypeBody_ {
#if 1
struct TypeHead_ * head; /* for debugging only */
struct TypeHead_ * head; /**< for debugging only */
#endif
enum type_enum type; /* bits describing this type, int, real, etc */
enum type_enum type; /**< bits describing this type, int, real, etc */
struct {
unsigned unique : 1;
unsigned optional : 1;
unsigned fixed : 1;
unsigned shared : 1; /* type is shared */
unsigned repeat : 1; /* expression is a repeat count*/
unsigned encoded : 1; /* encoded string */
unsigned shared : 1; /**< type is shared */
unsigned repeat : 1; /**< expression is a repeat count*/
unsigned encoded : 1; /**< encoded string */
} flags;
Type base; /* underlying base type if any */
/* can also contain true type if this type */
/* is a type reference */
Type tag; /* optional tag */
Type base; /**< underlying base type if any can also contain true type if this type is a type reference */
Type tag; /**< optional tag */
/* a lot of the stuff below can be unionized */
Expression precision;
Linked_List list; /* used by select_types */
/* and composed types, such as for a */
/* list of entities in an instance */
/* Dictionary enumeration; *//* only used by enumerations */
Linked_List list; /**< used by select_types and composed types, such as for a list of entities in an instance */
Expression upper;
Expression lower;
struct Scope_ * entity; /* only used by entity types */
struct Scope_ * entity; /**< only used by entity types */
};
/********************/
@@ -223,41 +184,41 @@ struct TypeBody_ {
/* Very commonly-used read-only types */
/* non-constant versions probably aren't necessary? */
GLOBAL Type Type_Bad;
GLOBAL Type Type_Unknown;
GLOBAL Type Type_Dont_Care;
GLOBAL Type Type_Runtime; /* indicates that this object can't be */
/* calculated now but must be deferred */
/* til (the mythical) runtime */
GLOBAL Type Type_Binary;
GLOBAL Type Type_Boolean;
GLOBAL Type Type_Enumeration;
GLOBAL Type Type_Expression;
GLOBAL Type Type_Aggregate;
GLOBAL Type Type_Integer;
GLOBAL Type Type_Integer;
GLOBAL Type Type_Number;
GLOBAL Type Type_Real;
GLOBAL Type Type_String;
GLOBAL Type Type_String_Encoded;
GLOBAL Type Type_Logical;
GLOBAL Type Type_Set;
GLOBAL Type Type_Attribute;
GLOBAL Type Type_Entity;
GLOBAL Type Type_Funcall;
GLOBAL Type Type_Generic;
GLOBAL Type Type_Identifier;
GLOBAL Type Type_Oneof;
GLOBAL Type Type_Query;
GLOBAL Type Type_Self;
GLOBAL Type Type_Set_Of_String;
GLOBAL Type Type_Set_Of_Generic;
GLOBAL Type Type_Bag_Of_Generic;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Bad;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Unknown;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Dont_Care;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Runtime; /**< indicates that this object can't be
calculated now but must be deferred
until (the mythical) runtime */
GLOBAL SCL_EXPRESS_EXPORT Type Type_Binary;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Boolean;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Enumeration;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Expression;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Aggregate;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Integer;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Integer;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Number;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Real;
GLOBAL SCL_EXPRESS_EXPORT Type Type_String;
GLOBAL SCL_EXPRESS_EXPORT Type Type_String_Encoded;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Logical;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Set;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Attribute;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Entity;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Funcall;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Generic;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Identifier;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Oneof;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Query;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Self;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Set_Of_String;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Set_Of_Generic;
GLOBAL SCL_EXPRESS_EXPORT Type Type_Bag_Of_Generic;
GLOBAL struct freelist_head TYPEHEAD_fl;
GLOBAL struct freelist_head TYPEBODY_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head TYPEHEAD_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head TYPEBODY_fl;
GLOBAL Error ERROR_corrupted_type INITIALLY( ERROR_none );
GLOBAL SCL_EXPRESS_EXPORT Error ERROR_corrupted_type INITIALLY( ERROR_none );
#include "de_end.h"
@@ -274,12 +235,13 @@ GLOBAL Error ERROR_corrupted_type INITIALLY( ERROR_none );
#define TYPEis_identifier(t) ((t)->u.type->body->type == identifier_)
#define TYPEis_logical(t) ((t)->u.type->body->type == logical_)
#define TYPEis_boolean(t) ((t)->u.type->body->type == boolean_)
#define TYPEis_real(t) ((t)->u.type->body->type == real_)
#define TYPEis_integer(t) ((t)->u.type->body->type == integer_)
#define TYPEis_string(t) ((t)->u.type->body->type == string_)
#define TYPEis_expression(t) ((t)->u.type->body->type == op_)
#define TYPEis_oneof(t) ((t)->u.type->body->type == oneof_)
#define TYPEis_entity(t) ((t)->u.type->body->type == entity_)
#define TYPEis_enumeration(t) ((t)->u.type->body->type == enumeration_)
/*#define TYPEis_aggregate(t) ((t)->u.type->body->type >= aggregate_ && (t)->u.type->body->type < last_aggregate_)*/
#define TYPEis_aggregate(t) ((t)->u.type->body->base)
#define TYPEis_aggregate_raw(t) ((t)->u.type->body->type == aggregate_)
#define TYPEis_array(t) ((t)->u.type->body->type == array_)
@@ -315,7 +277,6 @@ GLOBAL Error ERROR_corrupted_type INITIALLY( ERROR_none );
#define COMP_TYPEput_items(t,lis) ((t)->u.type->body->list = (lis))
#define COMP_TYPEadd_items(t,lis) LISTadd_all((t)->u.type->body->list, (lis));
/*#define ENUM_TYPEput_items(type,list) COMP_TYPEput_items(type, list)*/
#define ENUM_TYPEget_items(t) ((t)->symbol_table)
#define TYPEget_optional(t) ((t)->u.type->body->flags.optional)
#define TYPEget_unique(t) ((t)->u.type->body->flags.unique)
@@ -328,9 +289,6 @@ GLOBAL Error ERROR_corrupted_type INITIALLY( ERROR_none );
#define TYPEget_enum_tags(t) ((t)->symbol_table)
/* for backwards compatibility */
#define AGGR_TYPEget_base_type TYPEget_base_type
#define TYPEget_clientData(t) ((t)->clientData)
#define TYPEput_clientData(t,d) ((t)->clientData = (d))
@@ -338,40 +296,20 @@ GLOBAL Error ERROR_corrupted_type INITIALLY( ERROR_none );
/* function prototypes */
/***********************/
extern Type TYPEcreate_partial PROTO( ( struct Symbol_ *, Scope ) );
extern SCL_EXPRESS_EXPORT Type TYPEcreate_partial PROTO( ( struct Symbol_ *, Scope ) );
extern Type TYPEcreate PROTO( ( enum type_enum ) );
extern Type TYPEcreate_from_body_anonymously PROTO( ( TypeBody ) );
extern Type TYPEcreate_name PROTO( ( struct Symbol_ * ) );
extern Type TYPEcreate_nostab PROTO( ( struct Symbol_ *, Scope, char ) );
/*extern Type TYPEcreate_typedef PROTO((Type, TypeBody,
Scope,struct Symbol *));*/
extern TypeBody TYPEBODYcreate PROTO( ( enum type_enum ) );
/*extern Type TYPEcopy_shallow PROTO((Type));*/
extern void TYPEinitialize PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT Type TYPEcreate PROTO( ( enum type_enum ) );
extern SCL_EXPRESS_EXPORT Type TYPEcreate_from_body_anonymously PROTO( ( TypeBody ) );
extern SCL_EXPRESS_EXPORT Type TYPEcreate_name PROTO( ( struct Symbol_ * ) );
extern SCL_EXPRESS_EXPORT Type TYPEcreate_nostab PROTO( ( struct Symbol_ *, Scope, char ) );
extern SCL_EXPRESS_EXPORT TypeBody TYPEBODYcreate PROTO( ( enum type_enum ) );
extern SCL_EXPRESS_EXPORT void TYPEinitialize PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT void TYPEcleanup PROTO( ( void ) );
#if 0
extern Dictionary TYPEget_enum_tags PROTO( ( Type ) );
#endif
extern bool TYPEinherits_from PROTO( ( Type, enum type_enum ) );
extern Type TYPEget_nonaggregate_base_type PROTO( ( Type ) );
extern SCL_EXPRESS_EXPORT bool TYPEinherits_from PROTO( ( Type, enum type_enum ) );
extern SCL_EXPRESS_EXPORT Type TYPEget_nonaggregate_base_type PROTO( ( Type ) );
extern Type TYPEcreate_user_defined_type PROTO( ( Type, Scope, struct Symbol_ * ) );
extern Type TYPEcreate_user_defined_tag PROTO( ( Type, Scope, struct Symbol_ * ) );
#if 0
extern int TYPEget_size PROTO( ( Type ) );
extern bool TYPEcompatible PROTO( ( Type, Type ) );
extern Expression SZD_TYPEget_precision PROTO( ( Sized_Type ) );
extern bool SZD_TYPEget_varying PROTO( ( Sized_Type ) );
extern Expression TYPE_REFget_full_name PROTO( ( Type_Reference * ) );
#endif /*0*/
/********************/
/* inline functions */
/********************/
#if supports_inline_functions || defined(TYPE_C)
#endif /* supports_inline_functions || defined(TYPE_C) */
extern SCL_EXPRESS_EXPORT Type TYPEcreate_user_defined_type PROTO( ( Type, Scope, struct Symbol_ * ) );
extern SCL_EXPRESS_EXPORT Type TYPEcreate_user_defined_tag PROTO( ( Type, Scope, struct Symbol_ * ) );
#endif /* TYPE_H */
+18 -50
View File
@@ -1,10 +1,8 @@
#ifndef VARIABLE_H
#define VARIABLE_H
/* $Id: variable.h,v 1.10 1997/01/21 19:17:11 dar Exp $ */
/************************************************************************
** Module: Variable
/** **********************************************************************
** Module: Variable \file variable.h
** Description: This module implements the Variable abstraction. A
** Variable consists of a name, a type, a reference class, and
** some flags, e.g. 'optional', 'variable'. It is used to represent
@@ -78,26 +76,23 @@ typedef struct Variable_ * Variable;
/***************************/
struct Variable_ {
/* Symbol is inside of 'name' below */
Expression name;
Type type;
Expression initializer; /* or 'derived' */
int offset;
Expression name; /**< Symbol is inside of 'name' below */
Type type;
Expression initializer; /**< or 'derived' */
int offset;
struct {
int optional : 1; /* OPTIONAL keyword */
int var : 1; /* VAR keyword */
int constant : 1; /* from CONSTANT...END_CONSTANT */
int unique : 1; /* appears in UNIQUE list */
int parameter : 1; /* is a formal parameter */
int attribute : 1; /* is an attribute (rule parameters */
/* are marked this way, too) */
int optional : 1; /**< OPTIONAL keyword */
int var : 1; /**< VAR keyword */
int constant : 1; /**< from CONSTANT...END_CONSTANT */
int unique : 1; /**< appears in UNIQUE list */
int parameter : 1; /**< is a formal parameter */
int attribute : 1; /**< is an attribute (rule parameters are marked this way, too) */
} flags;
#define query_symbol inverse_symbol
Symbol * inverse_symbol; /* entity symbol */
Variable inverse_attribute; /* attribute related by */
/* inverse relationship */
Symbol * inverse_symbol; /**< entity symbol */
Variable inverse_attribute; /**< attribute related by inverse relationship */
};
/********************/
@@ -110,7 +105,7 @@ struct Variable_ {
#include "decstart.h"
#endif /* VARIABLE_C */
GLOBAL struct freelist_head VAR_fl;
GLOBAL SCL_EXPRESS_EXPORT struct freelist_head VAR_fl;
#include "de_end.h"
@@ -133,40 +128,13 @@ GLOBAL struct freelist_head VAR_fl;
#define VARis_derived(v) ((v)->initializer != 0)
#define VARget_inverse(v) ((v)->inverse_attribute)
/* for backwards compatibility */
#define VARget_derived VARis_derived
/***********************/
/* function prototypes */
/***********************/
extern Variable VARcreate PROTO( ( Expression, Type ) );
extern void VARinitialize PROTO( ( void ) );
extern char * VARget_simple_name PROTO( ( Variable ) );
#if 0
extern void VARput_type PROTO( ( Variable *, Type ) );
extern void VARput_initializer PROTO( ( Variable *, Expression ) );
extern void VARput_derived PROTO( ( Variable *, Boolean ) );
extern void VARput_optional PROTO( ( Variable *, Boolean ) );
extern void VARput_variable PROTO( ( Variable *, Boolean ) );
extern void VARput_reference PROTO( ( Variable *, Expression ) );
/*Mextern void VARput_offset PROTO((Variable *, int));*/
extern void VARput_inverse PROTO( ( Variable *, Symbol * ) );
/*M extern Type VARget_type PROTO((Variable *));*/
/*Mextern Boolean VARget_derived PROTO((Variable *));*/
extern Boolean VARget_optional PROTO( ( Variable * ) );
extern Boolean VARget_variable PROTO( ( Variable * ) );
extern Expression VARget_reference PROTO( ( Variable * ) );
/*Mextern int VARget_offset PROTO((Variable *));*/
#endif /*0*/
/********************/
/* inline functions */
/********************/
#if supports_inline_functions || defined(VARIABLE_C)
#endif /* supports_inline_functions || defined(VARIABLE_C) */
extern SCL_EXPRESS_EXPORT Variable VARcreate PROTO( ( Expression, Type ) );
extern SCL_EXPRESS_EXPORT void VARinitialize PROTO( ( void ) );
extern SCL_EXPRESS_EXPORT char * VARget_simple_name PROTO( ( Variable ) );
#endif /* VARIABLE_H */
+18 -2
View File
@@ -1,13 +1,29 @@
#ifndef SCL_CF_H
#define SCL_CF_H
/**** Define statements for CMake ****/
#cmakedefine HAVE_NDIR_H 1
#cmakedefine HAVE_STDARG_H 1
#cmakedefine HAVE_SYS_STAT_H 1
#cmakedefine HAVE_SYS_PARAM_H 1
#cmakedefine HAVE_SYSENT_H 1
#cmakedefine HAVE_UNISTD_H 1
#cmakedefine HAVE_DIRENT_H 1
#cmakedefine HAVE_STDBOOL_H 1
#cmakedefine HAVE_PROCESS_H 1
#cmakedefine HAVE_IO_H 1
#cmakedefine YYTEXT_POINTER 1
#cmakedefine SCL_TRACE_FPRINTF 1
#cmakedefine SCL_MEMMGR_ENABLE_CHECKS 1
#cmakedefine HAVE_ABS 1
#cmakedefine HAVE_MEMCPY 1
#cmakedefine HAVE_MEMMOVE 1
#cmakedefine HAVE_GETOPT 1
#cmakedefine HAVE_SSIZE_T 1
//cmake updates this at build time
#define SCL_COMMIT_ID "@GIT_COMMIT_ID@"
#cmakedefine HAVE_STD_THREAD 1
#endif /* SCL_CF_H */
+95
View File
@@ -0,0 +1,95 @@
#ifndef SCL_EXPORT_H
#define SCL_EXPORT_H
/* Import/Export flags for base. */
#ifndef SCL_BASE_EXPORT
# if defined(SCL_BASE_DLL_EXPORTS) && defined(SCL_BASE_DLL_IMPORTS)
# error "Only SCL_BASE_DLL_EXPORTS or SCL_BASE_DLL_IMPORTS can be defined, not both."
# elif defined(SCL_BASE_DLL_EXPORTS)
# define SCL_BASE_EXPORT __declspec(dllexport)
# elif defined(SCL_BASE_DLL_IMPORTS)
# define SCL_BASE_EXPORT __declspec(dllimport)
# else
# define SCL_BASE_EXPORT
# endif
#endif
/* Import/Export flags for express. */
#ifndef SCL_EXPRESS_EXPORT
# if defined(SCL_EXPRESS_DLL_EXPORTS) && defined(SCL_EXPRESS_DLL_IMPORTS)
# error "Only SCL_EXPRESS_DLL_EXPORTS or SCL_EXPRESS_DLL_IMPORTS can be defined, not both."
# elif defined(SCL_EXPRESS_DLL_EXPORTS)
# define SCL_EXPRESS_EXPORT __declspec(dllexport)
# elif defined(SCL_EXPRESS_DLL_IMPORTS)
# define SCL_EXPRESS_EXPORT __declspec(dllimport)
# else
# define SCL_EXPRESS_EXPORT
# endif
#endif
/* Import/Export flags for exppp. */
#ifndef SCL_EXPPP_EXPORT
# if defined(SCL_EXPPP_DLL_EXPORTS) && defined(SCL_EXPPP_DLL_IMPORTS)
# error "Only SCL_EXPPP_DLL_EXPORTS or SCL_EXPPP_DLL_IMPORTS can be defined, not both."
# elif defined(SCL_EXPPP_DLL_EXPORTS)
# define SCL_EXPPP_EXPORT __declspec(dllexport)
# elif defined(SCL_EXPPP_DLL_IMPORTS)
# define SCL_EXPPP_EXPORT __declspec(dllimport)
# else
# define SCL_EXPPP_EXPORT
# endif
#endif
/* Import/Export flags for utils. */
#ifndef SCL_UTILS_EXPORT
# if defined(SCL_UTILS_DLL_EXPORTS) && defined(SCL_UTILS_DLL_IMPORTS)
# error "Only SCL_UTILS_DLL_EXPORTS or SCL_UTILS_DLL_IMPORTS can be defined, not both."
# elif defined(SCL_UTILS_DLL_EXPORTS)
# define SCL_UTILS_EXPORT __declspec(dllexport)
# elif defined(SCL_UTILS_DLL_IMPORTS)
# define SCL_UTILS_EXPORT __declspec(dllimport)
# else
# define SCL_UTILS_EXPORT
# endif
#endif
/* Import/Export flags for dai. */
#ifndef SCL_DAI_EXPORT
# if defined(SCL_DAI_DLL_EXPORTS) && defined(SCL_DAI_DLL_IMPORTS)
# error "Only SCL_DAI_DLL_EXPORTS or SCL_DAI_DLL_IMPORTS can be defined, not both."
# elif defined(SCL_DAI_DLL_EXPORTS)
# define SCL_DAI_EXPORT __declspec(dllexport)
# elif defined(SCL_DAI_DLL_IMPORTS)
# define SCL_DAI_EXPORT __declspec(dllimport)
# else
# define SCL_DAI_EXPORT
# endif
#endif
/* Import/Export flags for core. */
#ifndef SCL_CORE_EXPORT
# if defined(SCL_CORE_DLL_EXPORTS) && defined(SCL_CORE_DLL_IMPORTS)
# error "Only SCL_CORE_DLL_EXPORTS or SCL_CORE_DLL_IMPORTS can be defined, not both."
# elif defined(SCL_CORE_DLL_EXPORTS)
# define SCL_CORE_EXPORT __declspec(dllexport)
# elif defined(SCL_CORE_DLL_IMPORTS)
# define SCL_CORE_EXPORT __declspec(dllimport)
# else
# define SCL_CORE_EXPORT
# endif
#endif
/* Import/Export flags for editor. */
#ifndef SCL_EDITOR_EXPORT
# if defined(SCL_EDITOR_DLL_EXPORTS) && defined(SCL_EDITOR_DLL_IMPORTS)
# error "Only SCL_EDITOR_DLL_EXPORTS or SCL_EDITOR_DLL_IMPORTS can be defined, not both."
# elif defined(SCL_EDITOR_DLL_EXPORTS)
# define SCL_EDITOR_EXPORT __declspec(dllexport)
# elif defined(SCL_EDITOR_DLL_IMPORTS)
# define SCL_EDITOR_EXPORT __declspec(dllimport)
# else
# define SCL_EDITOR_EXPORT
# endif
#endif
#endif /* SCL_EXPORT_H */
+54
View File
@@ -0,0 +1,54 @@
#ifndef STDBOOL_H_
#define STDBOOL_H_
/**
* stdbool.h - ISO C99 Boolean type
* Author - Bill Chatfield
* E-mail - bill underscore chatfield at yahoo dot com
* Copyright - You are free to use for any purpose except illegal acts
* Warrenty - None: don't blame me if it breaks something
*
* In ISO C99, stdbool.h is a standard header and _Bool is a keyword, but
* some compilers don't offer these yet. This header file is an
* implementation of the standard ISO C99 stdbool.h header file. It checks
* for various compiler versions and defines things that are missing in
* those versions.
*
* The GNU and Watcom compilers include a stdbool.h, but the Borland
* C/C++ 5.5.1 compiler and the Microsoft compilers do not.
*
* See http://predef.sourceforge.net/precomp.html for compile macros.
*/
#ifndef __cplusplus
/**
* Borland C++ 5.5.1 does not define _Bool.
*/
#if defined(__BORLANDC__) && __BORLANDC__ < 0x630
typedef int _Bool;
#endif
/**
* Microsoft C/C++ version 14.00.50727.762, which comes with Visual C++ 2005,
* and version 15.00.30729.01, which comes with Visual C++ 2008, do not
* define _Bool.
*/
#if defined(_MSC_VER)
typedef int _Bool;
#endif
/**
* Define the Boolean macros only if they are not already defined.
*/
#ifndef __bool_true_false_are_defined
#define bool _Bool
#define Boolean _Bool
#define false 0
#define true 1
#define __bool_true_false_are_defined 1
#endif
#endif /* __cplusplus */
#endif /*STDBOOL_H_*/
-245
View File
@@ -1,245 +0,0 @@
#ifndef SCLPREFIXES_H
#define SCLPREFIXES_H
/* **********************
The macro SCLP23_NAME is used in header files and for constructor/destructor
class function names in corresponding .cc files.
The macro SCLP23 is used everywhere else.
********************* */
// *note* Currently the IDL generated code is not in a namespace.
//#undef NO_P26_NAMESPACE
//#define NO_P26_NAMESPACE 1
// P stands for Part (yeah, it's just to make it short & unique - hopefully)
// as in Part 23 or Part 26.
#ifdef PART26 // SCL's Part 23 is providing the implementation for the Part 26
// Orbix-generated software interface.
// The namespace is specified to be SDAI by Part 26 and Part 23
// Since Part 23 and Part 26 defined objects are suppose to have the same
// names and are supposed to be defined in a namespace called SDAI, define
// the namespaces names for Part 23 and 26 to be different (to avoid conflict)
// This is the namespace for SCL's Part 23 SDAI.
#define P23_NAMESPACE P23
// Whenever you have something like P23_NAMESPACE##_name the preprocessor
// does the concatenation first then substitutes things. Thus you get
// P23_NAMESPACE_name instead of <whatever P23_NAMESPACE is>_name. If you
// call P23_NAMESPACE_F() like P23_NAMESPACE_F(_name) you get
// whatever P23_NAMESPACE is>_name like you want. The user never has to
// use this macro. It is used in the definition of macros the user uses like
// SCLP23() and SCLP23_NAME().
#define P23_NAMESPACE_F(x) P23##x
// This was used by the ITI code. It holds the same meaning as P23_NAMESPACE
#define IMP_NAMESPACE P23_NAMESPACE
#define IMP_NAMESPACE_F(x) P23_NAMESPACE_F(x)
// as defined by original ITI code
// #define IMP_NAMESPACE P26_SDAI
// This is the namespace used by the IDL generated code implementing Part 26.
//
// define NO_P26_NAMESPACE if you are not going to define an encapsulating
// module in the idl. If you define a module named SDAI then you will have to
// refer to the class for interface PID (e.g.) as SDAI::PID and you will have
// to refer to the macros as DEF_TIE_SDAI_PID() and TIE_SDAI_PID() instead of
// DEF_TIE_PID() and TIE_PID(). DEF_TIE_IDL_MODULE() and TIE_IDL_MODULE()
// handle this problem in the code.
// You should define P26_NAMESPACE the same as the name you use for the idl
// module. Without a module you should define NO_P26_NAMESPACE
//
// DEF_TIE_IDL_MODULE handles the DEF_TIE macro depending on whether a module
// name was used in the idl. e.g. for class/interface named PID
//#define SDAI_DEF_TIE_PID(X) DEF_TIE_IDL_MODULE(PID,X)
// replaces either of these two stmts in your code depending on whether a
// module name SDAI was used.
//#define SDAI_DEF_TIE_PID(X) DEF_TIE_PID(X)
//#define SDAI_DEF_TIE_PID(X) DEF_TIE_SDAI_PID(X)
//
// TIE_IDL_MODULE handles the TIE macro depending on whether a module
// name was used in the idl. e.g. for class/interface named PID
//#define _SDAI_TIE_PID_(X) TIE_IDL_MODULE(PID,X)
// replaces either of these two stmts in your code depending on whether a
// module name SDAI was used.
//#define _SDAI_TIE_PID_(X) TIE_PID(X)
//#define _SDAI_TIE_PID_(X) TIE_SDAI_PID(X)
#ifdef NO_P26_NAMESPACE
#define P26_NAMESPACE
#define P26_NAMESPACE_F(x) x
#define DEF_TIE_IDL_MODULE(x,y) DEF_TIE_##x(y)
#define TIE_IDL_MODULE(x,y) TIE_##x(y)
#else
// edit "SDAI" here to match the name of your module
#define P26_NAMESPACE SDAI
#define P26_NAMESPACE_F(x) SDAI##x
#define DEF_TIE_IDL_MODULE(x,y) DEF_TIE_SDAI_##x(y)
#define TIE_IDL_MODULE(x,y) TIE_SDAI_##x(y)
#endif
// This would be the namespace for your application schema.
// This is for the ITI-developed code. It really shouldn't go here - DAS
#define APP_NAMESPACE P26_Simple_geometry
#else // SCL's Part 23 is not providing the implementation for the Part 26
// Orbix-generated software interface.
// This is the namespace for SCL's Part 23 SDAI.
#define P23_NAMESPACE SDAI
#define P23_NAMESPACE_F(x) SDAI##x
// This was used by the ITI code. It holds the same meaning as P23_NAMESPACE
#define IMP_NAMESPACE P23_NAMESPACE
#define IMP_NAMESPACE_F(x) P23_NAMESPACE_F(x)
// as defined by original ITI code
// #define IMP_NAMESPACE SDAI
// This is the namespace used by the IDL generated code implementing Part 26.
// **Note this should never be used if PART26 is not defined.
#define P26_NAMESPACE
#define P26_NAMESPACE_F(x) x
// This would be the namespace for your application schema.
// This is for the ITI-developed code. It really shouldn't go here - DAS
#define APP_NAMESPACE Simple_geometry
#endif
#define CC_NO_NESTED_CLASSES 1
#ifdef CC_NO_NESTED_CLASSES
///////////////////////
// Use this macro to enclose objects generated from IDL interface types.
// i.e. Part 26 based generated types.
// Use this with types that will ONLY ever be Part 26 types. For types
// that can switch use PART22() macro.
// Used with the IDL compiler generated C++ - DAS
#define SCLP26(X) P26_NAMESPACE_F(_##X)
// Used by ITI code to enclose objects generated from IDL interface types.
// This is used for function arguments and return types that need to be
// either the Part 26 version or the Part 23 version depending on whether
// the Part 23 interface is being used standalone or to implement Orbix
// implementation objects using the TIE approach. - DAS
// This one is defined to use the Part 26 defined type for use with Orbix.
#define SCLP22_NAME(X) P26_NAMESPACE_F(_##X)
#define SCLP22(X) P26_NAMESPACE_F(_##X)
// as defined by ITI
// #define SCLP22(X) SDAI_##X
// Use this macro to enclose references to CORBA types.
// Used with the Orbix base C++ types/classes #included via CORBA.h.
// i.e. not used with types/interfaces generated from a users IDL schema.
// DAS
#define CORBA_REF(X) CORBA_##X
// I don't understand why this is necessary - DAS
// Use this macro to enclose references to CORBA Object and Object_ptr
#define SCLP22_BASE(X) CORBA_##X
// SCLP23_NAME is used in header files and for constructor/destructor
// class function names in corresponding .cc files.
// Use this macro to enclose declarations of implementation types.
#define SCLP23_NAME(x) P23_NAMESPACE_F(_##x)
// SCLP23 is used everywhere else.
// Use this macro to enclose uses of Part 23 based (implementation) types.
#define SCLP23(x) P23_NAMESPACE_F(_##x)
// Use this macro to enclose references to implementation types
// whose names have already been qualified
// I don't understand this macros use - DAS
#define SCLP23_SPACE(x) x
// INTEGRATION appmacros here...
#define SCLP22_SIMPLE_GEOMETRY(X) SDAI_Simple_geometry_##X
#define SCLP23_SIMPLE_GEOMETRY_NAME(x) APP_NAMESPACE##_##x
#define SCLP23_SIMPLE_GEOMETRY(x) APP_NAMESPACE##_##x
///////////////////////////////////
#else // nested classes are allowed by the compiler
/////////////////////////////////////
///////////////////////
// Use this macro to enclose objects generated from IDL interface types.
// i.e. Part 26 based generated types.
// Used with the IDL compiler generated C++ - DAS
#ifdef NO_P26_NAMESPACE
#define SCLP26(X) X
#else
#define SCLP26(X) P26_NAMESPACE_F(::##X)
#endif
// Used by ITI code to enclose objects generated from IDL interface types.
// This is used for function arguments and return types that need to be
// either the Part 26 version or the Part 23 version depending on whether
// the Part 23 interface is being used standalone or to implement Orbix
// implementation objects using the TIE approach. - DAS
// This one is defined to use the Part 26 defined type for use with Orbix.
#ifdef NO_P26_NAMESPACE
#define SCLP22_NAME(X) X
#define SCLP22(X) X
#else
#define SCLP22_NAME(X) P26_NAMESPACE_F(::##X)
#define SCLP22(X) P26_NAMESPACE_F(::##X)
#endif
// as defined by ITI
// #define SCLP22(X) SDAI::##X
// Use this macro to enclose references to CORBA types.
// Used with the Orbix base C++ types/classes #included via CORBA.h.
// i.e. not used with types/interfaces generated from a users IDL schema.
// DAS
#define CORBA_REF(X) CORBA::##X
// I don't understand why this is necessary - DAS
// Use this macro to enclose references to CORBA Object and Object_ptr
#define SCLP22_BASE(X) CORBA::##X
// SCLP23_NAME is used in header files and for constructor/destructor
// class function names in corresponding .cc files.
// Use this macro to enclose declarations of implementation types.
#ifdef PART26
#define SCLP23_NAME(x) P23_NAMESPACE_F(_imp##x)
// #define SCLP23_NAME(x) imp##x
#else
#define SCLP23_NAME(x) x
#endif
// SCLP23 is used everywhere else.
// Use this macro to enclose uses of Part 23 based (implementation) types.
#ifdef PART26
#define SCLP23(x) P23_NAMESPACE_F(_imp##x)
// #define SCLP23(x) P23_NAMESPACE_F(::##imp##x)
#else
#define SCLP23(x) P23_NAMESPACE_F(::##x)
#endif
// as defined by ITI
// #define SCLP23(x) IMP_NAMESPACE_F(::imp##x)
// Use this macro to enclose references to implementation types
// whose names have already been qualified
// I don't understand this macros use - DAS
#ifdef PART26
#define SCLP23_SPACE(x) P23_NAMESPACE_F(_imp##x)
// #define SCLP23_SPACE(x) P23_NAMESPACE_F(::##imp##x)
#else
#define SCLP23_SPACE(x) IMP_NAMESPACE_F(::x)
#endif
// INTEGRATION appmacros here...
#define SCLP22_SIMPLE_GEOMETRY(X) SDAI::Simple_geometry::##X
#define SCLP23_SIMPLE_GEOMETRY_NAME(x) imp##x
#define SCLP23_SIMPLE_GEOMETRY(x) APP_NAMESPACE::imp##x
/////////////////////////////////////
#endif
#endif
+31
View File
@@ -0,0 +1,31 @@
// XGetopt.h Version 1.2
//
// Author: Hans Dietrich
// hdietrich2@hotmail.com
//
// This software is released into the public domain.
// You are free to use it in any way you like.
//
// This software is provided "as is" with no expressed
// or implied warranty. I accept no liability for any
// damage or loss of business that this software may cause.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef XGETOPT_H
#define XGETOPT_H
#ifdef __cplusplus
extern "C" {
#endif
extern int optind, opterr;
extern char * optarg;
int getopt( int argc, char * argv[], char * optstring );
#ifdef __cplusplus
}
#endif
#endif //XGETOPT_H
+1 -1
View File
@@ -4,7 +4,7 @@
# astyle --options=misc/astyle.cfg path/to/file
#run astyle on all files: from the scl root dir, use
# astyle --options=misc/astyle.cfg --recursive "src/*.c" "src/*.cc" "include/*.h"
# astyle --options=misc/astyle.cfg --recursive "src/*.c" "src/*.cc" "include/*.h" "src/*.h"
# in the above line, the double quotes *are* necessary
# DO NOT run astyle on flex/bison input such as expparse.y and expscan.l!
+229
View File
@@ -0,0 +1,229 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<!--
EXPRESS syntax definition based on sql-mysql.xml by Shane Wright (me@shanewright.co.uk)
This is for Kate, the KDE editor. Rename to express.xml and place in the syntax directory (on Debian, this is /usr/share/kde4/apps/katepart/syntax )
-->
<language name="EXPRESS" version="0.1" kateversion="2.5" section="Database" extensions="*.exp;*.EXP;*.p11" mimetype="text/x-express" casesensitive="0" author="Mark Pictor (mpictor@gmail.com)" license="">
<highlighting>
<list name="keywords">
<item> of </item>
<item> or </item>
<item> to </item>
<item> where </item>
<item> subtype </item>
<item> supertype </item>
<item> abstract </item>
<item> oneof </item>
<item> not </item>
<item> in </item>
<item> and </item>
<item> return </item>
<item> then </item>
<item> derive </item>
<item> optional </item>
<!-- put SCHEMA and END_SCHEMA here so code folding will fold
everything in a schema, and not collapse the schema itself -->
<item> schema </item>
<item> end_schema </item>
</list>
<list name="kw_begin"> <!-- kw's that can begin a foldable region -->
<item> type </item>
<item> entity </item>
<item> function </item>
<item> rule </item>
<item> constant </item>
<item> if </item>
<item> local </item>
<item> repeat </item>
<item> begin </item>
<item> case </item>
</list>
<list name="kw_end"> <!-- kw's that can end a foldable region -->
<item> end </item>
<item> end_type </item>
<item> end_entity </item>
<item> end_function </item>
<item> end_rule </item>
<item> end_constant </item>
<item> end_if </item>
<item> end_local </item>
<item> end_repeat </item>
<item> end_case </item>
</list>
<list name="kw_end_begin"> <!-- end one foldable region, begin another -->
<item> else </item>
</list>
<list name="interface_specification"> <!-- USE FROM, REFERENCE FROM -->
<item> use </item>
<item> reference </item>
</list>
<list name="operators">
<item> : </item>
<item> , </item>
<item> || </item>
<item> . </item>
<item> = </item>
<item> ** </item>
<item> | </item>
<item> &lt;* </item>
<item> &gt;= </item>
<item> &gt; </item>
<item> :=: </item>
<item> :&lt;&gt;: </item>
<item> [ </item>
<item> { </item>
<item> ( </item>
<item> &lt;= </item>
<item> &lt; </item>
<item> - </item>
<item> &lt;&gt; </item>
<item> + </item>
<item> / </item>
<item> ] </item>
<item> } </item>
<item> ) </item>
<item> * </item>
<item> \\ </item>
</list>
<list name="functions">
<item> ABS </item>
<item> ACOS </item>
<item> ASIN </item>
<item> ATAN </item>
<item> BLENGTH </item>
<item> COS </item>
<item> EXISTS </item>
<item> EXP </item>
<item> FORMAT </item>
<item> HIBOUND </item>
<item> HIINDEX </item>
<item> LENGTH </item>
<item> LOBOUND </item>
<item> LOINDEX </item>
<item> LOG </item>
<item> LOG2 </item>
<item> LOG10 </item>
<item> NVL </item>
<item> ODD </item>
<item> ROLESOF </item>
<item> SIN </item>
<item> SIZEOF </item>
<item> SQRT </item>
<item> TAN </item>
<item> TYPEOF </item>
<item> USEDIN </item>
<item> VALUE </item>
<item> VALUE_IN </item>
<item> VALUE_UNIQUE </item>
<item> QUERY </item>
</list>
<list name="constants">
<item> CONST_E </item>
<item> PI </item>
<item> SELF </item>
<!-- <item> ? </item> -->
</list>
<list name="types">
<item> binary </item>
<item> boolean </item>
<item> integer </item>
<item> logical </item>
<item> number </item>
<item> real </item>
<item> string </item>
<item> enumeration </item>
<item> select </item>
<item> array </item>
<item> list </item>
<item> bag </item>
<item> set </item>
<item> generic </item>
</list>
<contexts>
<context name="Normal" attribute="Normal Text" lineEndContext="#stay">
<DetectSpaces />
<!-- Make code folding work for SCHEMA/END_SCHEMA, TYPE/END_TYPE, etc -->
<!-- <RegExpr attribute="Block" context="#stay" String="(?:^|[^\w'])(?:SCHEMA|TYPE|ENTITY|FUNCTION|RULE|CONSTANT|IF|LOCAL|REPEAT|BEGIN)" insensitive="false" beginRegion="Blk" firstNonSpace="false" /> -->
<!-- <RegExpr attribute="Block" context="#stay" String="END_(?:SCHEMA|TYPE|ENTITY|FUNCTION|RULE|CONSTANT|IF|LOCAL|REPEAT)" insensitive="false" endRegion="Blk" firstNonSpace="false" /> -->
<!-- <RegExpr attribute="Block" context="#stay" String="END(?:[^_]|$)" endRegion="Blk" firstNonSpace="false" /> -->
<!-- <RegExpr attribute="Block" context="#stay" String="(?:^|[^\w])ELSE(?:$|[^\w])" endRegion="Blk" beginRegion="Blk" firstNonSpace="false" /> -->
<!-- using the lists -->
<keyword attribute="Keyword" context="#stay" String="keywords"/>
<keyword attribute="Keyword" context="#stay" String="kw_begin" beginRegion="Blk" firstNonSpace="false"/>
<keyword attribute="Keyword" context="#stay" String="kw_end_begin" endRegion="Blk" beginRegion="Blk" firstNonSpace="false" />
<keyword attribute="Keyword" context="#stay" String="kw_end" endRegion="Blk" firstNonSpace="false"/>
<keyword attribute="Operator" context="#stay" String="operators"/>
<keyword attribute="Function" context="#stay" String="functions"/>
<keyword attribute="Constants" context="#stay" String="constants"/>
<keyword attribute="Data Type" context="#stay" String="types"/>
<keyword attribute="Interface Specification" context="Interface Specification" String="interface_specification" firstNonSpace="true" />
<DetectIdentifier />
<!-- extra data types -->
<!-- numbers -->
<HlCHex attribute="Hex" context="#stay"/>
<Float attribute="Float" context="#stay"/>
<Int attribute="Decimal" context="#stay"/>
<!-- strings -->
<DetectChar attribute="String" context="String" char="'"/>
<DetectChar attribute="String" context="String2" char="&quot;"/>
<!-- comments -->
<Detect2Chars attribute="Comment" context="SingleLineComment" char="-" char1="-"/>
<Detect2Chars attribute="Comment" context="MultiLineComment" char="(" char1="*" beginRegion="Comment"/>
<DetectChar attribute="Constants" context="#stay" char="?"/>
</context>
<!-- 'string' -->
<context name="String" attribute="String" lineEndContext="#stay">
<LineContinue attribute="String" context="#pop"/>
<DetectChar attribute="String" context="#pop" char="'"/>
</context>
<!-- "string", extra context needed to enable "str'ing" and 'str"ing' -->
<context name="String2" attribute="String" lineEndContext="#stay">
<LineContinue attribute="String" context="#pop"/>
<HlCStringChar attribute="String Char" context="#stay"/>
<DetectChar attribute="String" context="#pop" char="&quot;"/>
</context>
<!-- comments -->
<context name="SingleLineComment" attribute="Comment" lineEndContext="#pop"/>
<context name="MultiLineComment" attribute="Comment" lineEndContext="#stay">
<Detect2Chars attribute="Comment" context="#pop" char="*" char1=")" endRegion="Comment" />
</context>
<context name="Interface Specification" attribute="Interface Specification" >
<!-- lineEndContext="#pop" -->
<DetectChar attribute="Interface Specification" context="#pop" char=";"/>
</context>
</contexts>
<itemDatas>
<itemData name="Normal Text" defStyleNum="dsNormal" spellChecking="false"/>
<itemData name="Keyword" defStyleNum="dsKeyword" spellChecking="false"/>
<itemData name="Block" defStyleNum="dsKeyword" spellChecking="false"/>
<itemData name="Operator" defStyleNum="dsNormal" spellChecking="false"/>
<itemData name="Function" defStyleNum="dsFunction" spellChecking="false"/>
<itemData name="Constants" defStyleNum="dsOthers" spellChecking="false"/>
<itemData name="Data Type" defStyleNum="dsDataType" spellChecking="false"/>
<itemData name="Decimal" defStyleNum="dsDecVal" spellChecking="false"/>
<itemData name="Float" defStyleNum="dsFloat" spellChecking="false"/>
<itemData name="Hex" defStyleNum="dsBaseN" spellChecking="false"/>
<itemData name="String" defStyleNum="dsString"/>
<itemData name="String Char" defStyleNum="dsChar" spellChecking="false"/>
<itemData name="Comment" defStyleNum="dsComment"/>
<itemData name="Interface Specification" defStyleNum="dsOthers" spellChecking="false"/>
</itemDatas>
</highlighting>
<general>
<comments>
<comment name="singleLine" start="--"/>
<comment name="multiLine" start="(*" end="*)"/>
</comments>
<keywords casesensitive="0" additionalDeliminator="'" />
<!-- weakDeliminator="+-*/|=!&lt;&gt;~^:." -->
</general>
</language>
@@ -0,0 +1,36 @@
<NotepadPlus>
<UserLang name="Express Schema" ext="exp">
<Settings>
<Global caseIgnored="yes" />
<TreatAsSymbol comment="no" commentLine="no" />
<Prefix words1="no" words2="no" words3="no" words4="no" />
</Settings>
<KeywordLists>
<Keywords name="Delimiters">000000</Keywords>
<Keywords name="Folder+">type entity function rule constant if local repeat begin case else</Keywords>
<Keywords name="Folder-">end_type end_entity end_function end_rule end_constant end_if end_local end_repeat end end_base else</Keywords>
<Keywords name="Operators">&quot; , . / : ; [ \ ] { | } &lt; = &gt;</Keywords>
<Keywords name="Comment"> 1(* 2*) 0--</Keywords>
<Keywords name="Words1">of or to where subtype supertype abstract oneof not in and return then derive optional schema end_schema</Keywords>
<Keywords name="Words2">abs acos asin atan blength cos exists exp format hibound hiindex length lobound loindex log log2 log10 nvl odd rolesof sin sizeof sqrt tan typeof usedin value value_in value_unique query</Keywords>
<Keywords name="Words3">const_e pi self</Keywords>
<Keywords name="Words4">binary boolean integer logical number real string enumeration select array list bag set generic</Keywords>
</KeywordLists>
<Styles>
<WordsStyle name="DEFAULT" styleID="11" fgColor="000000" bgColor="FFFFFF" fontStyle="0" />
<WordsStyle name="FOLDEROPEN" styleID="12" fgColor="800000" bgColor="FFFFFF" fontStyle="0" />
<WordsStyle name="FOLDERCLOSE" styleID="13" fgColor="800000" bgColor="FFFFFF" fontStyle="0" />
<WordsStyle name="KEYWORD1" styleID="5" fgColor="800000" bgColor="FFFFFF" fontStyle="0" />
<WordsStyle name="KEYWORD2" styleID="6" fgColor="800000" bgColor="FFFFFF" fontStyle="0" />
<WordsStyle name="KEYWORD3" styleID="7" fgColor="FF8000" bgColor="FFFFFF" fontStyle="0" />
<WordsStyle name="KEYWORD4" styleID="8" fgColor="0000FF" bgColor="FFFFFF" fontStyle="0" />
<WordsStyle name="COMMENT" styleID="1" fgColor="008000" bgColor="FFFFFF" fontStyle="0" />
<WordsStyle name="COMMENT LINE" styleID="2" fgColor="008000" bgColor="FFFFFF" fontStyle="0" />
<WordsStyle name="NUMBER" styleID="4" fgColor="000000" bgColor="FFFFFF" fontStyle="0" />
<WordsStyle name="OPERATOR" styleID="10" fgColor="FF0000" bgColor="FFFFFF" fontStyle="0" />
<WordsStyle name="DELIMINER1" styleID="14" fgColor="000000" bgColor="FFFFFF" fontStyle="0" />
<WordsStyle name="DELIMINER2" styleID="15" fgColor="000000" bgColor="FFFFFF" fontStyle="0" />
<WordsStyle name="DELIMINER3" styleID="16" fgColor="000000" bgColor="FFFFFF" fontStyle="0" />
</Styles>
</UserLang>
</NotepadPlus>
+6 -4
View File
@@ -9,7 +9,7 @@ result_dir="."
mk="make -j4"
#separated by ; for cmake
schemas="../data/ap203/203wseds.exp;../data/ap203e2/ap203e2_mim_lf.exp;../data/ap210e3/ap210e3_wip1.41_mim_lf.exp;../data/ap214e3/AP214E3_2010.exp;../data/ap227/ap227.exp;../data/ap235/AP235-aim-long.exp;../data/ap240/AP240_aim_lf.exp;../data/cd209/part409cdts_wg3n2617mim_lf.exp;../data/cd242/242_n2813_mim_lf.exp;../data/ifc2x3/IFC2X3_TC1.exp;../data/ifc2x4/IFC2X4_RC2.exp;../data/ISO15926/15926-0002-lifecycle_integration.exp"
schemas="../data/203wseds/203wseds.exp;../data/ap203e2/ap203e2_mim_lf.exp;../data/ap210e2/ap210e2_v1_40_mim_lf.exp;../data/wip210e3/210e3_wip_v1_41_mim_lf.exp;../data/ap214e3/AP214E3_2010.exp;../data/ap227/ap227.exp;../data/ap235/AP235_TC_engineering_properties_schema_20110222.exp;../data/ap240/AP240_aim_lf.exp;../data/cd209/part409cdts_wg3n2617mim_lf.exp;../data/cd242/242_n2813_mim_lf.exp;../data/ifc2x3/IFC2X3_TC1.exp;../data/ifc2x4/IFC2X4_RC3.exp;../data/ISO15926/15926-0002-lifecycle_integration.exp"
#count warnings and errors, append to $matrix_file. creates hypertext links to stderr,stdout txt
# $1 is the name of the row, $2 is the path and first part of the filename, $3 is the schema
function count_we {
@@ -78,11 +78,12 @@ function fedex_details {
function build_one_schema {
#set $i to the schema name, all caps (to match fedex_plus output)
i=`sed -ne '0,/^\s*SCHEMA/s/^.*SCHEMA\s\+\(.*\);.*$/\1/p;' $1|tr a-z A-Z`
d=`echo $1|sed -e 's|^.*/\([^/]*\)\.exp$|\1|;'`
echo "Running fedex_plus and gcc for $i..."
make -f data/CMakeFiles/sdai_$i.dir/build.make $i/compstructs.cc 2>"$result_dir/fedex_"$i"_stderr.txt" >"$result_dir/fedex_"$i"_stdout.txt" && \
$mk sdai_$i >/dev/null 2>"$result_dir/compile_libsdai_"$i"_stderr.txt" && \
$mk p21read_sdai_$i >/dev/null 2>"$result_dir/compile_p21read_sdai_"$i"_stderr.txt"
make generate_cpp_$d 2>"$result_dir/fedex_"$i"_stderr.txt" >"$result_dir/fedex_"$i"_stdout.txt" && \
$mk sdai_$d >/dev/null 2>"$result_dir/compile_libsdai_"$i"_stderr.txt" && \
$mk p21read_sdai_$d >/dev/null 2>"$result_dir/compile_p21read_sdai_"$i"_stderr.txt"
#todo: test p21read_sdai_$i
}
@@ -130,6 +131,7 @@ function gen_wiki {
git log --decorate=short -n1 |\
head -n1 |\
sed -e 's|^.*commit \([a-z0-9]\+\) .*$|### Current as of commit [\1](http://github.com/mpictor/StepClassLibrary/commit/\1)|;' >>$matrix_file
echo -e "\n## See also [PLIB build matrix](http://github.com/mpictor/StepClassLibrary/wiki/PLIB-build-matrix)\n\n" >>$matrix_file
echo "<table border=1>" >>$matrix_file
echo "<tr><th>Key</th></tr><tr><td><table width=100%>" >>$matrix_file
echo "<tr><th>Item</th><th>Description</th></tr>" >>$matrix_file
+235
View File
@@ -0,0 +1,235 @@
#!/usr/bin/env python
#you probably want to run the ctest script that calls this instead:
# ctest -S ctest_matrix.cmake
#must be ran from scl/build_matrix
from xml.etree import ElementTree as ET
import os
from datetime import date
import subprocess
import codecs
import io
#ctest xml file layout
#<Site ...=...>
# <testing>
# <StartDateTime>..</>
# <StartTestTime>..</>
# <TestList>..</>
# <Test status=..>..</>
# <EndDateTime>Dec 28 17:49 EST</EndDateTime>
# <EndTestTime>1325112579</EndTestTime>
# <ElapsedMinutes>1.9</ElapsedMinutes>
# </Testing>
#</Site>
#summary (aka 's') is a table near the top of the document
#body (aka 'b') contains the details for all schemas
def main():
xml_file = find_xml()
wikipath, matrix = find_wiki()
#codecs.open is deprecated but io.open doesn't seem to work, and open() complains of unicode
out = codecs.open(matrix,encoding='utf-8',mode='w')
out.write( header() )
out.write( read_tests(xml_file) )
out.close()
git_push(wikipath, matrix)
def find_xml():
#find xml file
i = 0
for dirname in os.listdir("Testing"):
if str(date.today().year) in dirname:
i += 1
if i > 1:
print "Too many directories, exiting"
exit(1)
xml = os.path.join("Testing", dirname, "Test.xml")
return xml
def find_wiki():
#find wiki and matrix file, issue 'git pull'
wikipath = os.path.abspath("../../wiki-scl")
if not os.path.isdir(os.path.join(wikipath,".git")):
print "Can't find wiki or not a git repo"
exit(1)
p = subprocess.call(["git", "pull", "origin"], cwd=wikipath)
if not p == 0:
print "'git pull' exited with error"
exit(1)
matrix = os.path.join(wikipath, "Schema-build-matrix.md")
if not os.path.isfile(matrix):
print "Matrix file doesn't exist or isn't a file"
exit(1)
return wikipath,matrix
def git_push(path,f):
p = subprocess.call(["git", "add", f], cwd=path)
if not p == 0:
print "'git add' exited with error"
exit(1)
msg = date.today().__str__() + " - schema matrix updated by update-matrix.py"
p = subprocess.call(["git", "commit", "-m", msg ], cwd=path)
if not p == 0:
print "'git commit' exited with error"
exit(1)
p = subprocess.call(["git", "push", "origin"], cwd=path)
if not p == 0:
print "'git push' exited with error"
exit(1)
def header():
h = "## Created " + date.today().__str__() + "\n" + "### Current as of commit "
l = subprocess.check_output(["git", "log", """--pretty=format:%H Commit Summary: %s<br>Author: %aN<br>Date: %aD""", "-n1"])
h += "[" + l[:8] + "](http://github.com/mpictor/StepClassLibrary/commit/" + l[:l.find(" ")]
h += ") --\n<font color=grey>" + l[l.find(" ")+1:] + "</font>\n\n----\n"
h += "### Summary\n<table width=100%><tr><th>Schema</th><th>Generate</th><th>Build</th></tr>"
return h
def read_tests(xml):
# read all <Test>s in xml, create mixed html/markdown
try:
tree = ET.parse(xml)
except Exception, inst:
print "Unexpected error opening %s: %s" % (xml, inst)
return
root = tree.getroot()
testing = root.find("Testing")
tests = testing.findall("Test")
summary = ""
body = ""
for test in tests:
s,b = schema_info(test,tests)
summary += s
body += b
summary += "</table>\n\n"
return summary + body
def schema_info(test,tests):
# this returns html & markdown formatted summary and body strings
# for the generate and build tests for a single schema
s=""
b=""
name = test.find("Name").text
if name.startswith("generate_cpp_"):
#print this one. if it passes, find and print build.
ap = name[len("generate_cpp_"):]
s += "<tr><td><a href=#" + ap + ">" + ap.title() + "</a></td><td>"
s += test_status(test) + "</td><td>"
b += "----\n<a name=\"wiki-" + ap + "\"></a>\n"
b += "### Schema " + ap.title()
b += "<table width=100%>"
b += test_table("generation",test)
if test.get("Status") == "passed":
for build in tests:
if build.find("Name").text == "build_cpp_sdai_" + ap:
s += test_status(build) + "</td></tr>\n"
b += test_table("compilation",build)
break
else:
s += "----</td></tr>\n"
b += "</table>\n"
return s,b
def test_table(ttype, test):
# populate the table for one test
# returns: html & markdown formatted text to be added to 'body'
b = "<tr><td>Code " + ttype
output = test.find("Results").find("Measurement").find("Value").text
w = output.count("WARNING")
w += output.count("warning")
lines = output.split("\n")
if "The rest of the test output was removed since it exceeds the threshold of" in lines[-2]:
trunc1 = "at least "
trunc2 = "(ctest truncated output)"
else:
trunc1 = ""
trunc2 = ""
if test.get("Status") == "passed":
#print summary in b
b += " succeeded with " + trunc1 + w.__str__() + " warnings " + trunc2
if w == 0: #nothing to print in the table, so skip it
b += "</td></tr>\n"
return b
else:
#print warnings and errors in b
e = output.count("ERROR")
e += output.count("error")
b += " failed with %s%d warnings and %d errors %s" %(trunc1, w, e, trunc2)
b += "<br>\n<table border=1 width=100%>\n"
b += "<tr><th>Line</th><th>Text</th></tr>\n"
# ERRORs
# 242_n2813_mim_lf.exp:2278: --ERROR: Expected a type...
# gcc errors look like ???
l=0
for line in lines:
if ": --ERROR:" in line:
l += 1
c1 = line.find(":")
c2 = line.find(":",c1+1)
b += "<tr><td>" + line[c1+1:c2] + "</td><td>" + line[c2+4:] + "</td></tr>\n"
elif ": error:" in line:
l += 1
c1 = line.find(":")
c2 = line.find(":",c1+1)
c3 = line.find(":",c2+1) #skip the character number
b += "<tr><td>" + line[c1+1:c2] + "</td><td>" + line[c3+2:] + "</td></tr>\n"
if l > 20:
b += "<tr><td>-</td><td><font color=red>-- maximum number of errors printed --</font></td></tr>\n"
break
# WARNINGs
# ap239_arm_lf.exp:2731: WARNING: Implicit downcast...
# WARNING: in SELECT TYPE date_or_date... (multi-line warning)
# compstructs.cc:28:23: warning: unused
l=0
for line in lines:
if ": WARNING" in line:
l += 1
c1 = line.find(":")
c2 = line.find(":",c1+1)
b += "<tr><td>" + line[c1+1:c2] + "</td><td>" + line[c2+2:] + "</td></tr>\n"
elif "WARNING" in line:
b += "<tr><td>????</td><td>" + line + "</td></tr>\n"
elif ": warning:" in line:
l += 1
c1 = line.find(":")
c2 = line.find(":",c1+1)
c3 = line.find(":",c2+1) #skip the character number
b += "<tr><td>" + line[c1+1:c2] + "</td><td>" + line[c3+2:] + "</td></tr>\n"
if l > 20:
b += "<tr><td>-</td><td><font color=red>-- maximum number of warnings printed --</font></td></tr>\n"
break
b += "</table></td></tr>\n"
return b
def test_status(test):
t = ""
for m in test.find("Results").findall("NamedMeasurement"):
if m.get("name") == "Execution Time":
t = " in " + m.find("Value").text + "s"
break
if test.get("Status") == "passed":
s = "<font color=green>PASS</font>"
elif test.get("Status") == "failed":
s = "<font color=red>FAIL</font>"
else:
s = "<font color=cyan>" + test.get("Status") + "</font>"
return s + t
if __name__ == "__main__":
# Someone is launching this directly
main()
+44 -48
View File
@@ -8,8 +8,8 @@ set( CTEST_MEMORYCHECK_COMMAND /usr/bin/valgrind )
set( CTEST_INITIAL_CACHE "
SITE:STRING=${CTEST_SITE}
BUILDNAME:STRING=${CTEST_BUILD_NAME}
ENABLE_TESTING:BOOL=ON
CMAKE_BUILD_TYPE:STRING=Debug
SCL_ENABLE_TESTING:BOOL=ON
SCL_BUILD_TYPE:STRING=Debug
")
@@ -26,7 +26,7 @@ endif()
# use config variables such as these in
# ../.SCL_CTEST_PREFS.cmake
#
#set( CTEST_SITE "your name here")
#set( CTEST_SITE "username")
#set( CTEST_BUILD_NAME "build type, os, arch")
#
#
@@ -35,6 +35,8 @@ endif()
# SKIP_CPP_TEST_SCHEMA_GEN
# SKIP_CPP_TEST_SCHEMA_BUILD
# SKIP_CPP_TEST_SCHEMA_RW
# SKIP_TEST_UNITARY_SCHEMAS
# SKIP_TEST_EXCHANGE_FILE
#
# setting this one disables result submission to my.cdash.org
# SKIP_SUBMISSION
@@ -48,44 +50,10 @@ function( SUBMIT_TEST part )
endif()
endfunction( SUBMIT_TEST part )
# find number of processors, for faster builds
# from http://www.kitware.com/blog/home/post/63
if(NOT DEFINED PROCESSOR_COUNT)
# Unknown:
set(PROCESSOR_COUNT 0)
# Linux:
set(cpuinfo_file "/proc/cpuinfo")
if(EXISTS "${cpuinfo_file}")
file(STRINGS "${cpuinfo_file}" procs REGEX "^processor.: [0-9]+$")
list(LENGTH procs PROCESSOR_COUNT)
endif()
# Mac:
if(APPLE)
find_program(cmd_sys_pro "system_profiler")
if(cmd_sys_pro)
execute_process(COMMAND ${cmd_sys_pro} OUTPUT_VARIABLE info)
string(REGEX REPLACE "^.*Total Number Of Cores: ([0-9]+).*$" "\\1"
PROCESSOR_COUNT "${info}")
endif()
endif()
# Windows:
if(WIN32)
set(PROCESSOR_COUNT "$ENV{NUMBER_OF_PROCESSORS}")
endif()
endif()
set(CTEST_BUILD_FLAGS "-j${PROCESSOR_COUNT}")
######################################################
##### To disable reporting of a set of tests, comment
##### out the SUBMIT_TEST line immediately following
##### the set you wish to disable. If other tests
##### depend on those tests, they will be executed
##### but not reported.
##### the set you wish to disable.
#####
##### To do this for all tests:
##### set( SKIP_SUBMISSION TRUE )
@@ -94,26 +62,54 @@ set(CTEST_BUILD_FLAGS "-j${PROCESSOR_COUNT}")
ctest_start(Experimental)
ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})
ctest_configure( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND OPTIONS -DENABLE_TESTING=ON )
file(WRITE "${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake" "
set( CTEST_CUSTOM_ERROR_EXCEPTION \"{standard input}:[0-9][0-9]*: WARNING: \")
")
ctest_configure( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND OPTIONS -DSCL_ENABLE_TESTING=ON )
SUBMIT_TEST( Configure )
ctest_build( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND )
SUBMIT_TEST( Build )
# ctest_memcheck( BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res PARALLEL_LEVEL ${PROCESSOR_COUNT} )
# ctest_memcheck( BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res )
if(NOT SKIP_TEST_UNITARY_SCHEMAS )
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
INCLUDE_LABEL "unitary_schemas" )
SUBMIT_TEST( Test )
endif()
if(NOT SKIP_CPP_TEST_SCHEMA_GEN )
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
PARALLEL_LEVEL ${PROCESSOR_COUNT} INCLUDE_LABEL "schema_gen" )
INCLUDE_LABEL "cpp_schema_gen" )
SUBMIT_TEST( Test )
if(NOT SKIP_CPP_TEST_SCHEMA_BUILD )
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
INCLUDE_LABEL "cpp_schema_build" )
SUBMIT_TEST( Test )
if(NOT SKIP_CPP_TEST_SCHEMA_RW )
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
INCLUDE_LABEL "cpp_schema_rw" )
SUBMIT_TEST( Test )
endif()
endif()
endif()
if(NOT SKIP_CPP_TEST_SCHEMA_BUILD_CPP )
if(NOT SKIP_TEST_EXCHANGE_FILE )
if( SKIP_CPP_TEST_SCHEMA_BUILD )
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
INCLUDE "build_cpp_sdai_AP214E3_2010" )
SUBMIT_TEST( Test )
endif()
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
PARALLEL_LEVEL ${PROCESSOR_COUNT} INCLUDE_LABEL "schema_build" )
SUBMIT_TEST( Test )
endif()
if(NOT SKIP_CPP_TEST_SCHEMA_RW )
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
PARALLEL_LEVEL ${PROCESSOR_COUNT} INCLUDE_LABEL "schema_rw" )
INCLUDE_LABEL "exchange_file" )
SUBMIT_TEST( Test )
endif()
if(NOT SKIP_TEST_CPP_SCHEMA_SPECIFIC )
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
INCLUDE_LABEL "cpp_schema_specific" )
SUBMIT_TEST( Test )
endif()
# ctest_coverage( )
+15
View File
@@ -0,0 +1,15 @@
set(SCL_BASE_SOURCES
scl_memmgr.cc
scl_trace_fprintf.c
)
include_directories(
${SCL_SOURCE_DIR}/include
)
if(MSVC OR BORLAND)
add_definitions( -DSCL_BASE_DLL_EXPORTS )
endif()
SCL_ADDLIB(base "${SCL_BASE_SOURCES}" "")
+408
View File
@@ -0,0 +1,408 @@
#define SCL_MEMMGR_CC
#include <scl_cf.h>
#include "scl_memmgr.h"
#if __APPLE__
# include <malloc/malloc.h>
#else
# include <malloc.h>
#endif
#include <stdio.h>
#include <string>
#include <set>
#ifdef SCL_MEMMGR_ENABLE_CHECKS
/**
scl_memmgr_error definition
*/
class scl_memmgr_error {
private:
std::string _srcfile;
unsigned int _srcline;
unsigned int _occurences;
public:
scl_memmgr_error( const std::string &file, const unsigned int line );
scl_memmgr_error( const scl_memmgr_error &rhs );
~scl_memmgr_error( void );
bool operator<( const scl_memmgr_error &rhs ) const;
std::string getsrcfile( void ) const;
unsigned int getsrcline( void ) const;
unsigned int getoccurences( void ) const;
};
typedef std::set<scl_memmgr_error> scl_memmgr_errors;
typedef std::set<scl_memmgr_error>::iterator scl_memmgr_error_iterator;
/**
scl_memmgr_record definition
*/
class scl_memmgr_record {
private:
void * _addr;
size_t _size;
std::string _srcfile;
unsigned int _srcline;
public:
scl_memmgr_record( void * addr, size_t size, const char *file, const unsigned int line );
scl_memmgr_record( void * addr );
scl_memmgr_record( const scl_memmgr_record &rhs );
~scl_memmgr_record( void );
bool operator<( const scl_memmgr_record &rhs ) const;
void * getaddr( void ) const;
size_t getsize( void ) const;
std::string getsrcfile( void ) const;
unsigned int getsrcline( void ) const;
};
typedef std::set<scl_memmgr_record> scl_memmgr_records;
typedef std::set<scl_memmgr_record>::iterator scl_memmgr_record_iterator;
#endif /* SCL_MEMMGR_ENABLE_CHECKS */
/**
scl_memmgr definition
*/
class scl_memmgr {
private:
#ifdef SCL_MEMMGR_ENABLE_CHECKS
bool _record_insert_busy, _record_erase_busy;
// memory allocation/reallocation records, inserted at allocation, erased at deallocation.
scl_memmgr_records _records;
// memory stats
unsigned int _allocated; // amount of memory allocated simultaniously
unsigned int _maximum_allocated; // maximum amount of memory allocated simultaniously
unsigned int _allocated_total; // total amount of memory allocated in bytes
unsigned int _reallocated_total; // total amount of memory reallocated in bytes
unsigned int _deallocated_total; // total amount of memory deallocated in bytes
#endif /* SCL_MEMMGR_ENABLE_CHECKS */
protected:
public:
scl_memmgr(void);
~scl_memmgr(void);
void * allocate( size_t size, const char *file, const int line );
void * reallocate( void * addr, size_t size, const char *file, const int line );
void deallocate( void * addr, const char *file, const int line );
};
/**
scl_memmgr instance.
There should be one static instance of memmgr.
This instance is automatically destroyed when application exits, so this allows us to add
memory leak detection in it's destructor.
*/
scl_memmgr memmgr;
/**
c memory functions implementation
*/
extern "C" {
void * scl_malloc_fn( unsigned int size, const char * file, const int line ) {
return memmgr.allocate(size, file, line);
}
void * scl_calloc_fn( unsigned int count, unsigned int size, const char * file, const int line ) {
return memmgr.allocate(count * size, file, line);
}
void * scl_realloc_fn( void * addr, unsigned int size, const char * file, const int line ) {
return memmgr.reallocate(addr, size, file, line);
}
void scl_free_fn( void * addr ) {
memmgr.deallocate(addr, "", 0);
}
}
/**
c++ memory operators implementation
*/
void * scl_operator_new( size_t size, const char * file, const int line ) {
return memmgr.allocate(size, file, line);
}
void scl_operator_delete( void * addr, const char * file, const int line ) {
memmgr.deallocate(addr, file, line);
}
void scl_operator_delete( void * addr ) {
memmgr.deallocate(addr, "", 0);
}
/**
scl_memmgr implementation
*/
scl_memmgr::scl_memmgr(void) {
#ifdef SCL_MEMMGR_ENABLE_CHECKS
_record_insert_busy = false;
_record_erase_busy = false;
_allocated = 0;
_maximum_allocated = 0;
_allocated_total = 0;
_reallocated_total = 0;
_deallocated_total = 0;
#endif /* SCL_MEMMGR_ENABLE_CHECKS */
}
/**
Destructor:
scl_memmgr::~scl_memmgr(void)
Description:
The scl_memmgr destructor is used to check for memory leaks when enabled.
All records still present when scl_memmgr instance is destroyed can be considered as
memory leaks.
*/
scl_memmgr::~scl_memmgr(void) {
#ifdef SCL_MEMMGR_ENABLE_CHECKS
scl_memmgr_record_iterator irecord;
scl_memmgr_errors errors;
scl_memmgr_error_iterator ierror;
// Check if total allocated equals total deallocated
if (_allocated_total != _deallocated_total) {
// todo: generate warning for possible memory leaks, enable full memory leak checking
printf("scl_memmgr warning: Possible memory leaks detected (%d of %d bytes)\n", _allocated_total - _deallocated_total, _allocated_total);
}
// Compact leaks into an error list to prevent same leak being reported multiple times.
_record_insert_busy = true;
_record_erase_busy = true;
for (irecord = _records.begin();
irecord != _records.end();
irecord ++) {
scl_memmgr_error error(irecord->getsrcfile(), irecord->getsrcline());
ierror = errors.find(error);
if (ierror == errors.end())
errors.insert(error);
//else
// ierror->occurences ++;
}
_record_insert_busy = false;
_record_erase_busy = false;
// Loop through memory leaks to generate/buffer errors
for (ierror = errors.begin();
ierror != errors.end();
ierror ++) {
// todo: generate error for memory leak
printf("scl_memmgr warning: Possible memory leak in %s line %d\n", ierror->getsrcfile().c_str(), ierror->getsrcline());
}
// Clear remaining records
_record_erase_busy = true;
_records.clear();
errors.clear();
_record_erase_busy = false;
#endif /* SCL_MEMMGR_ENABLE_CHECKS */
}
void * scl_memmgr::allocate( size_t size, const char *file, const int line ) {
void * addr;
// Allocate
addr = malloc(size);
if (addr == NULL) {
// todo: error allocation failed
printf("scl_memmgr error: Memory allocation failed in %s line %d\n", file, line);
}
// Some stl implementations (for example debian gcc) use the new operator to construct
// new elements when inserting scl_memmgr_record. When this our new operator gets used
// for this operation, this would result in an infinite loop. This is fixed by the
// _record_insert_busy flag.
#ifdef SCL_MEMMGR_ENABLE_CHECKS
if (!_record_insert_busy)
{
// Store record for this allocation
_record_insert_busy = true;
_records.insert(scl_memmgr_record(addr, size, file, line));
_record_insert_busy = false;
// Update stats
_allocated += size;
if (_allocated > _maximum_allocated)
_maximum_allocated = _allocated;
_allocated_total += size;
}
#endif /* SCL_MEMMGR_ENABLE_CHECKS */
return addr;
}
void * scl_memmgr::reallocate( void * addr, size_t size, const char *file, const int line ) {
#ifdef SCL_MEMMGR_ENABLE_CHECKS
scl_memmgr_record_iterator record;
if (!_record_insert_busy)
{
// Find record of previous allocation/reallocation
record = _records.find(scl_memmgr_record(addr));
if (record == _records.end()) {
// todo: error reallocating memory not allocated?
printf("scl_memmgr warning: Reallocation of not allocated memory at %s line %d\n", file, line);
}
else {
// Update stats
_allocated -= record->getsize();
_deallocated_total += record->getsize();
// Erase previous allocation/reallocation
_record_erase_busy = true;
_records.erase(record);
_record_erase_busy = false;
}
}
#endif /* SCL_MEMMGR_ENABLE_CHECKS */
// Reallocate
addr = realloc(addr, size);
if (addr == NULL) {
// todo: error reallocation failed
printf("scl_memmgr error: Reallocation failed at %s line %d\n", file, line);
}
#ifdef SCL_MEMMGR_ENABLE_CHECKS
if (!_record_insert_busy)
{
// Store record for this reallocation
_record_insert_busy = true;
_records.insert(scl_memmgr_record(addr, size, file, line));
_record_insert_busy = false;
// Update stats
_allocated += size;
if (_allocated > _maximum_allocated)
_maximum_allocated = _allocated;
_allocated_total += size;
_reallocated_total += size;
}
#endif /* SCL_MEMMGR_ENABLE_CHECKS */
return addr;
}
void scl_memmgr::deallocate( void * addr, const char *file, const int line ) {
#ifdef SCL_MEMMGR_ENABLE_CHECKS
scl_memmgr_record_iterator record;
if (!_record_erase_busy)
{
// Find record of previous allocation/reallocation
record = _records.find(scl_memmgr_record(addr));
if (record == _records.end()) {
// todo: error free called for not allocated memory?
printf("scl_memmgr warning: Deallocate of not allocated memory at %s line %d\n", file, line);
}
else {
// Update stats
_allocated -= record->getsize();
_deallocated_total += record->getsize();
// Erase record
_record_erase_busy = true;
_records.erase(record);
_record_erase_busy = false;
}
}
#endif /* SCL_MEMMGR_ENABLE_CHECKS */
// Deallocate
free(addr);
}
#ifdef SCL_MEMMGR_ENABLE_CHECKS
/**
scl_memmgr_error implementation
*/
scl_memmgr_error::scl_memmgr_error( const std::string &file, const unsigned int line ) {
_srcfile = file;
_srcline = line;
_occurences = 1;
}
scl_memmgr_error::scl_memmgr_error( const scl_memmgr_error &rhs ) {
_srcfile = rhs._srcfile;
_srcline = rhs._srcline;
_occurences = rhs._occurences;
}
scl_memmgr_error::~scl_memmgr_error( void ) {
}
bool scl_memmgr_error::operator<( const scl_memmgr_error &rhs ) const {
if (_srcfile == rhs._srcfile)
return _srcline < rhs._srcline;
return _srcfile < rhs._srcfile;
}
std::string scl_memmgr_error::getsrcfile( void ) const {
return _srcfile;
}
unsigned int scl_memmgr_error::getsrcline( void ) const {
return _srcline;
}
unsigned int scl_memmgr_error::getoccurences( void ) const {
return _occurences;
}
/**
scl_memmgr_record implementation
*/
scl_memmgr_record::scl_memmgr_record( void * addr, size_t size, const char *file, const unsigned int line ) {
_addr = addr;
_size = size;
_srcfile = file;
_srcline = line;
}
scl_memmgr_record::scl_memmgr_record( void * addr ) {
_addr = addr;
_size = 0;
_srcfile = "";
_srcline = -1;
}
scl_memmgr_record::scl_memmgr_record( const scl_memmgr_record &rhs ) {
_addr = rhs._addr;
_size = rhs._size;
_srcfile = rhs._srcfile;
_srcline = rhs._srcline;
}
scl_memmgr_record::~scl_memmgr_record( void ) {
}
bool scl_memmgr_record::operator<( const scl_memmgr_record &rhs ) const {
return _addr < rhs._addr;
}
void * scl_memmgr_record::getaddr( void ) const {
return _addr;
}
size_t scl_memmgr_record::getsize( void ) const {
return _size;
}
std::string scl_memmgr_record::getsrcfile( void ) const {
return _srcfile;
}
unsigned int scl_memmgr_record::getsrcline( void ) const {
return _srcline;
}
#endif /* SCL_MEMMGR_ENABLE_CHECKS */
+80
View File
@@ -0,0 +1,80 @@
#ifndef SCL_MEMMGR_H
#define SCL_MEMMGR_H
#include <scl_export.h>
/**
Platform specific defines
*/
#if defined(__MSVC__) || defined(__BORLAND__)
#define THROW_STD_BAD_ALLOC
#define THROW_EMPTY
#else
#define THROW_STD_BAD_ALLOC throw (std::bad_alloc)
#define THROW_EMPTY throw ()
#endif
#ifdef __cplusplus
#include <cstddef>
extern "C" {
#endif /* __cplusplus */
SCL_BASE_EXPORT void * scl_malloc_fn( unsigned int size, const char *file, const int line );
SCL_BASE_EXPORT void * scl_calloc_fn( unsigned int count, unsigned int size, const char *file, const int line );
SCL_BASE_EXPORT void * scl_realloc_fn( void * addr, unsigned int size, const char *file, const int line );
SCL_BASE_EXPORT void scl_free_fn( void * addr );
#ifdef __cplusplus
}
#endif /* __cplusplus */
#ifdef __cplusplus
SCL_BASE_EXPORT void * scl_operator_new( size_t size, const char * file, const int line );
SCL_BASE_EXPORT void scl_operator_delete( void * addr, const char *file, const int line );
SCL_BASE_EXPORT void scl_operator_delete( void * addr );
#endif /* __cplusplus */
#ifndef SCL_MEMMGR_CC
#define scl_malloc(size) scl_malloc_fn(size, __FILE__, __LINE__)
#define scl_calloc(count, size) scl_calloc_fn(count, size, __FILE__, __LINE__)
#define scl_realloc(addr, size) scl_realloc_fn(addr, size, __FILE__, __LINE__)
#define scl_free(addr) scl_free_fn(addr)
#ifdef __cplusplus
#include <new>
inline void * operator new( size_t size, const char *file, const int line ) THROW_STD_BAD_ALLOC {
return scl_operator_new(size, file, line);
}
inline void * operator new[]( size_t size, const char *file, const int line ) THROW_STD_BAD_ALLOC {
return scl_operator_new(size, file, line);
}
inline void operator delete( void *addr, const char *file, const int line ) THROW_STD_BAD_ALLOC {
scl_operator_delete(addr, file, line);
}
inline void operator delete[]( void *addr, const char *file, const int line ) THROW_STD_BAD_ALLOC {
scl_operator_delete(addr, file, line);
}
inline void operator delete( void * addr ) THROW_EMPTY {
scl_operator_delete(addr);
}
inline void operator delete[]( void * addr ) THROW_EMPTY {
scl_operator_delete(addr);
}
#define new new(__FILE__, __LINE__)
#endif /* __cplusplus */
#endif /* SCL_MEMMGR_CC */
#endif /* SCL_MEMMGR_H */
+16
View File
@@ -0,0 +1,16 @@
#include <stdarg.h>
#include <stdio.h>
#include "scl_trace_fprintf.h"
void trace_fprintf (char const *sourcefile, int line, FILE* file, const char *format, ...) {
va_list args;
if( (file != stdout) && (file != stderr ) ) {
fprintf(file, "/* source: %s:%d */", sourcefile, line);
}
va_start (args, format);
vfprintf(file, format, args);
va_end (args);
}
+32
View File
@@ -0,0 +1,32 @@
#ifndef SCL_TRACE_FPRINTF_H
#define SCL_TRACE_FPRINTF_H
/** \file scl_trace_fprintf.h
* Used to track the source file and line where generated code is printed from
* When enabled, comments are printed into the generated files for every 'fprintf':
* / * source: scl/src/fedex_plus/selects.c:1375 * /
* To enable, configure with 'cmake .. -DSCL_TRACE_FPRINTF=ON'
*
* This header must be included *after* all other headers, otherwise the compiler will
* report errors in system headers.
* \sa trace_fprintf
**/
#include "scl_export.h"
/** used to find where generated c++ originates from in fedex_plus
* To enable, configure with 'cmake .. -DSCL_TRACE_FPRINTF=ON'
*/
#ifdef __cplusplus
extern "C" {
#endif
SCL_BASE_EXPORT void trace_fprintf (char const *sourcefile, int line, FILE* file, const char *format, ...);
#ifdef __cplusplus
}
#endif
#ifdef SCL_TRACE_FPRINTF
# define fprintf(...) trace_fprintf(__FILE__, __LINE__, __VA_ARGS__)
#endif /* SCL_TRACE_FPRINTF */
#endif /* SCL_TRACE_FPRINTF_H */
@@ -16,11 +16,6 @@ extern ofstream * logStream;
static int debug_access_hooks = 0;
#ifdef PART26
const char * sclHostName = CORBA::Orbix.myHost(); // Default is local host
#endif
Schema * s_example_schema = 0;
/* ************** TYPES */
@@ -126,15 +121,6 @@ SdaiPoly_line::SdaiPoly_line( SdaiPoly_line & e ) {
}
SdaiPoly_line::~SdaiPoly_line() { }
#ifdef __O3DB__
void
SdaiPoly_line::oodb_reInit() {
eDesc = example_schemae_poly_line;
attributes [0].aDesc = a_0points;
}
#endif
SdaiPoly_line::SdaiPoly_line( SCLP23( Application_instance ) *se, int * addAttrs ) {
/* Set this to point to the head entity. */
HeadEntity( se );
@@ -199,17 +185,6 @@ SdaiShape::SdaiShape( SdaiShape & e ) {
}
SdaiShape::~SdaiShape() { }
#ifdef __O3DB__
void
SdaiShape::oodb_reInit() {
eDesc = example_schemae_shape;
attributes [0].aDesc = a_1item_name;
attributes [1].aDesc = a_2item_color;
attributes [2].aDesc = a_3number_of_sides;
}
#endif
SdaiShape::SdaiShape( SCLP23( Application_instance ) *se, int * addAttrs ) {
/* Set this to point to the head entity. */
HeadEntity( se );
@@ -363,15 +338,6 @@ create_SdaiRectangle( os_database * db ) {
}
#endif
#ifdef __O3DB__
void
SdaiRectangle::oodb_reInit() {
eDesc = example_schemae_rectangle;
attributes [3].aDesc = a_4height;
attributes [4].aDesc = a_5width;
}
#endif
SdaiRectangle::SdaiRectangle( SCLP23( Application_instance ) *se, int * addAttrs ) : SdaiShape( se, ( addAttrs ? &addAttrs[1] : 0 ) ) {
/* Set this to point to the head entity. */
HeadEntity( se );
@@ -450,13 +416,6 @@ SdaiSquare::SdaiSquare( SdaiSquare & e ) {
}
SdaiSquare::~SdaiSquare() { }
#ifdef __O3DB__
void
SdaiSquare::oodb_reInit() {
eDesc = example_schemae_square;
}
#endif
SdaiSquare::SdaiSquare( SCLP23( Application_instance ) *se, int * addAttrs ) : SdaiRectangle( se, ( addAttrs ? &addAttrs[1] : 0 ) ) {
/* Set this to point to the head entity. */
HeadEntity( se );
@@ -504,16 +463,6 @@ SdaiTriangle::SdaiTriangle( SdaiTriangle & e ) {
}
SdaiTriangle::~SdaiTriangle() { }
#ifdef __O3DB__
void
SdaiTriangle::oodb_reInit() {
eDesc = example_schemae_triangle;
attributes [3].aDesc = a_6side1_length;
attributes [4].aDesc = a_7side2_length;
attributes [5].aDesc = a_8side3_length;
}
#endif
SdaiTriangle::SdaiTriangle( SCLP23( Application_instance ) *se, int * addAttrs ) : SdaiShape( se, ( addAttrs ? &addAttrs[1] : 0 ) ) {
/* Set this to point to the head entity. */
HeadEntity( se );
@@ -620,14 +569,6 @@ SdaiCircle::SdaiCircle( SdaiCircle & e ) {
}
SdaiCircle::~SdaiCircle() { }
#ifdef __O3DB__
void
SdaiCircle::oodb_reInit() {
eDesc = example_schemae_circle;
attributes [3].aDesc = a_9radius;
}
#endif
SdaiCircle::SdaiCircle( SCLP23( Application_instance ) *se, int * addAttrs ) : SdaiShape( se, ( addAttrs ? &addAttrs[1] : 0 ) ) {
/* Set this to point to the head entity. */
HeadEntity( se );
@@ -691,16 +632,6 @@ SdaiLine::SdaiLine( SdaiLine & e ) {
}
SdaiLine::~SdaiLine() { }
#ifdef __O3DB__
void
SdaiLine::oodb_reInit() {
eDesc = example_schemae_line;
attributes [0].aDesc = a_10end_point_one;
attributes [1].aDesc = a_11end_point_two;
}
#endif
SdaiLine::SdaiLine( SCLP23( Application_instance ) *se, int * addAttrs ) {
/* Set this to point to the head entity. */
HeadEntity( se );
@@ -788,16 +719,6 @@ SdaiCartesian_point::SdaiCartesian_point( SdaiCartesian_point & e ) {
}
SdaiCartesian_point::~SdaiCartesian_point() { }
#ifdef __O3DB__
void
SdaiCartesian_point::oodb_reInit() {
eDesc = example_schemae_cartesian_point;
attributes [0].aDesc = a_12x;
attributes [1].aDesc = a_13y;
attributes [2].aDesc = a_14z;
}
#endif
SdaiCartesian_point::SdaiCartesian_point( SCLP23( Application_instance ) *se, int * addAttrs ) {
/* Set this to point to the head entity. */
HeadEntity( se );
+242 -285
View File
@@ -5,450 +5,407 @@
// regenerate it.
/* $Id$ */
#ifdef __O3DB__
#include <OpenOODB.h>
#endif
#ifndef SCHEMA_H
#include <schema.h>
#endif
#ifdef PART26
#include <corbaIncludes.h>
// Create a corbaSchema.h file in this directory with a #include in
// it for your IDL generated schema-specific .hh file.
#include <corbaSchema.h>
#endif
/* ************** TYPES */
/* ************** TYPES */
////////// ENUMERATION TYPE color
enum Color {
Color__red,
Color__green,
Color__blue,
Color__yellow,
Color__orange,
Color__white,
Color__black,
Color__brown,
Color_unset
Color__red,
Color__green,
Color__blue,
Color__yellow,
Color__orange,
Color__white,
Color__black,
Color__brown,
Color_unset
};
class SdaiColor_var : public SCLP23(Enum) {
class SdaiColor_var : public SCLP23( Enum ) {
protected:
EnumTypeDescriptor *type;
protected:
EnumTypeDescriptor * type;
public:
SdaiColor_var (const char * n =0, EnumTypeDescriptor *et =example_schemat_color);
SdaiColor_var (Color e, EnumTypeDescriptor *et =example_schemat_color)
: type(et) { set_value (e); }
~SdaiColor_var () { }
SdaiColor_var& operator= (const SdaiColor_var& e)
{ set_value (e); return *this; }
operator Color () const;
public:
SdaiColor_var( const char * n = 0, EnumTypeDescriptor * et = example_schemat_color );
SdaiColor_var( Color e, EnumTypeDescriptor * et = example_schemat_color )
: type( et ) {
set_value( e );
}
~SdaiColor_var() { }
SdaiColor_var & operator= ( const SdaiColor_var & e ) {
set_value( e );
return *this;
}
operator Color() const;
inline virtual const char * Name () const
{ return type->Name(); }
inline virtual int no_elements () const { return 8; }
virtual const char * element_at (int n) const;
inline virtual const char * Name() const {
return type->Name();
}
inline virtual int no_elements() const {
return 8;
}
virtual const char * element_at( int n ) const;
};
typedef SdaiColor_var * SdaiColor_var_ptr;
SCLP23(Enum) * create_SdaiColor_var ();
SCLP23( Enum ) * create_SdaiColor_var();
class SdaiColor_vars : public EnumAggregate {
protected:
EnumTypeDescriptor *enum_type;
protected:
EnumTypeDescriptor * enum_type;
public:
SdaiColor_vars( EnumTypeDescriptor * =example_schemat_color);
virtual ~SdaiColor_vars();
virtual SingleLinkNode * NewNode()
{ return new EnumNode (new SdaiColor_var( "", enum_type )); }
public:
SdaiColor_vars( EnumTypeDescriptor * = example_schemat_color );
virtual ~SdaiColor_vars();
virtual SingleLinkNode * NewNode() {
return new EnumNode( new SdaiColor_var( "", enum_type ) );
}
};
typedef SdaiColor_vars * SdaiColor_vars_ptr;
STEPaggregate * create_SdaiColor_vars ();
STEPaggregate * create_SdaiColor_vars();
////////// END ENUMERATION color
// ***** Build the SELECT Types
// ***** Build the SELECT Types
/* ************** ENTITIES */
/* ************** ENTITIES */
// ***** Print Entity Classes
// ***** Print Entity Classes
///////// ENTITY poly_line
///////// ENTITY poly_line
extern AttrDescriptor *a_0points;
extern AttrDescriptor * a_0points;
class SdaiPoly_line : public SCLP23(Application_instance) {
class SdaiPoly_line : public SCLP23( Application_instance ) {
protected:
EntityAggregate _points ; // of line
protected:
EntityAggregate _points ; // of line
public:
public:
SdaiPoly_line ( );
SdaiPoly_line (SCLP23(Application_instance) *se, int *addAttrs = 0);
SdaiPoly_line (SdaiPoly_line& e );
~SdaiPoly_line ();
SdaiPoly_line( );
SdaiPoly_line( SCLP23( Application_instance ) *se, int * addAttrs = 0 );
SdaiPoly_line( SdaiPoly_line & e );
~SdaiPoly_line();
#ifdef __O3DB__
void oodb_reInit();
#endif
int opcode () { return 0 ; }
const EntityAggregate_ptr points_() const;
void points_ (const EntityAggregate_ptr x);
int opcode() {
return 0 ;
}
const EntityAggregate_ptr points_() const;
void points_( const EntityAggregate_ptr x );
};
#ifdef __O3DB__
inline SCLP23(Application_instance_ptr)
create_SdaiPoly_line () { return (SCLP23(Application_instance_ptr)) new SdaiPoly_line ; }
#else
inline SdaiPoly_line *
create_SdaiPoly_line () { return new SdaiPoly_line ; }
#endif
create_SdaiPoly_line() {
return new SdaiPoly_line ;
}
///////// END_ENTITY poly_line
///////// END_ENTITY poly_line
///////// ENTITY shape
///////// ENTITY shape
extern AttrDescriptor *a_1item_name;
extern AttrDescriptor *a_2item_color;
extern AttrDescriptor *a_3number_of_sides;
extern AttrDescriptor * a_1item_name;
extern AttrDescriptor * a_2item_color;
extern AttrDescriptor * a_3number_of_sides;
class SdaiShape : public SCLP23(Application_instance) {
class SdaiShape : public SCLP23( Application_instance ) {
protected:
SCLP23(String) _item_name ;
SdaiColor_var _item_color ; // OPTIONAL
SCLP23(Integer) _number_of_sides ;
public:
protected:
SCLP23( String ) _item_name ;
SdaiColor_var _item_color ; // OPTIONAL
SCLP23( Integer ) _number_of_sides ;
public:
SdaiShape ( );
SdaiShape (SCLP23(Application_instance) *se, int *addAttrs = 0);
SdaiShape (SdaiShape& e );
~SdaiShape ();
SdaiShape( );
SdaiShape( SCLP23( Application_instance ) *se, int * addAttrs = 0 );
SdaiShape( SdaiShape & e );
~SdaiShape();
#ifdef __O3DB__
void oodb_reInit();
#endif
int opcode() {
return 1 ;
}
const SdaiLabel item_name_() const;
void item_name_( const SdaiLabel x );
int opcode () { return 1 ; }
const SdaiLabel item_name_() const;
void item_name_ (const SdaiLabel x);
const SdaiColor_var item_color_() const;
void item_color_( const SdaiColor_var x );
const SdaiColor_var item_color_() const;
void item_color_ (const SdaiColor_var x);
const SCLP23(Integer) number_of_sides_() const;
void number_of_sides_ (const SCLP23(Integer) x);
const SCLP23( Integer ) number_of_sides_() const;
void number_of_sides_( const SCLP23( Integer ) x );
};
#ifdef __O3DB__
inline SCLP23(Application_instance_ptr)
create_SdaiShape () { return (SCLP23(Application_instance_ptr)) new SdaiShape ; }
#else
inline SdaiShape *
create_SdaiShape () { return new SdaiShape ; }
#endif
create_SdaiShape() {
return new SdaiShape ;
}
///////// END_ENTITY shape
///////// END_ENTITY shape
///////// ENTITY rectangle
///////// ENTITY rectangle
extern AttrDescriptor *a_4height;
extern AttrDescriptor *a_5width;
extern AttrDescriptor * a_4height;
extern AttrDescriptor * a_5width;
class SdaiRectangle : public SdaiShape {
protected:
SCLP23(Real) _height ;
SCLP23(Real) _width ;
public:
SdaiRectangle ( );
SdaiRectangle (SCLP23(Application_instance) *se, int *addAttrs = 0);
SdaiRectangle (SdaiRectangle& e );
~SdaiRectangle ();
protected:
SCLP23( Real ) _height ;
SCLP23( Real ) _width ;
public:
#ifdef __O3DB__
void oodb_reInit();
#endif
SdaiRectangle( );
SdaiRectangle( SCLP23( Application_instance ) *se, int * addAttrs = 0 );
SdaiRectangle( SdaiRectangle & e );
~SdaiRectangle();
int opcode () { return 2 ; }
const SdaiLength_measure height_() const;
void height_ (const SdaiLength_measure x);
int opcode() {
return 2 ;
}
const SdaiLength_measure height_() const;
void height_( const SdaiLength_measure x );
const SdaiLength_measure width_() const;
void width_ (const SdaiLength_measure x);
const SdaiLength_measure width_() const;
void width_( const SdaiLength_measure x );
/* The first parent's access functions are */
/* above or covered by inherited functions. */
/* The first parent's access functions are */
/* above or covered by inherited functions. */
};
#ifdef __O3DB__
inline SCLP23(Application_instance_ptr)
create_SdaiRectangle () { return (SCLP23(Application_instance_ptr)) new SdaiRectangle ; }
#else
inline SdaiRectangle *
create_SdaiRectangle () { return new SdaiRectangle ; }
#endif
create_SdaiRectangle() {
return new SdaiRectangle ;
}
///////// END_ENTITY rectangle
///////// END_ENTITY rectangle
///////// ENTITY square
///////// ENTITY square
class SdaiSquare : public SdaiRectangle {
protected:
public:
SdaiSquare ( );
SdaiSquare (SCLP23(Application_instance) *se, int *addAttrs = 0);
SdaiSquare (SdaiSquare& e );
~SdaiSquare ();
protected:
public:
#ifdef __O3DB__
void oodb_reInit();
#endif
SdaiSquare( );
SdaiSquare( SCLP23( Application_instance ) *se, int * addAttrs = 0 );
SdaiSquare( SdaiSquare & e );
~SdaiSquare();
int opcode () { return 3 ; }
/* The first parent's access functions are */
/* above or covered by inherited functions. */
int opcode() {
return 3 ;
}
/* The first parent's access functions are */
/* above or covered by inherited functions. */
};
#ifdef __O3DB__
inline SCLP23(Application_instance_ptr)
create_SdaiSquare () { return (SCLP23(Application_instance_ptr)) new SdaiSquare ; }
#else
inline SdaiSquare *
create_SdaiSquare () { return new SdaiSquare ; }
#endif
create_SdaiSquare() {
return new SdaiSquare ;
}
///////// END_ENTITY square
///////// END_ENTITY square
///////// ENTITY triangle
///////// ENTITY triangle
extern AttrDescriptor *a_6side1_length;
extern AttrDescriptor *a_7side2_length;
extern AttrDescriptor *a_8side3_length;
extern AttrDescriptor * a_6side1_length;
extern AttrDescriptor * a_7side2_length;
extern AttrDescriptor * a_8side3_length;
class SdaiTriangle : public SdaiShape {
protected:
SCLP23(Real) _side1_length ;
SCLP23(Real) _side2_length ;
SCLP23(Real) _side3_length ;
public:
SdaiTriangle ( );
SdaiTriangle (SCLP23(Application_instance) *se, int *addAttrs = 0);
SdaiTriangle (SdaiTriangle& e );
~SdaiTriangle ();
protected:
SCLP23( Real ) _side1_length ;
SCLP23( Real ) _side2_length ;
SCLP23( Real ) _side3_length ;
public:
#ifdef __O3DB__
void oodb_reInit();
#endif
SdaiTriangle( );
SdaiTriangle( SCLP23( Application_instance ) *se, int * addAttrs = 0 );
SdaiTriangle( SdaiTriangle & e );
~SdaiTriangle();
int opcode () { return 4 ; }
const SdaiLength_measure side1_length_() const;
void side1_length_ (const SdaiLength_measure x);
int opcode() {
return 4 ;
}
const SdaiLength_measure side1_length_() const;
void side1_length_( const SdaiLength_measure x );
const SdaiLength_measure side2_length_() const;
void side2_length_ (const SdaiLength_measure x);
const SdaiLength_measure side2_length_() const;
void side2_length_( const SdaiLength_measure x );
const SdaiLength_measure side3_length_() const;
void side3_length_ (const SdaiLength_measure x);
const SdaiLength_measure side3_length_() const;
void side3_length_( const SdaiLength_measure x );
/* The first parent's access functions are */
/* above or covered by inherited functions. */
/* The first parent's access functions are */
/* above or covered by inherited functions. */
};
#ifdef __O3DB__
inline SCLP23(Application_instance_ptr)
create_SdaiTriangle () { return (SCLP23(Application_instance_ptr)) new SdaiTriangle ; }
#else
inline SdaiTriangle *
create_SdaiTriangle () { return new SdaiTriangle ; }
#endif
create_SdaiTriangle() {
return new SdaiTriangle ;
}
///////// END_ENTITY triangle
///////// END_ENTITY triangle
///////// ENTITY circle
///////// ENTITY circle
extern AttrDescriptor *a_9radius;
extern AttrDescriptor * a_9radius;
class SdaiCircle : public SdaiShape {
protected:
SCLP23(Real) _radius ;
public:
SdaiCircle ( );
SdaiCircle (SCLP23(Application_instance) *se, int *addAttrs = 0);
SdaiCircle (SdaiCircle& e );
~SdaiCircle ();
protected:
SCLP23( Real ) _radius ;
public:
#ifdef __O3DB__
void oodb_reInit();
#endif
SdaiCircle( );
SdaiCircle( SCLP23( Application_instance ) *se, int * addAttrs = 0 );
SdaiCircle( SdaiCircle & e );
~SdaiCircle();
int opcode () { return 5 ; }
const SCLP23(Real) radius_() const;
void radius_ (const SCLP23(Real) x);
int opcode() {
return 5 ;
}
const SCLP23( Real ) radius_() const;
void radius_( const SCLP23( Real ) x );
/* The first parent's access functions are */
/* above or covered by inherited functions. */
/* The first parent's access functions are */
/* above or covered by inherited functions. */
};
#ifdef __O3DB__
inline SCLP23(Application_instance_ptr)
create_SdaiCircle () { return (SCLP23(Application_instance_ptr)) new SdaiCircle ; }
#else
inline SdaiCircle *
create_SdaiCircle () { return new SdaiCircle ; }
#endif
create_SdaiCircle() {
return new SdaiCircle ;
}
///////// END_ENTITY circle
///////// END_ENTITY circle
///////// ENTITY line
///////// ENTITY line
extern AttrDescriptor *a_10end_point_one;
extern AttrDescriptor *a_11end_point_two;
extern AttrDescriptor * a_10end_point_one;
extern AttrDescriptor * a_11end_point_two;
class SdaiLine : public SCLP23(Application_instance) {
class SdaiLine : public SCLP23( Application_instance ) {
protected:
SCLP23(Application_instance_ptr) _end_point_one ;
SCLP23(Application_instance_ptr) _end_point_two ;
public:
protected:
SCLP23( Application_instance_ptr ) _end_point_one ;
SCLP23( Application_instance_ptr ) _end_point_two ;
public:
SdaiLine ( );
SdaiLine (SCLP23(Application_instance) *se, int *addAttrs = 0);
SdaiLine (SdaiLine& e );
~SdaiLine ();
SdaiLine( );
SdaiLine( SCLP23( Application_instance ) *se, int * addAttrs = 0 );
SdaiLine( SdaiLine & e );
~SdaiLine();
#ifdef __O3DB__
void oodb_reInit();
#endif
int opcode() {
return 6 ;
}
const SdaiCartesian_point_ptr end_point_one_() const;
void end_point_one_( const SdaiCartesian_point_ptr x );
int opcode () { return 6 ; }
const SdaiCartesian_point_ptr end_point_one_() const;
void end_point_one_ (const SdaiCartesian_point_ptr x);
const SdaiCartesian_point_ptr end_point_two_() const;
void end_point_two_ (const SdaiCartesian_point_ptr x);
const SdaiCartesian_point_ptr end_point_two_() const;
void end_point_two_( const SdaiCartesian_point_ptr x );
};
#ifdef __O3DB__
inline SCLP23(Application_instance_ptr)
create_SdaiLine () { return (SCLP23(Application_instance_ptr)) new SdaiLine ; }
#else
inline SdaiLine *
create_SdaiLine () { return new SdaiLine ; }
#endif
create_SdaiLine() {
return new SdaiLine ;
}
///////// END_ENTITY line
///////// END_ENTITY line
///////// ENTITY cartesian_point
///////// ENTITY cartesian_point
extern AttrDescriptor *a_12x;
extern AttrDescriptor *a_13y;
extern AttrDescriptor *a_14z;
extern AttrDescriptor * a_12x;
extern AttrDescriptor * a_13y;
extern AttrDescriptor * a_14z;
class SdaiCartesian_point : public SCLP23(Application_instance) {
class SdaiCartesian_point : public SCLP23( Application_instance ) {
protected:
SCLP23(Real) _x ;
SCLP23(Real) _y ;
SCLP23(Real) _z ; // OPTIONAL
public:
protected:
SCLP23( Real ) _x ;
SCLP23( Real ) _y ;
SCLP23( Real ) _z ; // OPTIONAL
public:
SdaiCartesian_point ( );
SdaiCartesian_point (SCLP23(Application_instance) *se, int *addAttrs = 0);
SdaiCartesian_point (SdaiCartesian_point& e );
~SdaiCartesian_point ();
SdaiCartesian_point( );
SdaiCartesian_point( SCLP23( Application_instance ) *se, int * addAttrs = 0 );
SdaiCartesian_point( SdaiCartesian_point & e );
~SdaiCartesian_point();
#ifdef __O3DB__
void oodb_reInit();
#endif
int opcode() {
return 7 ;
}
const SdaiPoint x_() const;
void x_( const SdaiPoint x );
int opcode () { return 7 ; }
const SdaiPoint x_() const;
void x_ (const SdaiPoint x);
const SdaiPoint y_() const;
void y_( const SdaiPoint x );
const SdaiPoint y_() const;
void y_ (const SdaiPoint x);
const SdaiPoint z_() const;
void z_ (const SdaiPoint x);
const SdaiPoint z_() const;
void z_( const SdaiPoint x );
};
#ifdef __O3DB__
inline SCLP23(Application_instance_ptr)
create_SdaiCartesian_point () { return (SCLP23(Application_instance_ptr)) new SdaiCartesian_point ; }
#else
inline SdaiCartesian_point *
create_SdaiCartesian_point () { return new SdaiCartesian_point ; }
#endif
create_SdaiCartesian_point() {
return new SdaiCartesian_point ;
}
///////// END_ENTITY cartesian_point
///////// END_ENTITY cartesian_point
// ***** generate Model related pieces
// ***** generate Model related pieces
class SdaiModel_contents_example_schema : public SCLP23(Model_contents) {
class SdaiModel_contents_example_schema : public SCLP23( Model_contents ) {
public:
public:
SdaiModel_contents_example_schema();
SdaiModel_contents_example_schema();
SdaiPoly_line__set_var SdaiPoly_line_get_extents();
SdaiPoly_line__set_var SdaiPoly_line_get_extents();
SdaiShape__set_var SdaiShape_get_extents();
SdaiShape__set_var SdaiShape_get_extents();
SdaiRectangle__set_var SdaiRectangle_get_extents();
SdaiRectangle__set_var SdaiRectangle_get_extents();
SdaiSquare__set_var SdaiSquare_get_extents();
SdaiSquare__set_var SdaiSquare_get_extents();
SdaiTriangle__set_var SdaiTriangle_get_extents();
SdaiTriangle__set_var SdaiTriangle_get_extents();
SdaiCircle__set_var SdaiCircle_get_extents();
SdaiCircle__set_var SdaiCircle_get_extents();
SdaiLine__set_var SdaiLine_get_extents();
SdaiLine__set_var SdaiLine_get_extents();
SdaiCartesian_point__set_var SdaiCartesian_point_get_extents();
SdaiCartesian_point__set_var SdaiCartesian_point_get_extents();
};
@@ -456,6 +413,6 @@ class SdaiModel_contents_example_schema : public SCLP23(Model_contents) {
typedef SdaiModel_contents_example_schema * SdaiModel_contents_example_schema_ptr;
typedef SdaiModel_contents_example_schema_ptr SdaiModel_contents_example_schema_var;
SCLP23(Model_contents_ptr) create_SdaiModel_contents_example_schema();
SCLP23( Model_contents_ptr ) create_SdaiModel_contents_example_schema();
#endif
+57 -57
View File
@@ -3,85 +3,85 @@
// This file was generated by fedex_plus. You probably don't want to edit
// it since your modifications will be lost if fedex_plus is used to
// regenerate it.
/* $Id$ */
/* $Id$ */
#include <schema.h>
// Schema: SdaiEXAMPLE_SCHEMA
extern Schema * s_example_schema;
extern Schema * s_example_schema;
// Types:
class SdaiColor_vars;
extern EnumTypeDescriptor *example_schemat_color;
typedef SCLP23(String) SdaiLabel;
extern TypeDescriptor *example_schemat_label;
typedef SCLP23(Real) SdaiPoint;
extern TypeDescriptor *example_schemat_point;
typedef SCLP23(Real) SdaiLength_measure;
extern TypeDescriptor *example_schemat_length_measure;
extern EnumTypeDescriptor * example_schemat_color;
typedef SCLP23( String ) SdaiLabel;
extern TypeDescriptor * example_schemat_label;
typedef SCLP23( Real ) SdaiPoint;
extern TypeDescriptor * example_schemat_point;
typedef SCLP23( Real ) SdaiLength_measure;
extern TypeDescriptor * example_schemat_length_measure;
// Entities:
class SdaiPoly_line;
typedef SdaiPoly_line * SdaiPoly_lineH;
typedef SdaiPoly_line * SdaiPoly_line_ptr;
typedef SdaiPoly_line_ptr SdaiPoly_line_var;
#define SdaiPoly_line__set SCLP23(DAObject__set)
#define SdaiPoly_line__set_var SCLP23(DAObject__set_var)
extern EntityDescriptor *example_schemae_poly_line;
typedef SdaiPoly_line * SdaiPoly_lineH;
typedef SdaiPoly_line * SdaiPoly_line_ptr;
typedef SdaiPoly_line_ptr SdaiPoly_line_var;
#define SdaiPoly_line__set SCLP23(DAObject__set)
#define SdaiPoly_line__set_var SCLP23(DAObject__set_var)
extern EntityDescriptor * example_schemae_poly_line;
class SdaiShape;
typedef SdaiShape * SdaiShapeH;
typedef SdaiShape * SdaiShape_ptr;
typedef SdaiShape_ptr SdaiShape_var;
#define SdaiShape__set SCLP23(DAObject__set)
#define SdaiShape__set_var SCLP23(DAObject__set_var)
extern EntityDescriptor *example_schemae_shape;
typedef SdaiShape * SdaiShapeH;
typedef SdaiShape * SdaiShape_ptr;
typedef SdaiShape_ptr SdaiShape_var;
#define SdaiShape__set SCLP23(DAObject__set)
#define SdaiShape__set_var SCLP23(DAObject__set_var)
extern EntityDescriptor * example_schemae_shape;
class SdaiRectangle;
typedef SdaiRectangle * SdaiRectangleH;
typedef SdaiRectangle * SdaiRectangle_ptr;
typedef SdaiRectangle_ptr SdaiRectangle_var;
#define SdaiRectangle__set SCLP23(DAObject__set)
#define SdaiRectangle__set_var SCLP23(DAObject__set_var)
extern EntityDescriptor *example_schemae_rectangle;
typedef SdaiRectangle * SdaiRectangleH;
typedef SdaiRectangle * SdaiRectangle_ptr;
typedef SdaiRectangle_ptr SdaiRectangle_var;
#define SdaiRectangle__set SCLP23(DAObject__set)
#define SdaiRectangle__set_var SCLP23(DAObject__set_var)
extern EntityDescriptor * example_schemae_rectangle;
class SdaiSquare;
typedef SdaiSquare * SdaiSquareH;
typedef SdaiSquare * SdaiSquare_ptr;
typedef SdaiSquare_ptr SdaiSquare_var;
#define SdaiSquare__set SCLP23(DAObject__set)
#define SdaiSquare__set_var SCLP23(DAObject__set_var)
extern EntityDescriptor *example_schemae_square;
typedef SdaiSquare * SdaiSquareH;
typedef SdaiSquare * SdaiSquare_ptr;
typedef SdaiSquare_ptr SdaiSquare_var;
#define SdaiSquare__set SCLP23(DAObject__set)
#define SdaiSquare__set_var SCLP23(DAObject__set_var)
extern EntityDescriptor * example_schemae_square;
class SdaiTriangle;
typedef SdaiTriangle * SdaiTriangleH;
typedef SdaiTriangle * SdaiTriangle_ptr;
typedef SdaiTriangle_ptr SdaiTriangle_var;
#define SdaiTriangle__set SCLP23(DAObject__set)
#define SdaiTriangle__set_var SCLP23(DAObject__set_var)
extern EntityDescriptor *example_schemae_triangle;
typedef SdaiTriangle * SdaiTriangleH;
typedef SdaiTriangle * SdaiTriangle_ptr;
typedef SdaiTriangle_ptr SdaiTriangle_var;
#define SdaiTriangle__set SCLP23(DAObject__set)
#define SdaiTriangle__set_var SCLP23(DAObject__set_var)
extern EntityDescriptor * example_schemae_triangle;
class SdaiCircle;
typedef SdaiCircle * SdaiCircleH;
typedef SdaiCircle * SdaiCircle_ptr;
typedef SdaiCircle_ptr SdaiCircle_var;
#define SdaiCircle__set SCLP23(DAObject__set)
#define SdaiCircle__set_var SCLP23(DAObject__set_var)
extern EntityDescriptor *example_schemae_circle;
typedef SdaiCircle * SdaiCircleH;
typedef SdaiCircle * SdaiCircle_ptr;
typedef SdaiCircle_ptr SdaiCircle_var;
#define SdaiCircle__set SCLP23(DAObject__set)
#define SdaiCircle__set_var SCLP23(DAObject__set_var)
extern EntityDescriptor * example_schemae_circle;
class SdaiLine;
typedef SdaiLine * SdaiLineH;
typedef SdaiLine * SdaiLine_ptr;
typedef SdaiLine_ptr SdaiLine_var;
#define SdaiLine__set SCLP23(DAObject__set)
#define SdaiLine__set_var SCLP23(DAObject__set_var)
extern EntityDescriptor *example_schemae_line;
typedef SdaiLine * SdaiLineH;
typedef SdaiLine * SdaiLine_ptr;
typedef SdaiLine_ptr SdaiLine_var;
#define SdaiLine__set SCLP23(DAObject__set)
#define SdaiLine__set_var SCLP23(DAObject__set_var)
extern EntityDescriptor * example_schemae_line;
class SdaiCartesian_point;
typedef SdaiCartesian_point * SdaiCartesian_pointH;
typedef SdaiCartesian_point * SdaiCartesian_point_ptr;
typedef SdaiCartesian_point_ptr SdaiCartesian_point_var;
#define SdaiCartesian_point__set SCLP23(DAObject__set)
#define SdaiCartesian_point__set_var SCLP23(DAObject__set_var)
extern EntityDescriptor *example_schemae_cartesian_point;
typedef SdaiCartesian_point * SdaiCartesian_pointH;
typedef SdaiCartesian_point * SdaiCartesian_point_ptr;
typedef SdaiCartesian_point_ptr SdaiCartesian_point_var;
#define SdaiCartesian_point__set SCLP23(DAObject__set)
#define SdaiCartesian_point__set_var SCLP23(DAObject__set_var)
extern EntityDescriptor * example_schemae_cartesian_point;
#endif
+6 -10
View File
@@ -8,10 +8,6 @@
#include <sys/time.h>
#endif
#ifdef __O3DB__
#include <OpenOODB.h>
#endif
#include <sdai.h>
@@ -26,13 +22,13 @@
#include <STEPattribute.h>
#include <Sdaiclasses.h>
extern void SchemaInit (Registry &);
extern void InitSchemasAndEnts (Registry &);
#include <SdaiEXAMPLE_SCHEMA.h>
extern void SdaiEXAMPLE_SCHEMAInit (Registry & r);
extern void SchemaInit( Registry & );
extern void InitSchemasAndEnts( Registry & );
#include <SdaiEXAMPLE_SCHEMA.h>
extern void SdaiEXAMPLE_SCHEMAInit( Registry & r );
#include <complexSupport.h>
ComplexCollect *gencomplex();
ComplexCollect * gencomplex();
SCLP23(Model_contents_ptr) GetModelContents(char *schemaName);
SCLP23( Model_contents_ptr ) GetModelContents( char * schemaName );
#endif
+19 -4
View File
@@ -8,6 +8,9 @@ set(LIBSTEPDAI_SRCS
sdaiEntity_extent_set.cc
sdaiModel_contents.cc
sdaiModel_contents_list.cc
sdaiEnum.cc
sdaiString.cc
sdaiBinary.cc
)
SET(LIBSTEPDAI_PRIVATE_HDRS
@@ -20,16 +23,28 @@ SET(LIBSTEPDAI_PRIVATE_HDRS
sdaiObject.h
sdaiSession_instance.h
StrUtil.hh
sdaiEnum.h
sdaiString.h
sdaiBinary.h
)
IF(MSVC OR BORLAND)
add_definitions( -DSCL_DAI_DLL_EXPORTS )
add_definitions( -DSCL_BASE_DLL_IMPORTS )
add_definitions( -DSCL_UTILS_DLL_IMPORTS )
ENDIF()
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${SCL_SOURCE_DIR}/src/base
${SCL_SOURCE_DIR}/src/clstepcore
${SCL_SOURCE_DIR}/src/clutils
)
add_definitions(
-DHAVE_CONFIG_H
)
SCL_ADDLIB(stepdai "${LIBSTEPDAI_SRCS}" "steputils base")
SCL_ADDLIB(stepdai "${LIBSTEPDAI_SRCS}" "steputils stepcore")
if(APPLE)
if(SCL_BUILD_SHARED_LIBS)
set_target_properties(stepdai PROPERTIES LINK_FLAGS "-flat_namespace -undefined suppress")
endif(SCL_BUILD_SHARED_LIBS)
endif(APPLE)
+22 -21
View File
@@ -29,6 +29,7 @@
#include <memory.h>
#include <math.h>
#include "scl_memmgr.h"
// to help ObjectCenter
#ifndef HAVE_MEMMOVE
@@ -40,36 +41,36 @@ extern "C"
/*****************************************************************************/
SCLP23( Application_instance__set )::SCLP23_NAME( Application_instance__set )( int defaultSize ) {
SDAI_Application_instance__set::SDAI_Application_instance__set( int defaultSize ) {
_bufsize = defaultSize;
_buf = new SCLP23( Application_instance_ptr )[_bufsize];
_buf = new SDAI_Application_instance_ptr[_bufsize];
_count = 0;
}
SCLP23( Application_instance__set )::~SCLP23_NAME( Application_instance__set )() {
SDAI_Application_instance__set::~SDAI_Application_instance__set() {
delete _buf;
}
void SCLP23( Application_instance__set )::Check( int index ) {
SCLP23( Application_instance_ptr )* newbuf;
void SDAI_Application_instance__set::Check( int index ) {
SDAI_Application_instance_ptr * newbuf;
if( index >= _bufsize ) {
_bufsize = ( index + 1 ) * 2;
newbuf = new SCLP23( Application_instance_ptr )[_bufsize];
memmove( newbuf, _buf, _count * sizeof( SCLP23( Application_instance_ptr ) ) );
newbuf = new SDAI_Application_instance_ptr[_bufsize];
memmove( newbuf, _buf, _count * sizeof( SDAI_Application_instance_ptr ) );
delete _buf;
_buf = newbuf;
}
}
void SCLP23( Application_instance__set )::Insert( SCLP23( Application_instance_ptr ) v, int index ) {
SCLP23( Application_instance_ptr )* spot;
void SDAI_Application_instance__set::Insert( SDAI_Application_instance_ptr v, int index ) {
SDAI_Application_instance_ptr * spot;
index = ( index < 0 ) ? _count : index;
if( index < _count ) {
Check( _count + 1 );
spot = &_buf[index];
memmove( spot + 1, spot, ( _count - index )*sizeof( SCLP23( Application_instance_ptr ) ) );
memmove( spot + 1, spot, ( _count - index )*sizeof( SDAI_Application_instance_ptr ) );
} else {
Check( index );
@@ -79,14 +80,14 @@ void SCLP23( Application_instance__set )::Insert( SCLP23( Application_instance_p
++_count;
}
void SCLP23( Application_instance__set )::Append( SCLP23( Application_instance_ptr ) v ) {
void SDAI_Application_instance__set::Append( SDAI_Application_instance_ptr v ) {
int index = _count;
SCLP23( Application_instance_ptr )* spot;
SDAI_Application_instance_ptr * spot;
if( index < _count ) {
Check( _count + 1 );
spot = &_buf[index];
memmove( spot + 1, spot, ( _count - index )*sizeof( SCLP23( Application_instance_ptr ) ) );
memmove( spot + 1, spot, ( _count - index )*sizeof( SDAI_Application_instance_ptr ) );
} else {
Check( index );
@@ -96,22 +97,22 @@ void SCLP23( Application_instance__set )::Append( SCLP23( Application_instance_p
++_count;
}
void SCLP23( Application_instance__set )::Remove( int index ) {
void SDAI_Application_instance__set::Remove( int index ) {
if( 0 <= index && index < _count ) {
--_count;
SCLP23( Application_instance_ptr )* spot = &_buf[index];
memmove( spot, spot + 1, ( _count - index )*sizeof( SCLP23( Application_instance_ptr ) ) );
SDAI_Application_instance_ptr * spot = &_buf[index];
memmove( spot, spot + 1, ( _count - index )*sizeof( SDAI_Application_instance_ptr ) );
}
}
void SCLP23( Application_instance__set )::Remove( SCLP23( Application_instance_ptr ) a ) {
void SDAI_Application_instance__set::Remove( SDAI_Application_instance_ptr a ) {
int index = Index( a );
if( !( index < 0 ) ) {
Remove( index );
}
}
int SCLP23( Application_instance__set )::Index( SCLP23( Application_instance_ptr ) v ) {
int SDAI_Application_instance__set::Index( SDAI_Application_instance_ptr v ) {
for( int i = 0; i < _count; ++i ) {
if( _buf[i] == v ) {
return i;
@@ -120,7 +121,7 @@ int SCLP23( Application_instance__set )::Index( SCLP23( Application_instance_ptr
return -1;
}
SCLP23( Application_instance_ptr ) & SCLP23( Application_instance__set )::operator[]( int index ) {
SDAI_Application_instance_ptr & SDAI_Application_instance__set::operator[]( int index ) {
Check( index );
// _count = max(_count, index+1);
_count = ( ( _count > index + 1 ) ? _count : ( index + 1 ) );
@@ -128,11 +129,11 @@ SCLP23( Application_instance_ptr ) & SCLP23( Application_instance__set )::operat
}
int
SCLP23( Application_instance__set )::Count() {
SDAI_Application_instance__set::Count() {
return _count;
}
void
SCLP23( Application_instance__set )::Clear() {
SDAI_Application_instance__set::Clear() {
_count = 0;
}
+24 -24
View File
@@ -30,35 +30,35 @@
#ifndef SDAI_APPLICATION_INSTANCE_SET_h
#define SDAI_APPLICATION_INSTANCE_SET_h
#include <scl_export.h>
//#include <STEPentity.h>
class SCLP23_NAME(Application_instance__set);
typedef SCLP23_NAME(Application_instance__set) *
SCLP23_NAME(Application_instance__set_ptr);
typedef SCLP23_NAME(Application_instance__set_ptr)
SCLP23_NAME(Application_instance__set_var);
class SDAI_Application_instance__set;
typedef SDAI_Application_instance__set *
SDAI_Application_instance__set_ptr;
typedef SDAI_Application_instance__set_ptr
SDAI_Application_instance__set_var;
class SCLP23_NAME(Application_instance__set)
{
public:
SCLP23_NAME(Application_instance__set)(int = 16);
~SCLP23_NAME(Application_instance__set)();
class SCL_DAI_EXPORT SDAI_Application_instance__set {
public:
SDAI_Application_instance__set( int = 16 );
~SDAI_Application_instance__set();
SCLP23_NAME(Application_instance_ptr)& operator[](int index);
void Insert(SCLP23_NAME(Application_instance_ptr), int index);
void Append(SCLP23_NAME(Application_instance_ptr));
void Remove(int index);
void Remove(SCLP23_NAME(Application_instance_ptr));
int Index(SCLP23_NAME(Application_instance_ptr));
SDAI_Application_instance_ptr & operator[]( int index );
void Insert( SDAI_Application_instance_ptr, int index );
void Append( SDAI_Application_instance_ptr );
void Remove( int index );
void Remove( SDAI_Application_instance_ptr );
int Index( SDAI_Application_instance_ptr );
int Count();
void Clear();
private:
void Check(int index);
private:
SCLP23_NAME(Application_instance_ptr)* _buf;
int _bufsize;
int _count;
int Count();
void Clear();
private:
void Check( int index );
private:
SDAI_Application_instance_ptr * _buf;
int _bufsize;
int _count;
};
#endif
@@ -11,17 +11,37 @@
#include <sstream>
#include <sdai.h>
#include "scl_memmgr.h"
extern Severity CheckRemainingInput( istream & in, ErrorDescriptor * err,
const char * typeName, // used in error message
const char * tokenList ); // e.g. ",)"
SCLP23( Binary ) & SCLP23( Binary )::operator= ( const char * s ) {
std::string::operator= ( s );
SDAI_Binary::SDAI_Binary( const char * str, int max ) {
content = std::string( str, max );
}
SDAI_Binary::SDAI_Binary( const std::string & s ) {
content = std::string( s );
}
SDAI_Binary::~SDAI_Binary( void ) {
}
SDAI_Binary & SDAI_Binary::operator= ( const char * s ) {
content = std::string( s );
return *this;
}
void SCLP23( Binary )::STEPwrite( ostream & out ) const {
void SDAI_Binary::clear( void ) {
content.clear();
}
bool SDAI_Binary::empty( void ) const {
return content.empty();
}
const char * SDAI_Binary::c_str( void ) const {
return content.c_str();
}
void SDAI_Binary::STEPwrite( ostream & out ) const {
const char * str = 0;
if( empty() ) {
out << "$";
@@ -36,7 +56,7 @@ void SCLP23( Binary )::STEPwrite( ostream & out ) const {
}
}
const char * SCLP23( Binary )::STEPwrite( std::string & s ) const {
const char * SDAI_Binary::STEPwrite( std::string & s ) const {
const char * str = 0;
if( empty() ) {
s = "$";
@@ -52,8 +72,8 @@ const char * SCLP23( Binary )::STEPwrite( std::string & s ) const {
return const_cast<char *>( s.c_str() );
}
Severity SCLP23( Binary )::ReadBinary( istream & in, ErrorDescriptor * err, int AssignVal,
int needDelims ) {
Severity SDAI_Binary::ReadBinary( istream & in, ErrorDescriptor * err, int AssignVal,
int needDelims ) {
if( AssignVal ) {
clear();
}
@@ -123,7 +143,7 @@ Severity SCLP23( Binary )::ReadBinary( istream & in, ErrorDescriptor * err, int
return err->severity();
}
Severity SCLP23( Binary )::StrToVal( const char * s, ErrorDescriptor * err ) {
Severity SDAI_Binary::StrToVal( const char * s, ErrorDescriptor * err ) {
istringstream in( ( char * )s ); // sz defaults to length of s
return ReadBinary( in, err, 1, 0 );
}
@@ -131,11 +151,11 @@ Severity SCLP23( Binary )::StrToVal( const char * s, ErrorDescriptor * err ) {
/////////////////////////////////////////////////
/// reads a binary in exchange file format delimited by double quotes
Severity SCLP23( Binary )::STEPread( istream & in, ErrorDescriptor * err ) {
Severity SDAI_Binary::STEPread( istream & in, ErrorDescriptor * err ) {
return ReadBinary( in, err, 1, 1 );
}
Severity SCLP23( Binary )::STEPread( const char * s, ErrorDescriptor * err ) {
Severity SDAI_Binary::STEPread( const char * s, ErrorDescriptor * err ) {
istringstream in( ( char * )s );
return STEPread( in, err );
}
@@ -159,9 +179,9 @@ Severity SCLP23( Binary )::STEPread( const char * s, ErrorDescriptor * err ) {
** null then attrValue must only contain a valid value and nothing else
** following.
******************************************************************************/
Severity SCLP23( Binary )::BinaryValidLevel( istream & in, ErrorDescriptor * err,
int optional, char * tokenList,
int needDelims, int clearError ) {
Severity SDAI_Binary::BinaryValidLevel( istream & in, ErrorDescriptor * err,
int optional, char * tokenList,
int needDelims, int clearError ) {
if( clearError ) {
err->ClearErrorMsg();
}
@@ -194,9 +214,9 @@ Severity SCLP23( Binary )::BinaryValidLevel( istream & in, ErrorDescriptor * err
return err->severity();
}
Severity SCLP23( Binary )::BinaryValidLevel( const char * value, ErrorDescriptor * err,
int optional, char * tokenList,
int needDelims, int clearError ) {
Severity SDAI_Binary::BinaryValidLevel( const char * value, ErrorDescriptor * err,
int optional, char * tokenList,
int needDelims, int clearError ) {
istringstream in( ( char * )value );
return BinaryValidLevel( in, err, optional, tokenList,
needDelims, clearError );
+56
View File
@@ -0,0 +1,56 @@
#ifndef SDAIBINARY_H
#define SDAIBINARY_H 1
#include <scl_export.h>
#include <string>
/*
* NIST STEP Core Class Library
* clstepcore/sdaiBinary.h
* April 1997
* KC Morris
* Development of this software was funded by the United States Government,
* and is not subject to copyright.
*/
class SCL_DAI_EXPORT SDAI_Binary {
private:
std::string content;
public:
//constructor(s) & destructor
SDAI_Binary( const char * str = 0, int max = 0 );
SDAI_Binary( const std::string & s );
~SDAI_Binary( void );
// operators
SDAI_Binary & operator= ( const char * s );
void clear( void );
bool empty( void ) const;
const char * c_str( void ) const;
// format for STEP
const char * asStr() const {
return c_str();
}
void STEPwrite( ostream & out = cout ) const;
const char * STEPwrite( std::string & s ) const;
Severity StrToVal( const char * s, ErrorDescriptor * err );
Severity STEPread( istream & in, ErrorDescriptor * err );
Severity STEPread( const char * s, ErrorDescriptor * err );
Severity BinaryValidLevel( const char * value, ErrorDescriptor * err,
int optional, char * tokenList,
int needDelims = 0, int clearError = 1 );
Severity BinaryValidLevel( istream & in, ErrorDescriptor * err,
int optional, char * tokenList,
int needDelims = 0, int clearError = 1 );
protected:
Severity ReadBinary( istream & in, ErrorDescriptor * err, int AssignVal = 1,
int needDelims = 1 );
};
#endif
+35 -54
View File
@@ -3,6 +3,7 @@
#include <math.h>
#include <sdai.h>
#include "scl_memmgr.h"
// to help ObjectCenter
#ifndef HAVE_MEMMOVE
@@ -13,62 +14,42 @@ extern "C"
#endif
SCLP23( PID )::SCLP23_NAME( PID )() {
SDAI_PID::SDAI_PID() {
}
SCLP23( PID )::~SCLP23_NAME( PID )() {
SDAI_PID::~SDAI_PID() {
}
SCLP23( PID_DA )::SCLP23_NAME( PID_DA )() {
SDAI_PID_DA::SDAI_PID_DA() {
}
SCLP23( PID_DA )::~SCLP23_NAME( PID_DA )() {
SDAI_PID_DA::~SDAI_PID_DA() {
}
SCLP23( PID_SDAI )::SCLP23_NAME( PID_SDAI )() {
SDAI_PID_SDAI::SDAI_PID_SDAI() {
}
SCLP23( PID_SDAI )::~SCLP23_NAME( PID_SDAI )() {
SDAI_PID_SDAI::~SDAI_PID_SDAI() {
}
SCLP23( DAObject )::SCLP23_NAME( DAObject )() {
SDAI_DAObject::SDAI_DAObject() {
}
SCLP23( DAObject )::~SCLP23_NAME( DAObject )() {
SDAI_DAObject::~SDAI_DAObject() {
}
#ifdef PART26
//SCLP26(Application_instance_ptr)
IDL_Application_instance_ptr
SCLP23( DAObject )::create_TIE() {
cout << "ERROR DAObject::create_TIE() called." << endl;
return 0;
}
#endif
SCLP23( DAObject_SDAI )::SCLP23_NAME( DAObject_SDAI )() {
SDAI_DAObject_SDAI::SDAI_DAObject_SDAI() {
}
/*
SCLP23(DAObject_SDAI)::SCLP23_NAME(DAObject_SDAI)(const DAObject_SDAI&)
SDAI_DAObject_SDAI::SDAI_DAObject_SDAI(const DAObject_SDAI&)
{
}
*/
SCLP23( DAObject_SDAI )::~SCLP23_NAME( DAObject_SDAI )() {
SDAI_DAObject_SDAI::~SDAI_DAObject_SDAI() {
}
#ifdef PART26
//SCLP26(Application_instance_ptr)
IDL_Application_instance_ptr
SCLP23( DAObject_SDAI )::create_TIE() {
cout << "ERROR DAObject_SDAI::create_TIE() called." << endl;
return 0;
}
#endif
/*
* Copyright (c) 1990, 1991 Stanford University
*
@@ -97,39 +78,39 @@ SCLP23( DAObject_SDAI )::create_TIE() {
/*****************************************************************************/
SCLP23( DAObject__set )::SCLP23_NAME( DAObject__set )( int defaultSize ) {
SDAI_DAObject__set::SDAI_DAObject__set( int defaultSize ) {
_bufsize = defaultSize;
_buf = new SCLP23( DAObject_ptr )[_bufsize];
_buf = new SDAI_DAObject_ptr[_bufsize];
_count = 0;
}
SCLP23( DAObject__set )::~SCLP23_NAME( DAObject__set )() {
SDAI_DAObject__set::~SDAI_DAObject__set() {
delete _buf;
}
void SCLP23( DAObject__set )::Check( int index ) {
void SDAI_DAObject__set::Check( int index ) {
SCLP23( DAObject_ptr )* newbuf;
SDAI_DAObject_ptr * newbuf;
if( index >= _bufsize ) {
_bufsize = ( index + 1 ) * 2;
newbuf = new SCLP23( DAObject_ptr )[_bufsize];
memmove( newbuf, _buf, _count * sizeof( SCLP23( DAObject_ptr ) ) );
newbuf = new SDAI_DAObject_ptr[_bufsize];
memmove( newbuf, _buf, _count * sizeof( SDAI_DAObject_ptr ) );
delete _buf;
_buf = newbuf;
}
}
void
SCLP23( DAObject__set )::Insert( SCLP23( DAObject_ptr ) v, int index ) {
SDAI_DAObject__set::Insert( SDAI_DAObject_ptr v, int index ) {
SCLP23( DAObject_ptr )* spot;
SDAI_DAObject_ptr * spot;
index = ( index < 0 ) ? _count : index;
if( index < _count ) {
Check( _count + 1 );
spot = &_buf[index];
memmove( spot + 1, spot, ( _count - index )*sizeof( SCLP23( DAObject_ptr ) ) );
memmove( spot + 1, spot, ( _count - index )*sizeof( SDAI_DAObject_ptr ) );
} else {
Check( index );
@@ -139,15 +120,15 @@ SCLP23( DAObject__set )::Insert( SCLP23( DAObject_ptr ) v, int index ) {
++_count;
}
void SCLP23( DAObject__set )::Append( SCLP23( DAObject_ptr ) v ) {
void SDAI_DAObject__set::Append( SDAI_DAObject_ptr v ) {
int index = _count;
SCLP23( DAObject_ptr )* spot;
SDAI_DAObject_ptr * spot;
if( index < _count ) {
Check( _count + 1 );
spot = &_buf[index];
memmove( spot + 1, spot, ( _count - index )*sizeof( SCLP23( DAObject_ptr ) ) );
memmove( spot + 1, spot, ( _count - index )*sizeof( SDAI_DAObject_ptr ) );
} else {
Check( index );
@@ -157,16 +138,16 @@ void SCLP23( DAObject__set )::Append( SCLP23( DAObject_ptr ) v ) {
++_count;
}
void SCLP23( DAObject__set )::Remove( int index ) {
void SDAI_DAObject__set::Remove( int index ) {
if( 0 <= index && index < _count ) {
--_count;
SCLP23( DAObject_ptr )* spot = &_buf[index];
memmove( spot, spot + 1, ( _count - index )*sizeof( SCLP23( DAObject_ptr ) ) );
SDAI_DAObject_ptr * spot = &_buf[index];
memmove( spot, spot + 1, ( _count - index )*sizeof( SDAI_DAObject_ptr ) );
}
}
int SCLP23( DAObject__set )::Index( SCLP23( DAObject_ptr ) v ) {
int SDAI_DAObject__set::Index( SDAI_DAObject_ptr v ) {
for( int i = 0; i < _count; ++i ) {
if( _buf[i] == v ) {
@@ -176,12 +157,12 @@ int SCLP23( DAObject__set )::Index( SCLP23( DAObject_ptr ) v ) {
return -1;
}
SCLP23( DAObject_ptr )
SCLP23( DAObject__set )::retrieve( int index ) {
SDAI_DAObject_ptr
SDAI_DAObject__set::retrieve( int index ) {
return operator[]( index );
}
SCLP23( DAObject_ptr ) & SCLP23( DAObject__set )::operator[]( int index ) {
SDAI_DAObject_ptr & SDAI_DAObject__set::operator[]( int index ) {
Check( index );
// _count = max(_count, index+1);
@@ -190,16 +171,16 @@ SCLP23( DAObject_ptr ) & SCLP23( DAObject__set )::operator[]( int index ) {
}
int
SCLP23( DAObject__set )::Count() {
SDAI_DAObject__set::Count() {
return _count;
}
int
SCLP23( DAObject__set )::is_empty() {
SDAI_DAObject__set::is_empty() {
return _count;
}
void
SCLP23( DAObject__set )::Clear() {
SDAI_DAObject__set::Clear() {
_count = 0;
}
+315 -303
View File
@@ -1,90 +1,94 @@
#ifndef SDAIDAOBJECT_H
#define SDAIDAOBJECT_H 1
typedef char* SCLP23_NAME(DAObjectID);
#include <scl_export.h>
// 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.
//
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
clause 10 in ISO 10303-22, shall be mapped to the C++ class
Application_instance. The class Application_instance shall be a subtype of
the C++ class DAObject and of the C++ class Entity_instance.
The class DAObject is supported by the classes PID, PID_SDAI and the type
SCLP23(DAObjectID) as follows:
The EXPRESS ENTITY application_instance from the SDAI_data_type_schema from
clause 10 in ISO 10303-22, shall be mapped to the C++ class
Application_instance. The class Application_instance shall be a subtype of
the C++ class DAObject and of the C++ class Entity_instance.
The class DAObject is supported by the classes PID, PID_SDAI and the type
SDAI_DAObjectID as follows:
*/
class SCLP23_NAME(PID) : public SCLP23_NAME(sdaiObject)
{
public:
class SCL_DAI_EXPORT SDAI_PID : public SDAI_sdaiObject {
public:
// These are in the IDL generated code for Part 26. I will have to think about
// These are in the IDL generated code for Part 26. I will have to think about
// why they should be here (for Part 23). DAS
// static PID_ptr _duplicate(PID_ptr);
// static PID_ptr _narrow(SCLP23_NAME(sdaiObject_ptr));
// static PID_ptr _narrow(SDAI_sdaiObject_ptr);
// static PID_ptr _nil();
SCLP23_NAME(String) _datastore_type ;
SCLP23_NAME(String) _pidstring ;
SDAI_String _datastore_type ;
SDAI_String _pidstring ;
// constructor/destructor
SCLP23_NAME(PID)();
virtual ~SCLP23_NAME(PID)();
// constructor/destructor
SDAI_PID();
virtual ~SDAI_PID();
/*
The Datestore_type attribute shall identify the type of the underlying
datastore.
*/
char* Datastore_type() const { return const_cast<char *>(_datastore_type.c_str()); }
void Datastore_type(char *x) { _datastore_type = x; }
/*
The Datestore_type attribute shall identify the type of the underlying
datastore.
*/
char * Datastore_type() const {
return const_cast<char *>( _datastore_type.c_str() );
}
void Datastore_type( char * x ) {
_datastore_type = x;
}
/*
This function shall return a string version of the receiver.
*/
char* get_PIDString();
/*
This function shall return a string version of the receiver.
*/
char * get_PIDString();
};
typedef SCLP23_NAME(PID)* SCLP23_NAME(PID_ptr);
typedef SCLP23_NAME(PID_ptr) SCLP23_NAME(PID_var);
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
// in a Data Definition Language (DDL). An object using this protocol
// whould represent its persistent data as one or more interconnected
// data objects, For uniformity, the persistent data of an object is
// described as a single data object; however, that data object might be
// the root of a graph of data objects interconnected by stored data
// object references. If an object uses multiple data objects, the
// object traverses the graph by following stored data object references.
//
// The PID_DA class maintains the persistent object identifier for an
// application DAObject.
//
// POS: The Persistent Identifiers (PIDs) used by the PDS_DA contain
// an object identifier that is local to the particular PDS. This value
// may be accessed through this extension to the CosPersistencePID
// interface.
//
// 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
// in a Data Definition Language (DDL). An object using this protocol
// whould represent its persistent data as one or more interconnected
// data objects, For uniformity, the persistent data of an object is
// described as a single data object; however, that data object might be
// the root of a graph of data objects interconnected by stored data
// object references. If an object uses multiple data objects, the
// object traverses the graph by following stored data object references.
//
// The PID_DA class maintains the persistent object identifier for an
// application DAObject.
//
// POS: The Persistent Identifiers (PIDs) used by the PDS_DA contain
// an object identifier that is local to the particular PDS. This value
// may be accessed through this extension to the CosPersistencePID
// interface.
//
class SCLP23_NAME(PID_DA): public SCLP23_NAME(PID)
{
public:
class SCL_DAI_EXPORT SDAI_PID_DA: public SDAI_PID {
public:
SCLP23_NAME(String) _oid ;
SDAI_String _oid ;
// oid (ISO/DIS 10303-23:1996(E) 5.3.10.3)
//
// This attribute shall set and return the string representation of the
@@ -92,71 +96,76 @@ class SCLP23_NAME(PID_DA): public SCLP23_NAME(PID)
// referred to by this object.
//
// POS: This returns the data object identifier used by this PDS for
// the data object specified by the PID. The SCLP23(DAObjectID) type is
// defined as an unbounded sequence of bytes that may be
// the data object specified by the PID. The SDAI_DAObjectID type is
// defined as an unbounded sequence of bytes that may be
// vendor-dependent.
//
// constructor/destructor
SCLP23_NAME(PID_DA)();
virtual ~SCLP23_NAME(PID_DA)();
// constructor/destructor
SDAI_PID_DA();
virtual ~SDAI_PID_DA();
virtual void oid (const SCLP23_NAME(DAObjectID) x) { _oid = x; }
virtual SCLP23_NAME(DAObjectID) oid () const
{ return const_cast<char *>(_oid.c_str()); }
virtual void oid( const SDAI_DAObjectID x ) {
_oid = x;
}
virtual SDAI_DAObjectID oid() const {
return const_cast<char *>( _oid.c_str() );
}
};
typedef SCLP23_NAME(PID_DA)* SCLP23_NAME(PID_DA_ptr);
typedef SCLP23_NAME(PID_DA_ptr) SCLP23_NAME(PID_DA_var);
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.
//
class SCLP23_NAME(PID_SDAI) : public SCLP23_NAME(PID)
{
public:
SCLP23_NAME(String) _modelid ;
// 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.
//
class SCL_DAI_EXPORT SDAI_PID_SDAI : public SDAI_PID {
public:
SDAI_String _modelid ;
// constructor/destructor
SCLP23_NAME(PID_SDAI)();
virtual ~SCLP23_NAME(PID_SDAI)();
// constructor/destructor
SDAI_PID_SDAI();
virtual ~SDAI_PID_SDAI();
// Modelid (ISO/DIS 10303-23:1996(E) 5.3.10.3)
//
// This attribute shall set and return the string representation of
// the persistent identifier of the cluster of data for the
// the persistent identifier of the cluster of data for the
// Model_contents referred to by this PID.
//
virtual void Modelid (const char * x) { _modelid = x; }
virtual char * Modelid () const { return const_cast<char *>(_modelid.c_str()); }
virtual void Modelid( const char * x ) {
_modelid = x;
}
virtual char * Modelid() const {
return const_cast<char *>( _modelid.c_str() );
}
};
typedef SCLP23_NAME(PID_SDAI)* SCLP23_NAME(PID_SDAI_ptr);
typedef SCLP23_NAME(PID_SDAI_ptr) SCLP23_NAME(PID_SDAI_var);
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
// for these operations automatically for its data objects. A data object
// is not required to support this interface. A client can obtain access
// to these operations by narrowing a data object reference to the
// DAObject interface.
//
// 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
// for these operations automatically for its data objects. A data object
// is not required to support this interface. A client can obtain access
// to these operations by narrowing a data object reference to the
// DAObject interface.
//
// predefine these _ptr since they are used inside this class
class SCLP23_NAME(DAObject);
typedef SCLP23_NAME(DAObject)* SCLP23_NAME(DAObject_ptr);
typedef SCLP23_NAME(DAObject_ptr) SCLP23_NAME(DAObject_var);
// predefine these _ptr since they are used inside this class
class SDAI_DAObject;
typedef SDAI_DAObject * SDAI_DAObject_ptr;
typedef SDAI_DAObject_ptr SDAI_DAObject_var;
class SCLP23_NAME(DAObject) : public SCLP23_NAME(sdaiObject)
{
public:
class SCL_DAI_EXPORT SDAI_DAObject : public SDAI_sdaiObject {
public:
SCLP23_NAME(String) _dado_oid;
SDAI_String _dado_oid;
// dado_same (ISO/DIS 10303-23:1996(E) 5.3.10.5)
//
@@ -168,13 +177,13 @@ class SCLP23_NAME(DAObject) : public SCLP23_NAME(sdaiObject)
// identity.
//
// constructor/destructor
SCLP23_NAME(DAObject)();
virtual ~SCLP23_NAME(DAObject)();
// constructor/destructor
SDAI_DAObject();
virtual ~SDAI_DAObject();
Logical dado_same(SCLP23_NAME(DAObject_ptr) obj) {
return LUnknown;
}
Logical dado_same( SDAI_DAObject_ptr obj ) {
return LUnknown;
}
// Get persistent label (ISO/DIS 10303-22:1996(E) 10.11.6)
//
@@ -191,33 +200,36 @@ class SCLP23_NAME(DAObject) : public SCLP23_NAME(sdaiObject)
// sdaiTR_NAVL The transaction is currently not available
// sdaiTR_EAB The transaction ended abnormally
// sdaiRP_NOPN The repository is not open
// sdaiEI_NEXS The entity instance does not exist
// sdaiEI_NEXS The entity instance does not exist
// sdaiFN_NAVL This function is not supported by the implementation
// sdaiSY_ERR An underlying system error occurred
//
// POS specification description: This returns the object identifier
// for the data object. The scope of data object identifiers is
// implementation-specific, but is not guaranteed to be global.
//
//
/* jg == The return value of this function in Part 23 is PID_DA which
seems wrong. We follow the CORBAservices specification here.
(Persistent Object Service Specification, Section 5.10). Also
note that the return value as described in the text above
should be a string type.
*/
SCLP23_NAME(DAObjectID) dado_oid()
{ return const_cast<char *>(_dado_oid.c_str()); }
SDAI_DAObjectID dado_oid() {
return const_cast<char *>( _dado_oid.c_str() );
}
// dado_pid
//
// POS specification description: This returns a PID_DA for the
// POS specification description: This returns a PID_DA for the
// data object.
//
/* jg == This function is not included in Part 23 and 26. However, it is
/* jg == This function is not included in Part 23 and 26. However, it is
part of interface DAObject in the specification of the
Persistent Object Service.
Persistent Object Service.
*/
SCLP23_NAME(PID_DA_ptr) dado_pid() { return 0; }
SDAI_PID_DA_ptr dado_pid() {
return 0;
}
// dado_remove (ISO/DIS 10303-23:1996(E) 5.3.10.5)
//
@@ -228,281 +240,281 @@ class SCLP23_NAME(DAObject) : public SCLP23_NAME(sdaiObject)
// POS specification description: This deletes the object from the
// persistent store and deletes the in-memory data object.
//
void dado_remove() { }
void dado_remove() { }
// dado_free (ISO/DIS 10303-23:1996(E) 5.3.10.5)
//
//
// This function shall inform the implementation that it is free
// to move the object back to the persistent store.
//
// POS specification description: This informs the PDS (Persistent
//
// POS specification description: This informs the PDS (Persistent
// Data Service) that the data object is not required for the time
// being, and the PDS may move it back to persistent store. The data
// object must be preserved and must be brought back the next time it is
// object must be preserved and must be brought back the next time it is
// referenced. This operation is only a hint and is provided to improve
// performance and resource usage.
// performance and resource usage.
//
void dado_free() { }
void dado_free() { }
};
/*
5.3.10.1 DAObject_SDAI
*/
class SCLP23_NAME(DAObject_SDAI) : public SCLP23_NAME(DAObject) {
class SCL_DAI_EXPORT SDAI_DAObject_SDAI : public SDAI_DAObject {
public:
SCLP23_NAME(DAObject_SDAI)();
public:
SDAI_DAObject_SDAI();
virtual ~SCLP23_NAME(DAObject_SDAI)();
virtual ~SDAI_DAObject_SDAI();
/*
5.3.10.1.1 Find entity instance SDAI-model
*/
/*
5.3.10.1.1 Find entity instance SDAI-model
*/
// Model_ptr Owning_model() const;
/*
The Owning_model function shall implement the SDAI operation, Find
entity instance SDAI-model.
/*
The Owning_model function shall implement the SDAI operation, Find
entity instance SDAI-model.
The following specifies the coorespondence between each SDAI
input/output and its equivalent specified in this Part.
The following specifies the coorespondence between each SDAI
input/output and its equivalent specified in this Part.
SDAI C++
------ -------
Object receiver
Model return value
SDAI C++
------ -------
Object receiver
Model return value
5.3.10.1.2 Find entity instance users
*/
5.3.10.1.2 Find entity instance users
*/
// Object__list_var FindObjectUsers(const
// Schema_instance__list_var& aggr) const;
// Schema_instance__list_var& aggr) const;
/*
The FindObjectUsers function shall implement the SDAI operation,
Find entity instance users.
/*
The FindObjectUsers function shall implement the SDAI operation,
Find entity instance users.
The following specifies the coorespondence between each SDAI
input/output and its equivalent specified in this Part.
The following specifies the coorespondence between each SDAI
input/output and its equivalent specified in this Part.
SDAI C++
-------- --------
Instance receiver
Domain aggr
Result return value
SDAI C++
-------- --------
Instance receiver
Domain aggr
Result return value
5.3.10.1.3 Is same
*/
5.3.10.1.3 Is same
*/
Logical IsSame(const SCLP23_NAME(sdaiObject_ptr)& otherEntity) const;
Logical IsSame( const SDAI_sdaiObject_ptr & otherEntity ) const;
/*
Function:
The IsSame function shall determine whether the parameter otherEntity
refers to the same instance as the receiver. This function shall
implement the behaviour of the EXPRESS operator (:=:).
/*
Function:
The IsSame function shall determine whether the parameter otherEntity
refers to the same instance as the receiver. This function shall
implement the behaviour of the EXPRESS operator (:=:).
Output:
This function shall return TRUE if the two instances are identical.
This function shall return FALSE if the two instances are not identical.
This function shall return UNKNOWN if either instance is unset.
Output:
This function shall return TRUE if the two instances are identical.
This function shall return FALSE if the two instances are not identical.
This function shall return UNKNOWN if either instance is unset.
Possible error indicators:
sdaiMX_NDEF // SDAI-model access not defined
sdaiEI_NEXS // Entity instance does not exist
sdaiTY_NDEF // Type not defined
sdaiSY_ERR // Underlying system error
Possible error indicators:
sdaiMX_NDEF // SDAI-model access not defined
sdaiEI_NEXS // Entity instance does not exist
sdaiTY_NDEF // Type not defined
sdaiSY_ERR // Underlying system error
Origin: Convenience function
Origin: Convenience function
5.3.10.1.4 Get attribute
*/
5.3.10.1.4 Get attribute
*/
#ifdef SDAI_CPP_LATE_BINDING
Any_var GetAttr(const Attribute_ptr& attDef);
Any_var GetAttr(const char* attName);
Any_var GetAttr( const Attribute_ptr & attDef );
Any_var GetAttr( const char * attName );
#endif
/*
The GetAttr functions shall implement the SDAI operation, Get attribute.
/*
The GetAttr functions shall implement the SDAI operation, Get attribute.
The following specifies the coorespondence between each SDAI
input/output and its equivalent specified in this Part.
The following specifies the coorespondence between each SDAI
input/output and its equivalent specified in this Part.
SDAI C++
------ ---------
Object receiver
Attribute attDef, attName
Value return value
SDAI C++
------ ---------
Object receiver
Attribute attDef, attName
Value return value
5.3.10.1.5 Get instance type
*/
5.3.10.1.5 Get instance type
*/
#ifdef SDAI_CPP_LATE_BINDING
const Entity_ptr GetInstanceType() const;
const Entity_ptr GetInstanceType() const;
#endif
/*
Function:
/*
Function:
The GetInstanceType functions shall implement the SDAI operation,
Get instance type.
The GetInstanceType functions shall implement the SDAI operation,
Get instance type.
The following specifies the coorespondence between each SDAI
input/output and its equivalent specified in this Part.
The following specifies the coorespondence between each SDAI
input/output and its equivalent specified in this Part.
SDAI C++
------ --------
Object receiver
Type return value
SDAI C++
------ --------
Object receiver
Type return value
5.3.10.1.6 Is instance of
*/
5.3.10.1.6 Is instance of
*/
Boolean IsInstanceOf(const char* typeName) const;
::Boolean IsInstanceOf( const char * typeName ) const;
#ifdef SDAI_CPP_LATE_BINDING
Boolean IsInstanceOf(const Entity_ptr& otherEntity) const;
::Boolean IsInstanceOf( const Entity_ptr & otherEntity ) const;
#endif
/*
Function:
The IsInstanceOf functions shall implement the SDAI operation Is
instance of.
/*
Function:
The IsInstanceOf functions shall implement the SDAI operation Is
instance of.
The following specifies the coorespondence between each SDAI
input/output and its equivalent specified in this Part.
The following specifies the coorespondence between each SDAI
input/output and its equivalent specified in this Part.
SDAI C++
------ --------
Object receiver
Type typeName, otherEntity
Result return value
SDAI C++
------ --------
Object receiver
Type typeName, otherEntity
Result return value
5.3.10.1.7 Is kind of
*/
5.3.10.1.7 Is kind of
*/
Boolean IsKindOf(const char* typeName) const;
::Boolean IsKindOf( const char * typeName ) const;
#ifdef SDAI_CPP_LATE_BINDING
Boolean IsKindOf(const Entity_ptr& theType) const;
::Boolean IsKindOf( const Entity_ptr & theType ) const;
#endif
/*
The IsKindOf functions shall implement the SDAI operation, Is kind of.
/*
The IsKindOf functions shall implement the SDAI operation, Is kind of.
The following specifies the coorespondence between each SDAI
input/output and its equivalent specified in this Part.
The following specifies the coorespondence between each SDAI
input/output and its equivalent specified in this Part.
SDAI C++
------ --------
Object receiver
Type typeName, theType
Result return value
SDAI C++
------ --------
Object receiver
Type typeName, theType
Result return value
5.3.10.1.8 Is SDAI kind of
*/
5.3.10.1.8 Is SDAI kind of
*/
Boolean IsSDAIKindOf(const char* typeName) const;
::Boolean IsSDAIKindOf( const char * typeName ) const;
#ifdef SDAI_CPP_LATE_BINDING
Boolean IsSDAIKindOf(const Entity_ptr& theType) const;
::Boolean IsSDAIKindOf( const Entity_ptr & theType ) const;
#endif
/*
The IsSDAIKindOf functions shall implement the SDAI operation,
Is SDAI Kind Of.
/*
The IsSDAIKindOf functions shall implement the SDAI operation,
Is SDAI Kind Of.
The following specifies the coorespondence between each SDAI
input/output and its equivalent specified in this Part.
The following specifies the coorespondence between each SDAI
input/output and its equivalent specified in this Part.
SDAI C++
------ --------
Object receiver
Type typeName, theType
Result return value
SDAI C++
------ --------
Object receiver
Type typeName, theType
Result return value
5.3.10.1.9 Test attribute
*/
5.3.10.1.9 Test attribute
*/
#ifdef SDAI_CPP_LATE_BINDING
Boolean TestAttr(const Attribute_ptr& attDef);
Boolean TestAttr(const char* attName) const;
Boolean TestAttr( const Attribute_ptr & attDef );
Boolean TestAttr( const char * attName ) const;
#endif
/*
The TestAttr functions shall implement the SDAI operation,
Test attribute.
/*
The TestAttr functions shall implement the SDAI operation,
Test attribute.
The following specifies the coorespondence between each SDAI
input/output and its equivalent specified in this Part.
The following specifies the coorespondence between each SDAI
input/output and its equivalent specified in this Part.
SDAI C++
------ ---------
Object receiver
Attribute attDef, attName
Result return value
5.3.10.1.10 Get instance type name
*/
SDAI C++
------ ---------
Object receiver
Attribute attDef, attName
Result return value
5.3.10.1.10 Get instance type name
*/
#ifndef SDAI_CPP_LATE_BINDING
char * GetInstanceTypeName() const;
char * GetInstanceTypeName() const;
#endif
/*
Function:
The GetInstanceType function shall retrieve the name of the type of
the receiver.
/*
Function:
The GetInstanceType function shall retrieve the name of the type of
the receiver.
Output:
This function shall return a String which contains the name of the
type of the receiver. The returned name shall be the name as it
appears in the Dictionary Model.
Output:
This function shall return a String which contains the name of the
type of the receiver. The returned name shall be the name as it
appears in the Dictionary Model.
Possible error indicators:
sdaiMX_NDEF // SDAI-model access not defined
sdaiEI_NEXS // Entity instance does not exist
sdaiSY_ERR // Underlying system error
Possible error indicators:
sdaiMX_NDEF // SDAI-model access not defined
sdaiEI_NEXS // Entity instance does not exist
sdaiSY_ERR // Underlying system error
Origin: Convenience function
*/
Origin: Convenience function
*/
};
typedef SCLP23_NAME(DAObject_SDAI)* SCLP23_NAME(DAObject_SDAI_ptr);
typedef SCLP23_NAME(DAObject_SDAI_ptr) SCLP23_NAME(DAObject_SDAI_var);
typedef SDAI_DAObject_SDAI * SDAI_DAObject_SDAI_ptr;
typedef SDAI_DAObject_SDAI_ptr SDAI_DAObject_SDAI_var;
class SCLP23_NAME(DAObject__set) {
public:
SCLP23_NAME(DAObject__set)(int = 16);
~SCLP23_NAME(DAObject__set)();
class SCL_DAI_EXPORT SDAI_DAObject__set {
public:
SDAI_DAObject__set( int = 16 );
~SDAI_DAObject__set();
SCLP23_NAME(DAObject_ptr) retrieve(int index);
int is_empty();
SDAI_DAObject_ptr retrieve( int index );
int is_empty();
SCLP23_NAME(DAObject_ptr)& operator[](int index);
SDAI_DAObject_ptr & operator[]( int index );
void Insert(SCLP23_NAME(DAObject_ptr), int index);
void Append(SCLP23_NAME(DAObject_ptr));
void Remove(int index);
void Insert( SDAI_DAObject_ptr, int index );
void Append( SDAI_DAObject_ptr );
void Remove( int index );
int Index(SCLP23_NAME(DAObject_ptr));
int Index( SDAI_DAObject_ptr );
void Clear();
int Count();
void Clear();
int Count();
private:
void Check(int index);
private:
SCLP23_NAME(DAObject_ptr)* _buf;
int _bufsize;
int _count;
private:
void Check( int index );
private:
SDAI_DAObject_ptr * _buf;
int _bufsize;
int _count;
public:
public:
};
typedef SCLP23_NAME(DAObject__set)* SCLP23_NAME(DAObject__set_ptr);
typedef SCLP23_NAME(DAObject__set_ptr) SCLP23_NAME(DAObject__set_var);
typedef SDAI_DAObject__set * SDAI_DAObject__set_ptr;
typedef SDAI_DAObject__set_ptr SDAI_DAObject__set_var;
#endif
+19 -18
View File
@@ -3,8 +3,9 @@
//#include <EntityExtent.h>
#include <sdai.h>
#include "scl_memmgr.h"
SCLP23( Entity_extent )::SCLP23_NAME( Entity_extent )( )
SDAI_Entity_extent::SDAI_Entity_extent( )
: _definition( 0 ), _definition_name( 0 ), _owned_by( 0 ) {
/*
_definition = 0;
@@ -14,7 +15,7 @@ SCLP23( Entity_extent )::SCLP23_NAME( Entity_extent )( )
}
/*
SCLP23(Entity_extent)::SCLP23_NAME(Entity_extent)(const SCLP23(Entity_extent)& ee)
SDAI_Entity_extent::SDAI_Entity_extent(const SDAI_Entity_extent& ee)
{
// { CopyAs((STEPentityH) &e); }
_definition = 0;
@@ -22,54 +23,54 @@ SCLP23(Entity_extent)::SCLP23_NAME(Entity_extent)(const SCLP23(Entity_extent)& e
}
*/
SCLP23( Entity_extent )::~SCLP23_NAME( Entity_extent )() {
SDAI_Entity_extent::~SDAI_Entity_extent() {
delete _definition_name;
}
const Entity_ptr
SCLP23( Entity_extent )::definition_() const {
SDAI_Entity_extent::definition_() const {
return _definition;
}
/*
const SCLP23(Entity_name)
SCLP23(Entity_extent)::definition_name_() const
const SDAI_Entity_name
SDAI_Entity_extent::definition_name_() const
{
return _definition_name;
}
*/
void
SCLP23( Entity_extent )::definition_( const Entity_ptr & ep ) {
SDAI_Entity_extent::definition_( const Entity_ptr & ep ) {
_definition = ep;
}
void
SCLP23( Entity_extent )::definition_name_( const SCLP23( Entity_name )& en ) {
SDAI_Entity_extent::definition_name_( const SDAI_Entity_name & en ) {
_definition_name = new char[strlen( en ) + 1];
strncpy( _definition_name, en, strlen( en ) + 1 );
}
void
SCLP23( Entity_extent )::owned_by_( SCLP23_NAME( Model_contents__list_var )& mclv ) {
SDAI_Entity_extent::owned_by_( SDAI_Model_contents__list_var & mclv ) {
// _owned_by = mcp;
}
const SCLP23( Model_contents__list_var )
SCLP23( Entity_extent )::owned_by_() const {
return ( const SCLP23( Model_contents__list_var ) ) &_owned_by;
const SDAI_Model_contents__list_var
SDAI_Entity_extent::owned_by_() const {
return ( const SDAI_Model_contents__list_var ) &_owned_by;
}
/*
SCLP23(DAObject__set_var) instances_()
SDAI_DAObject__set_var instances_()
{
return &_instances;
}
const
SCLP23(DAObject__set_var) instances_() const
SDAI_DAObject__set_var instances_() const
{
return (const SCLP23(DAObject__set_var))&_instances;
return (const SDAI_DAObject__set_var)&_instances;
}
*/
@@ -92,7 +93,7 @@ SCLP23(DAObject__set_var) instances_() const
*/
void
SCLP23( Entity_extent )::AddInstance( const SCLP23( DAObject_ptr )& appInst ) {
SDAI_Entity_extent::AddInstance( const SDAI_DAObject_ptr & appInst ) {
_instances.Append( appInst );
}
@@ -114,8 +115,8 @@ SCLP23( Entity_extent )::AddInstance( const SCLP23( DAObject_ptr )& appInst ) {
void
SCLP23( Entity_extent )::RemoveInstance( const SCLP23( DAObject_ptr )& appInst ) {
SDAI_Entity_extent::RemoveInstance( const SDAI_DAObject_ptr & appInst ) {
_instances.Remove( _instances.Index( appInst ) );
}
///////// END_ENTITY SCLP23(Entity_extent)
///////// END_ENTITY SDAI_Entity_extent

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