Git Product home page Git Product logo

stepcode / stepcode Goto Github PK

View Code? Open in Web Editor NEW
423.0 58.0 118.0 25.11 MB

STEPcode (formerly NIST's STEP Class Library) is used with IFC, STEP, and other standards that utilize the technologies of ISO10303 (STEP). It generates C++ and Python from EXPRESS (10303-11) schemas. The code is capable of reading and writing STEP Part 21 exchange files. It also utilizes Parts 22 and 23 (SDAI and its C++ binding).

Home Page: http://stepcode.github.io

License: Other

CMake 3.72% C++ 34.80% C 48.86% Python 7.16% Shell 0.25% Yacc 1.55% Lex 3.66%

stepcode's Introduction

Build Status


STEPcode v0.8 -- github.com/stepcode/stepcode

  • What is STEPcode? SC reads ISO10303-11 EXPRESS schemas and generates C++ source code that can read and write Part 21 files conforming to that schema. In addition to C++, SC includes experimental support for Python.

  • Renamed in April/May 2012: SC was formerly known as STEP Class Libraries, SCL for short. It was renamed because the name wasn't accurate: the class libraries make up only a part of the code.

  • Much of the work to update SC has been done by the developers of BRL-CAD, and SC (then STEP Class Library) was originally created at NIST in the 90's.

  • For information on changes version-by-version, see the NEWS file

  • Building and testing SCL - see the INSTALL file

  • For more details on the libraries and executables, see the wiki: http://github.com/stepcode/stepcode/wiki/About-STEPcode

  • For license details, see the COPYING file. Summary: 3-clause BSD.



CODING STANDARDS

SC's source has been reformatted with astyle. When making changes, try to match the current formatting. The main points are:

  • compact (java-style) brackets:
    if( a == 3 ) {
        c = 5;
        function( a, b );
    } else {
        somefunc( );
    }
  • indents are 4 spaces
  • no tab characters
  • line endings are LF (linux), not CRLF (windows)
  • brackets around single-line conditionals
  • spaces inside parentheses and around operators
  • return type on the same line as the function name, unless that's too long
  • doxygen-style comments (see http://www.stack.nl/~dimitri/doxygen/docblocks.html)

If in doubt about a large patch, run astyle with the config file misc/astyle.cfg. Download astyle from http://sourceforge.net/projects/astyle/files/astyle/


For more info, see the wiki.

stepcode's People

Contributors

bitbybit3d avatar brianmoose avatar brlcad avatar cclauss avatar charliestirk avatar cshorler avatar davyw avatar devonsparks avatar ezzieyguywuf avatar gepard3d-builder avatar hoiji09 avatar jepler avatar keshashah avatar luzpaz avatar mpictor avatar rakuco avatar rbertucat avatar starseeker avatar tpaviot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stepcode's Issues

MSVC support

Fix errors and report or fix warnings with MSVC.

fedex_plus: improve file names

  • Current file names (example):
    • schema.cc
    • schema.h
    • SdaiAll.cc
    • Sdaiclasses.h
    • SdaiTEST_ENUMS_SAME_NAME.cc
    • SdaiTEST_ENUMS_SAME_NAME.h
    • SdaiTEST_ENUMS_SAME_NAME.init.cc
    • SdaiTEST_ENUMS_SAME_NAMENames.h
  • For each schema, the generated files should have a common prefix that is based upon the schema name (Currently, only the last 4 files have that).
  • Use CamelCase for the prefix, and eliminate underscores.
  • Many filesystems limit filenames to 255 chars, and lengthy names can be annoying to work with.
    • If the filename prefix will exceed a certain number of characters, use the schema name's acronym as the prefix:
      • SOME_SCHEMA_NAME -> SomeSchemaName
      • SOME_REALLY_REALLY_LONG_SCHEMA_NAME -> SRRLSN
    • Not using the schema name straight out of the schema will complicate the CMake build logic. It will probably be simplest to add an option to the check_express executable that
      • reads the schema
      • determines the prefix that would be used (either CamelCase, or the abbreviation)
      • prints it
      • exits

Limiting the length of namespace, class, and method names would improve readability in the rare cases where a person reads the generated C++. MSVC and GCC seem to allow 2048 characters, so we're unlikely to hit that limit. source

Remove outdated or unuseful dependencies

SCL, as well as generated output files, depend on:

  • O3DB.
    For example, a lot of
    #ifdef __O3DB__

could be removed.

  • Corba
    For instance:
    #ifdef PART26
    #include  
    // Create a corbaSchema.h file in this directory with a #include in 
    // it for your IDL generated schema-specific .hh file.
    #include  
    #endif 
    

Is Corba really useful nowadays? Who is still using it? However it would break Part26 compliancy.

cppcheck 1.49 issues report

cppcheck-1.49 report the following issues:
cppcheck -I include/ . -f --enable=all 2>cppcheck-issues.txt

[src/clSchemas/example/compstructs.cc:22]: (style) Unused variable: next5
[src/clSchemas/example/compstructs.cc:22]: (style) Unused variable: next6
[src/clSchemas/example/compstructs.cc:22]: (style) Unused variable: next7
[src/clSchemas/example/compstructs.cc:22]: (style) Unused variable: next8
[src/clSchemas/example/compstructs.cc:22]: (style) Unused variable: next9
[src/clSchemas/example/compstructs.cc:22]: (style) Unused variable: next10
[src/clSchemas/example/compstructs.cc:23]: (style) Unused variable: next11
[src/clSchemas/example/compstructs.cc:23]: (style) Unused variable: next12
[src/clSchemas/example/compstructs.cc:23]: (style) Unused variable: next13
[src/clSchemas/example/compstructs.cc:23]: (style) Unused variable: next14
[src/clSchemas/example/compstructs.cc:23]: (style) Unused variable: next15
[src/clSchemas/example/compstructs.cc:24]: (style) Unused variable: next16
[src/clSchemas/example/compstructs.cc:24]: (style) Unused variable: next17
[src/clSchemas/example/compstructs.cc:24]: (style) Unused variable: next18
[src/clSchemas/example/compstructs.cc:24]: (style) Unused variable: next19
[src/clSchemas/example/compstructs.cc:24]: (style) Unused variable: next20
[src/clSchemas/example/compstructs.cc:25]: (style) Unused variable: next21
[src/clSchemas/example/compstructs.cc:25]: (style) Unused variable: next22
[src/clSchemas/example/compstructs.cc:25]: (style) Unused variable: next23
[src/clSchemas/example/compstructs.cc:25]: (style) Unused variable: next24
[src/clSchemas/example/compstructs.cc:25]: (style) Unused variable: next25
[src/clSchemas/example/compstructs.cc:26]: (style) Unused variable: next26
[src/clSchemas/example/compstructs.cc:26]: (style) Unused variable: next27
[src/clSchemas/example/compstructs.cc:26]: (style) Unused variable: next28
[src/clSchemas/example/compstructs.cc:26]: (style) Unused variable: next29
[src/clSchemas/example/compstructs.cc:26]: (style) Unused variable: next30
[src/cleditor/STEPfile.cc:2760]: (style) Variable 'exchange_file' is assigned a value that is never used
[src/cleditor/STEPfile.cc:1717]: (information) The scope of the variable 'exportid' can be reduced
[src/cleditor/STEPfile.cc:1896]: (information) The scope of the variable 'exportid' can be reduced
[src/clivfasd/mycontrol.cc:119]: (information) The scope of the variable 'handHotx' can be reduced
[src/clivfasd/mycontrol.cc:120]: (information) The scope of the variable 'handHoty' can be reduced
[src/clivfasd/myfilebrowser.cc:176]: (style) Variable 'path' is assigned a value that is never used
[src/clivfasd/streditor2.cc:230]: (style) Variable 'World' is assigned a value that is never used
[src/clprobe-ui/probemain.cc:127]: (style) Variable 's' is assigned a value that is never used
[src/clprobe-ui/probe.cc:229]: (style) Variable 'root' is assigned a value that is never used
[src/clprobe-ui/probe.cc:500]: (style) Variable 's' is assigned a value that is never used
[src/clprobe-ui/probe.cc:667]: (style) Variable 'length' is assigned a value that is never used
[src/clprobe-ui/probe.cc:1126]: (style) Variable 'ed' is assigned a value that is never used
[src/clprobe-ui/probe.cc:1519]: (style) Unused variable: fileIdStr
[src/clprobe-ui/probe.cc:1817]: (style) Variable 'entityName' is assigned a value that is never used
[src/clprobe-ui/probe.cc:1535]: (information) The scope of the variable 'i' can be reduced
[src/clprobe-ui/seinstdisp.cc:307]: (style) Variable 'index' is assigned a value that is never used
[src/clprobe-ui/seinstdisp.cc:188]: (information) The scope of the variable 'ignoreCase' can be reduced
[src/clprobe-ui/seinstdisp.cc:189]: (information) The scope of the variable 'startIndex' can be reduced
[src/clprobe-ui/seinstdisp.cc:190]: (information) The scope of the variable 'indexFound' can be reduced
[src/clprobe-ui/setypedisp.cc:131]: (information) The scope of the variable 'ignoreCase' can be reduced
[src/clprobe-ui/setypedisp.cc:132]: (information) The scope of the variable 'startIndex' can be reduced
[src/clprobe-ui/setypedisp.cc:133]: (information) The scope of the variable 'indexFound' can be reduced
[src/clprobe-ui/stepentdescriptor.cc:422]: (information) The scope of the variable 'longestLen' can be reduced
[src/clprobe-ui/stepentdescriptor.cc:427]: (information) The scope of the variable 'attrLen' can be reduced
[src/clprobe-ui/stepentdescriptor.cc:503]: (information) The scope of the variable 'longestLen' can be reduced
[src/clprobe-ui/stepentdescriptor.cc:508]: (information) The scope of the variable 'subtypeLen' can be reduced
[src/clprobe-ui/stepenteditor.cc:1375]: (style) Variable 'rc' is assigned a value that is never used
[src/clprobe-ui/stepenteditor.cc:1826]: (style) Variable 'target' is assigned a value that is never used
[src/clprobe-ui/stepenteditor.cc:1828]: (style) Variable 'ks' is assigned a value that is never used
[src/clprobe-ui/stepenteditor.cc:2641]: (style) Variable 'rc' is assigned a value that is never used
[src/clprobe-ui/stepenteditor.cc:772]: (information) The scope of the variable 'i' can be reduced
[src/clprobe-ui/stepenteditor.cc:816]: (information) The scope of the variable 'i' can be reduced
[src/clprobe-ui/stepenteditor.cc:2082]: (style) Unused variable: buttonValue
[src/clstepcore/ExpDict.cc:783]: (style) Unused variable: tmp
[src/clstepcore/ExpDict.cc:983]: (style) Unused variable: tmp
[src/clstepcore/ExpDict.cc:880]: (information) The scope of the variable 'count' can be reduced
[src/clstepcore/ExpDict.cc:881]: (information) The scope of the variable 'i' can be reduced
[src/clstepcore/ExpDict.cc:882]: (information) The scope of the variable 'all_comments' can be reduced
[src/clstepcore/ExpDict.cc:1603]: (information) The scope of the variable 'count' can be reduced
[src/clstepcore/ExpDict.cc:1604]: (information) The scope of the variable 'i' can be reduced
[src/clstepcore/ExpDict.cc:1605]: (information) The scope of the variable 'all_comments' can be reduced
[src/clprobe-ui/stepenteditor.cc:2135]: (style) Unused variable: buttonValue
[src/clstepcore/STEPattribute.cc:1146]: (style) Variable 'foundCh' is assigned a value that is never used
[src/clstepcore/STEPattributeList.cc:40]: (information) The scope of the variable 'x' can be reduced
[src/clstepcore/complexSupport.h:262]: (warning) Member variable 'OrList::choice1' is not initialized in the constructor.
[src/clstepcore/complexSupport.h:90]: (information) Technically the member function 'EntNode::operatorconstchar*' can be const.
[src/clstepcore/complexSupport.h:99]: (information) Technically the member function 'EntNode::Name' can be const.
[src/clstepcore/complexSupport.h:103]: (information) Technically the member function 'EntNode::marked' can be const.
[src/clstepcore/complexSupport.h:106]: (information) Technically the member function 'EntNode::multSuprs' can be const.
[src/clstepcore/complexSupport.h:132]: (information) Technically the member function 'EntList::viableVal' can be const.
[src/clstepcore/complexSupport.h:155]: (information) Technically the member function 'EntList::multiple' can be const.
[src/clstepcore/complexSupport.h:178]: (information) Technically the member function 'SimpleList::Name' can be const.
[src/clstepcore/complexSupport.h:211]: (information) Technically the member function 'MultList::childCount' can be const.
[src/clstepcore/complexSupport.h:300]: (information) Technically the member function 'ComplexList::supertype' can be const.
[src/clstepcore/complexSupport.h:312]: (information) Technically the member function 'ComplexList::Dependent' can be const.
[src/clstepcore/complexlist.cc:96]: (information) The scope of the variable 'comp' can be reduced
[src/clstepcore/complexlist.cc:165]: (information) The scope of the variable 'otherChoices' can be reduced
[src/clstepcore/entlist.cc:94]: (style) Variable 'comp' is assigned a value that is never used
[src/clstepcore/read_func.cc:1183]: (style) Variable 'cstr' is assigned a value that is never used
[src/clstepcore/read_func.cc:601]: (information) The scope of the variable 'c1' can be reduced
[src/clstepcore/read_func.cc:601]: (information) The scope of the variable 'c2' can be reduced
[src/clstepcore/read_func.cc:1038]: (information) The scope of the variable 'endComment' can be reduced
[src/clstepcore/read_func.cc:1093]: (information) The scope of the variable 'commentLength' can be reduced
[src/clstepcore/sdaiBinary.cc:80]: (information) The scope of the variable 'c' can be reduced
[src/clstepcore/sdaiBinary.cc:84]: (information) The scope of the variable 'validDelimiters' can be reduced
[src/clstepcore/sdaiEnum.cc:208]: (information) The scope of the variable 'c' can be reduced
[src/clstepcore/sdaiEnum.cc:212]: (information) The scope of the variable 'validDelimiters' can be reduced
[src/clstepcore/sdaiEnum.cc:537]: (information) The scope of the variable 'c' can be reduced
[src/clstepcore/sdaiEnum.cc:541]: (information) The scope of the variable 'validDelimiters' can be reduced
[src/clstepcore/sdaiEnum.cc:1030]: (style) Variable 'errStr' is assigned a value that is never used
[src/clstepcore/sdaiString.cc:88]: (information) The scope of the variable 'foundEndQuote' can be reduced
[src/clstepcore/trynext.cc:106]: (information) The scope of the variable 'retval' can be reduced
[src/clutils/scl_hash.cc:220]: (information) The scope of the variable 'i' can be reduced
[src/clutils/scl_hash.cc:220]: (information) The scope of the variable 'j' can be reduced
[src/clutils/scl_hash.cc:355]: (information) The scope of the variable 'NewAddress' can be reduced
[src/clutils/scl_hash.cc:356]: (information) The scope of the variable 'OldSegmentIndex' can be reduced
[src/clutils/scl_hash.cc:356]: (information) The scope of the variable 'NewSegmentIndex' can be reduced
[src/clutils/scl_hash.cc:357]: (information) The scope of the variable 'OldSegmentDir' can be reduced
[src/clutils/scl_hash.cc:357]: (information) The scope of the variable 'NewSegmentDir' can be reduced
[src/clutils/dirobj.cc:489]: (error) Buffer access out-of-bounds
[src/exppp/exppp.c:618]: (information) The scope of the variable 'i' can be reduced
[src/exppp/exppp.c:1115]: (information) The scope of the variable 'length' can be reduced
[src/exppp/exppp.c:1158]: (information) The scope of the variable 'length' can be reduced
[src/exppp/exppp.c:1199]: (information) The scope of the variable 'length' can be reduced
[include/express/expr.h:119] -> [include/express/expr.h:91]: (style) Struct 'Qualified_Attr' hides typedef with same name
[src/express/entity.c:994]: (information) The scope of the variable 'value' can be reduced
[src/express/entity.c:1025]: (information) The scope of the variable 'value' can be reduced
[src/express/error.c:163]: (information) The scope of the variable 'found' can be reduced
[src/express/expr.c:218] -> [include/express/schema.h:82]: (style) Variable 'ref' hides enumerator with same name
[src/express/express.c:183]: (information) The scope of the variable 'done' can be reduced
[src/express/hash.c:277]: (information) The scope of the variable 'i' can be reduced
[src/express/hash.c:277]: (information) The scope of the variable 'j' can be reduced
[src/express/hash.c:423]: (information) The scope of the variable 'NewAddress' can be reduced
[src/express/hash.c:424]: (information) The scope of the variable 'OldSegmentIndex' can be reduced
[src/express/hash.c:424]: (information) The scope of the variable 'NewSegmentIndex' can be reduced
[src/express/hash.c:425]: (information) The scope of the variable 'OldSegmentDir' can be reduced
[src/express/hash.c:425]: (information) The scope of the variable 'NewSegmentDir' can be reduced
[src/express/object.c:62]: (warning) Warning - using char variable as array index
[src/express/resolve.c:1160]: (information) The scope of the variable 'found' can be reduced
[src/express/resolve.c:1488]: (information) The scope of the variable 'i' can be reduced
[src/express/resolve.c:1519]: (warning) Redundant code: Found a statement that begins with numeric constant
[src/express/express.c:579]: (style) Variable 'd' is assigned a value that is never used
[src/express/schema.c:71] -> [include/express/schema.h:95]: (style) Struct 'Rename' hides typedef with same name
[src/fedex_plus/classes.c:4273]: (style) Unused variable: s
[src/fedex_plus/classes.c:2333]: (information) The scope of the variable 'super' can be reduced
[src/fedex_plus/classes.c:2334]: (information) The scope of the variable 'super_cnt' can be reduced
[src/fedex_plus/classes.c:2495]: (information) The scope of the variable 'super' can be reduced
[src/fedex_plus/classes.c:2496]: (information) The scope of the variable 'super_cnt' can be reduced
[src/fedex_plus/classes.c:2684]: (information) The scope of the variable 'i' can be reduced
[src/fedex_plus/classes.c:2685]: (information) The scope of the variable 'found' can be reduced
[src/fedex_plus/classes.c:2736]: (information) The scope of the variable 'super' can be reduced
[src/fedex_plus/classes.c:2737]: (information) The scope of the variable 'super_cnt' can be reduced
[src/fedex_plus/classes.c:2738]: (information) The scope of the variable 'principalSuper' can be reduced
[src/fedex_plus/classes.c:2743]: (information) The scope of the variable 'first' can be reduced
[src/fedex_plus/classes.c:2954]: (information) The scope of the variable 'super' can be reduced
[src/fedex_plus/classes.c:2955]: (information) The scope of the variable 'super_cnt' can be reduced
[src/fedex_plus/classes.c:2960]: (information) The scope of the variable 'parentEntity' can be reduced
[src/fedex_plus/classes.c:2964]: (information) The scope of the variable 'first' can be reduced
[src/fedex_plus/classes.c:3787]: (information) The scope of the variable 'i' can be reduced
[src/fedex_plus/classes.c:4846]: (information) The scope of the variable 'whereRule_formatted_size' can be reduced
[src/fedex_plus/classes_misc.c:677]: (information) The scope of the variable 'super' can be reduced
[src/fedex_plus/classes_misc.c:678]: (information) The scope of the variable 'ignore' can be reduced
[src/fedex_plus/classes_misc.c:679]: (information) The scope of the variable 'super_cnt' can be reduced
[src/fedex_plus/classes_misc.c:682]: (information) The scope of the variable 'list' can be reduced
[src/fedex_plus/classes_misc.c:525]: (error) Buffer access out-of-bounds: newname
[src/fedex_plus/classes_misc.c:542]: (error) Buffer access out-of-bounds: newname
[src/fedex_plus/classes_wrapper.cc:220]: (information) The scope of the variable 'index' can be reduced
[src/fedex_plus/classes_wrapper.cc:558]: (information) The scope of the variable 'tmpstr_size' can be reduced
[src/fedex_plus/complexSupport.h:269]: (warning) Member variable 'OrList::choice1' is not initialized in the constructor.
[src/fedex_plus/complexlist.cc:96]: (information) The scope of the variable 'comp' can be reduced
[src/fedex_plus/complexlist.cc:165]: (information) The scope of the variable 'otherChoices' can be reduced
[src/fedex_plus/entlist.cc:106]: (style) Variable 'comp' is assigned a value that is never used
[src/fedex_plus/expressbuild.cc:282]: (information) The scope of the variable 'none_yet' can be reduced
[src/fedex_plus/fedex_idl.c:30]: (style) Variable 'found' is assigned a value that is never used
[src/fedex_plus/fedex_idl.c:239]: (style) Unused variable: nm
[src/fedex_plus/fedex_idl.c:243]: (style) Variable 'index' is assigned a value that is never used
[src/fedex_plus/fedex_idl.c:291]: (style) Unused variable: n
[src/fedex_plus/fedex_idl.c:492]: (style) Variable 'index' is assigned a value that is never used
[src/fedex_plus/fedex_idl.c:819]: (style) Unused variable: np
[src/fedex_plus/fedex_idl.c:823]: (style) Unused variable: os_hooks_file_h
[src/fedex_plus/fedex_idl.c:824]: (style) Unused variable: os_hooks_file_cc
[src/fedex_plus/fedex_idl.c:489]: (information) The scope of the variable 'super' can be reduced
[src/fedex_plus/fedex_os.c:42]: (style) Unused variable: nm
[src/fedex_plus/fedex_os.c:46]: (style) Variable 'index' is assigned a value that is never used
[src/fedex_plus/fedex_os.c:97]: (style) Variable 'index' is assigned a value that is never used
[src/fedex_plus/fedex_os.c:178]: (style) Unused variable: np
[src/fedex_plus/fedex_os.c:245]: (error) Resource leak: os_hooks_file_cc
[src/fedex_plus/multpass.c:367]: (style) Variable 'retval' is assigned a value that is never used
[src/fedex_plus/selects.c:913]: (information) The scope of the variable 'super_cnt' can be reduced
[src/fedex_plus/selects.c:555]: (error) Dangerous usage of 'classnm' (strncpy doesn't always 0-terminate it)
[src/fedex_plus/trynext.cc:106]: (information) The scope of the variable 'retval' can be reduced
[src/test/generate_express/generate_express.cc:31]: (style) Variable 'schema2' is assigned a value that is never used
[src/test/tstatic/tstatic.cc:24]: (style) Variable 'registry' is assigned a value that is never used

stricmp/strcasecmp imcompatibility for embarcadero

On embarcadero builds (I think all versions, or at least all version I have available) stricmp (case insensitive string compare)
first converts string to uppercase, then compares. For msvc (_stricmp) and gcc (strcasecmp) conversion is done to
lowercase and then compared.
This raises some odd behavious while parsing.

Consider following two strings: "bounded_surface" and "b_spline_surface", on msvc/gcc when comparing those strings it returns
a positive result (str1 > str2), while on embarcadero it returns a negative result (str1 < str2).
This happens because underscore character is in between capital and small letters in the ascii table.

Don't really know what would be the best way to fix this, implement a stricmp with lowercase for borland builds or some other solution.

Comments are welcome...

fedex_plus bottleneck - generate_attribute_name()

fedex_plus spends 64.75% of its time on the function generate_attribute_name() itself, and an additional 31% on tolower(), which is mostly called from generate_attribute_name().

It spends a total of 96.58% of its time on generate_attribute_name() or on functions called from there.

source: valgrind --tool=callgrind ../bin/fedex_plus ../../data/ap239/ap239_arm_lf.exp

fedex_plus: precision and FIXED keyword are ignored

EXPRESS allows a precision or width to be specified for variables of type real, binary, and string.

It allows the use of FIXED for binary and string.

These, along with a precision for the integer type (not specified in the EXPRESS LRM!), are present in expparse. However, fedex_plus does not take advantage of them except in one function that prints EXPRESS.

I think that this data should make its way into the C++ generated by fedex_plus so that data can be verified to conform to the schema when exchange files are read or written.

types replaced by numbers

output of grep extern Sdaiclasses.h should be

extern Schema *  s_config_control_design;
extern TypeDescriptor   *config_control_designt_text;
extern TypeDescriptor   *config_control_designt_dimension_count;
...

actual output:

extern Schema *  s_config_control_design;
extern 4339222  *config_control_designt_text;
extern 4339222  *config_control_designt_dimension_count;
...

Appears to be caused by e52c290. I glanced over this patch but didn't actually compile it. This wouldn't be caught without compiling the output of fedex_plus.

fedex_plus segfault with PLIB Part 25 IsoIec

$ gdb --args ../bin/fedex_plus ../../../archive_sc4/PLIB/Part25/Part25-IS/Released-Part25-IS/LongForm25IsoIec.exp
GNU gdb (GDB) 7.2-debian
This GDB was configured as "x86_64-linux-gnu".
Reading symbols from /opt/step/scl/build/bin/fedex_plus...done.
(gdb) r
Starting program: /opt/step/scl/build/bin/fedex_plus ../../../archive_sc4/PLIB/Part25/Part25-IS/Released-Part25-IS/LongForm25IsoIec.exp
../../../archive_sc4/PLIB/Part25/Part25-IS/Released-Part25-IS/LongForm25IsoIec.exp:3849: WARNING: Implicit downcast to program_reference.

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff79b30f5 in EXPresolve_op_dot (expr=0x9aa108, scope=0x9a3c90)
at /opt/step/scl/src/express/expr.c:329
329 op2->return_type = v->type;
(gdb) bt

#0  0x00007ffff79b30f5 in EXPresolve_op_dot (expr=0x9aa108, scope=0x9a3c90)
    at /opt/step/scl/src/express/expr.c:329
#1  0x00007ffff79b76e5 in EXP_resolve (expr=0x9aa108, scope=0x9a3c90, typecheck=0x673110)
    at /opt/step/scl/src/express/resolve.c:490
#2  0x00007ffff79b77b7 in EXP_resolve (expr=0x9aa1b8, scope=0x9a3c40, typecheck=0x6730c0)
    at /opt/step/scl/src/express/resolve.c:508
#3  0x00007ffff79b3a7d in EXPresolve_op_relational (e=0x9aa6e0, s=0x9a3c40)
    at /opt/step/scl/src/express/expr.c:579
#4  0x00007ffff79b76e5 in EXP_resolve (expr=0x9aa6e0, scope=0x9a3c40, typecheck=0x673110)
    at /opt/step/scl/src/express/resolve.c:490
#5  0x00007ffff79b3c70 in EXPresolve_op_default (e=0x9aa738, s=0x9a3c40)
    at /opt/step/scl/src/express/expr.c:624
#6  0x00007ffff79b3d4b in EXPresolve_op_logical (e=0x9aa738, s=0x9a3c40)
    at /opt/step/scl/src/express/expr.c:646
#7  0x00007ffff79b76e5 in EXP_resolve (expr=0x9aa738, scope=0x9a3c40, typecheck=0x673110)
    at /opt/step/scl/src/express/resolve.c:490
#8  0x00007ffff79b8791 in STMTresolve (statement=0x6a1e48, scope=0x9a3c40)
    at /opt/step/scl/src/express/resolve.c:862
#9  0x00007ffff79b840b in STMTlist_resolve (list=0x9a8488, scope=0x9a3c40)
    at /opt/step/scl/src/express/resolve.c:809
#10 0x00007ffff79b87ac in STMTresolve (statement=0x6a1e70, scope=0x9a3c40)
    at /opt/step/scl/src/express/resolve.c:863
#11 0x00007ffff79b840b in STMTlist_resolve (list=0x9a8490, scope=0x9a3c40)
    at /opt/step/scl/src/express/resolve.c:809
#12 0x00007ffff79b8af4 in STMTresolve (statement=0x6a1e98, scope=0x9a3c40)
    at /opt/step/scl/src/express/resolve.c:903
#13 0x00007ffff79b840b in STMTlist_resolve (list=0x9a8498, scope=0x9a3b00)
    at /opt/step/scl/src/express/resolve.c:809
#14 0x00007ffff79b8c28 in ALGresolve_expressions_statements (s=0x9a3b00, statements=0x9a8498)
    at /opt/step/scl/src/express/resolve.c:928
#15 0x00007ffff79ba205 in SCOPEresolve_expressions_statements (s=0x674380)
    at /opt/step/scl/src/express/resolve.c:1692

mkProbe error with AP214 IS, AP214 DIS, AP214 3rd Edition

The messages below are from AP214 IS; DIS and 3rd Edition are identical except for the line numbers.

Express files from http://www.cax-if.org/joint_testing_info.html#schemas

$ bin/mkProbe -p ../express_files/AP214_IS_AD_LF.exp ap214

[snipped many ambiguous attribute warnings]
...
[snipped multiple inheritance info]
...

Finished writing files.
 
 
Compiling...
 
compiling schema.cc
/usr/bin/c++ -g -DHAVE_CONFIG_H     -I/opt/scl/src/clprobe-ui -I/opt/scl/build -I/opt/scl/src/cldai -I/opt/scl/src/cleditor -I/opt/scl/src/clstepcore -I/opt/scl/src/clutils -I.   -I/opt/scl/src/clivfasd -I/installed/include -c schema.cc 
In file included from ./schema.h:35:0,
                 from schema.cc:7:
./SdaiAUTOMOTIVE_DESIGN.h:66554:84: error: expected initializer before ‘transformation_operator’
./SdaiAUTOMOTIVE_DESIGN.h:66565:35: error: expected ‘;’ at end of member declaration
./SdaiAUTOMOTIVE_DESIGN.h:66565:90: error: ‘transformation_operator’ does not name a type
./SdaiAUTOMOTIVE_DESIGN.h:66581:53: error: expected ‘;’ at end of member declaration
./SdaiAUTOMOTIVE_DESIGN.h:66581:134: error: ISO C++ forbids declaration of ‘transformation_operator_’ with no type [-fpermissive]
./SdaiAUTOMOTIVE_DESIGN.h:66582:7: error: variable or field ‘representation_relationship_with_transformation_’ declared void
./SdaiAUTOMOTIVE_DESIGN.h:66582:7: error: expected ‘;’ at end of member declaration
./SdaiAUTOMOTIVE_DESIGN.h:66582:139: error: ISO C++ forbids declaration of ‘transformation_operator_’ with no type [-fpermissive]
./SdaiAUTOMOTIVE_DESIGN.h:69932:85: error: expected initializer before ‘transformation_operator’
./SdaiAUTOMOTIVE_DESIGN.h:69941:35: error: expected ‘;’ at end of member declaration
./SdaiAUTOMOTIVE_DESIGN.h:69941:90: error: ‘transformation_operator’ does not name a type
./SdaiAUTOMOTIVE_DESIGN.h:69954:53: error: expected ‘;’ at end of member declaration
./SdaiAUTOMOTIVE_DESIGN.h:69954:134: error: ISO C++ forbids declaration of ‘transformation_operator_’ with no type [-fpermissive]
./SdaiAUTOMOTIVE_DESIGN.h:69955:7: error: variable or field ‘representation_relationship_with_transformation_’ declared void
./SdaiAUTOMOTIVE_DESIGN.h:69955:7: error: expected ‘;’ at end of member declaration
./SdaiAUTOMOTIVE_DESIGN.h:69955:139: error: ISO C++ forbids declaration of ‘transformation_operator_’ with no type [-fpermissive]
make: *** [schema.o] Error 1
mkProbe was unsuccessful in creating the Schema Library.
 
Resolve previous error messages and try again.

Part 21 - FILE_SCHEMA is ignored?

Read this file with p21read (tested with ap203e2, ap214e3)
Even though FILE_SCHEMA does not match the one p21read is for, it reads and writes the file without complaint.

Is it acceptable for the file header to be ignored?

ISO-10303-21;
HEADER;
FILE_DESCRIPTION((''),'2;1');
FILE_NAME('ASM','2008-09-04T',('name'),(''),'CORP, 2008340','CORP, 2008340','');
FILE_SCHEMA(('AP2_TS_AND_ASSEMBLIES_MIM_LF'));
ENDSEC;
DATA;
#1=DRAUGHTING_PRE_DEFINED_COLOUR('green');
#2=COLOUR_RGB('',1.1E-2,1.2E-2,1.E0);
#3=COLOUR_RGB('',1.1E-1,1.1E-1,1.1E-1);
#4=COLOUR_RGB('',3.92E-1,1.2E-2,1.2E-2);
#5=COLOUR_RGB('',4.1E-1,0.E0,2.2E-1);
#6=COLOUR_RGB('',5.803921568627E-1,0.E0,1.607843137255E-1);
#7=COLOUR_RGB('',6.666666666667E-1,4.627450980392E-1,2.196078431373E-1);
#8=COLOUR_RGB('',8.784E-1,9.49E-1,1.E0);
#9=COLOUR_RGB('',9.6E-1,9.6E-1,9.6E-1);
#10=COLOUR_RGB('',9.8E-1,6.27E-1,0.E0);
#11=DRAUGHTING_PRE_DEFINED_COLOUR('red');
#12=DRAUGHTING_PRE_DEFINED_COLOUR('yellow');
#13=COLOUR_RGB('',1.E0,1.E0,9.49E-1);
#14=DRAUGHTING_PRE_DEFINED_COLOUR('white');
#16=DIRECTION('',(0.E0,1.E0,0.E0));
#17=VECTOR('',#16,2.E1);
#18=CARTESIAN_POINT('',(4.E1,-2.E1,-7.5E1));
ENDSEC;
END-ISO-10303-21;

compiler errors with AP210E3, AP235, AP242

On master, this small schema produces compiler errors such as:

In file included from schema.h:43:0,
                 from SdaiGCC_INCOMPLETE_TYPE.cc:10:
SdaiGCC_INCOMPLETE_TYPE.h:26:30: error: field ‘_sdaiatom_based_value_agg’ has incomplete type
SdaiGCC_INCOMPLETE_TYPE.cc: In member function ‘virtual void SdaiAtom_based_value::STEPwrite_content(std::ostream&, const char*) const’:
SdaiGCC_INCOMPLETE_TYPE.cc:65:2: error: ‘_sdaiatom_based_value_agg’ was not declared in this scope

(output is snipped)

Two of the generated c++ classes embed each other:

class SdaiAtom_based_value  :  public SDAI_Select {
  protected:
       SDAI_Real _real;
       SdaiAtom_based_value_agg _sdaiatom_based_value_agg;
  public:
//   ...
};


class SdaiAtom_based_value_agg : public SelectAggregate {
  public:
    virtual SingleLinkNode * NewNode()
     { return new SelectNode (new SdaiAtom_based_value( sel_type )); }
// ...
};

@brlcad suggested using a pointer, so that
SdaiAtom_based_value_agg _sdaiatom_based_value_agg;
becomes
SdaiAtom_based_value_agg * _sdaiatom_based_value_agg;

I implemented this in branch mp/gcc_incomplete_type. It works for small schema linked above, but there are still problems with the full-size schemas. An example, with shortened file names, from AP242:

SdaiAP242_LF.cc: In member function ‘virtual void SdaiSpatial_rotation::STEPwrite_content(std::ostream&, const char*) const’:
SdaiAP242_LF.cc:115711:20: error: request for member ‘STEPwrite’ in ‘((const SdaiSpatial_rotation*)this)->SdaiSpatial_rotation::_realaggregate’, which is of non-class type ‘const RealAggregate_ptr {aka RealAggregate* const}’
SdaiAP242_LF.cc: In member function ‘virtual void SdaiSpatial_rotation::STEPwrite_verbose(std::ostream&, const char*) const’:
SdaiAP242_LF.cc:115749:20: error: request for member ‘STEPwrite’ in ‘((const SdaiSpatial_rotation*)this)->SdaiSpatial_rotation::_realaggregate’, which is of non-class type ‘const RealAggregate_ptr {aka RealAggregate* const}’
SdaiAP242_LF.cc: In member function ‘virtual Severity SdaiSpatial_rotation::STEPread_content(std::istream&, InstMgr*, const char*, int, const char*)’:
SdaiAP242_LF.cc:115770:20: error: request for member ‘STEPread’ in ‘((SdaiSpatial_rotation*)this)->SdaiSpatial_rotation::_realaggregate’, which is of non-class type ‘RealAggregate_ptr {aka RealAggregate*}’

OSX compilation error

On OSX/64:

$ uname -r
10.8.0

Compilation fails:

$ ./configure --with-arch=x86_64

Trace:

compiling ../../../src/clSchemas/example/schema.cc for a
/usr/bin/c++ -g -DHAVE_CONFIG_H -I../../../src/clprobe-ui -I/Users/thomas/Devel/StepClassLibrary/x86_64 -I../../../src/cldai -I../../../src/cleditor -I../../../src/clstepcore -I../../../src/clutils -I../../../src/clSchemas/example -I../../../src/clivfasd -I/installed/include -c ../../../src/clSchemas/example/schema.cc
In file included from ../../../src/clSchemas/example/Sdaiclasses.h:7,
from ../../../src/clSchemas/example/schema.h:32,
from ../../../src/clSchemas/example/schema.cc:7:
../../../src/clSchemas/example/schema.h:1:1: error: unterminated #ifndef
In file included from ../../../src/clSchemas/example/schema.h:32,
from ../../../src/clSchemas/example/schema.cc:7:
../../../src/clSchemas/example/Sdaiclasses.h:1:1: error: unterminated #ifndef
In file included from ../../../src/clSchemas/example/schema.h:35,
from ../../../src/clSchemas/example/schema.cc:7:
../../../src/clSchemas/example/SdaiEXAMPLE_SCHEMA.h:1:1: error: unterminated #ifndef
In file included from ../../../src/clSchemas/example/schema.cc:7:
../../../src/clSchemas/example/schema.h:1:1: error: unterminated #ifndef
../../../src/clSchemas/example/schema.cc:1:1: error: unterminated #ifndef
../../../src/clSchemas/example/schema.cc: In function 'void SchemaInit(Registry&)':
../../../src/clSchemas/example/schema.cc:16: error: expected `}' at end of input
make: *** [schema.o] Error 1
mkProbe was unsuccessful in creating the Schema Library.

Resolve previous error messages and try again.

  • exit 1

expparse.y: conflicts: 1 reduce/reduce

relevant parts of expparse.output, created with bison -Wall -rall src/express/expparse.y:

Terminals unused in grammar

   TOK_CONTEXT
   TOK_END_CONTEXT
   TOK_END_MODEL
   TOK_MODEL


State 578 conflicts: 1 reduce/reduce

state 527

  222 group_ref: TOK_BACKSLASH . TOK_IDENTIFIER
  224 qualifier: TOK_BACKSLASH . TOK_IDENTIFIER

    TOK_IDENTIFIER  shift, and go to state 578

state 578

  222 group_ref: TOK_BACKSLASH TOK_IDENTIFIER .  [TOK_SEMICOLON]
  224 qualifier: TOK_BACKSLASH TOK_IDENTIFIER .  [TOK_LEFT_BRACKET, TOK_BACKSLASH, TOK_DOT, TOK_SEMICOLON]

    TOK_SEMICOLON  reduce using rule 222 (group_ref)
    TOK_SEMICOLON  [reduce using rule 224 (qualifier)]
    $default       reduce using rule 224 (qualifier)


instrument the parser

It would help in debugging if it was possible to print out the tokens found in a certain range of input lines, as well as the text that made the tokens up.

Performance - tweak hash table creation param

include/express/dict.h:92:#define DICTcreate(estimated_max_size) HASHcreate(estimated_max_size)
If the number is too large, memory is wasted. If it is too small, lookups become inefficient.

To do this well, we'll need to figure out the average size of each table. For fedex_plus, perhaps the best way would be to count the number of lines in the schema, then for each table divide by some table-specific constant? Would the performance increase be substantial enough to bother?

In src/clstepcore, should the schema-specific lib provide size information for creation of the registry? Otherwise, we'll still have one-size-fits-all values that might be too small for good performance with ap210 but so big that simple schemas waste loads of memory.

$ grep -nr DICTcreate src/*

src/exppp/exppp.c:420:    dict = DICTcreate( 10 );
src/express/schema.c:90:    d->symbol_table = DICTcreate( 50 );
src/express/schema.c:98:    d->symbol_table = DICTcreate( 1 );
src/express/schema.c:196:        schema->u.schema->refdict = DICTcreate( 20 );
src/express/schema.c:212:        schema->u.schema->usedict = DICTcreate( 20 );
src/express/expparse.y:779:                    CURRENT_SCOPE->symbol_table = DICTcreate(25);
src/express/expparse.y:1993:                    CURRENT_SCOPE->symbol_table = DICTcreate(25);
src/express/express.c:287:    EXPRESSbuiltins = DICTcreate( 35 );
src/fedex_plus/classes.c:121:    dict = DICTcreate( 10 );

$ grep -nr HASHcreate src/*

src/clstepcore/Registry.inline.cc:30:    primordialSwamp = HASHcreate( 1000 );
src/clstepcore/Registry.inline.cc:31:    active_schemas = HASHcreate( 10 );
src/clstepcore/Registry.inline.cc:32:    active_types = HASHcreate( 100 );
src/clutils/scl_hash.h:135:    SCL_UTILS_EXPORT struct Hash_Table * HASHcreate( unsigned );
src/clutils/scl_hash.cc:428:    t = HASHcreate( 100 );
src/express/lexact.c:250:    keyword_dictionary = HASHcreate( 100 ); /* not exact */
src/express/hash.c:588:    t = HASHcreate( 100 );

errors with ap203e2 now that the aggregate error is fixed

The file and directory names have been shortened to make this more readable:

[ 93%] Building CXX object data/CMakeFiles/sdai_ap203cc3d.dir/__/ap203cc3d/Sdaiap203cc3d.cc.o
/opt/step/scl/build/ap203cc3d/Sdaiap203cc3d.cc: In function ‘STEPaggregate* create_SdaiPoint_and_vector_members()’:
/opt/step/scl/build/ap203cc3d/Sdaiap203cc3d.cc:1345:1: error: redefinition of ‘STEPaggregate* create_SdaiPoint_and_vector_members()’
/opt/step/scl/build/ap203cc3d/Sdaiap203cc3d.h:9646:24: error: ‘STEPaggregate* create_SdaiPoint_and_vector_members()’ previously defined here
/opt/step/scl/build/ap203cc3d/Sdaiap203cc3d.cc: In member function ‘EntityAggregate* const SdaiClassification_item::people_() const’:
/opt/step/scl/build/ap203cc3d/Sdaiap203cc3d.cc:12405:65: error: ‘class SdaiPerson_and_organization_address’ has no member named ‘people_’
/opt/step/scl/build/ap203cc3d/Sdaiap203cc3d.cc: In member function ‘void SdaiClassification_item::people_(EntityAggregate_ptr)’:
/opt/step/scl/build/ap203cc3d/Sdaiap203cc3d.cc:12418:61: error: ‘class SdaiPerson_and_organization_address’ has no member named ‘people_’
/opt/step/scl/build/ap203cc3d/Sdaiap203cc3d.cc: In member function ‘EntityAggregate* const SdaiAttribute_classification_item::people_() const’:
/opt/step/scl/build/ap203cc3d/Sdaiap203cc3d.cc:54677:65: error: ‘class SdaiPerson_and_organization_address’ has no member named ‘people_’
/opt/step/scl/build/ap203cc3d/Sdaiap203cc3d.cc: In member function ‘void SdaiAttribute_classification_item::people_(EntityAggregate_ptr)’:
/opt/step/scl/build/ap203cc3d/Sdaiap203cc3d.cc:54690:61: error: ‘class SdaiPerson_and_organization_address’ has no member named ‘people_’
/opt/step/scl/build/ap203cc3d/Sdaiap203cc3d.cc: At global scope:
/opt/step/scl/build/ap203cc3d/Sdaiap203cc3d.cc:17:12: warning: ‘debug_access_hooks’ defined but not used [-Wunused-variable]
make[2]: *** [data/CMakeFiles/sdai_ap203cc3d.dir/__/ap203cc3d/Sdaiap203cc3d.cc.o] Error 1
make[1]: *** [data/CMakeFiles/sdai_ap203cc3d.dir/all] Error 2
make: *** [all] Error 2

fedex_plus: reference errors with AP209

edit: this was split into two issues - see also #151

Using part409cdts_wg3n2617mim_lf.exp, and fedex_plus compiled from master:

16921: --ERROR: Group reference of unusual expression
16921: --ERROR: Attribute index_count cannot be referenced from a non-entity
16920: --ERROR: Group reference of unusual expression
16920: --ERROR: Attribute index_count cannot be referenced from a non-entity

Replace tangled maze of macros

There are a large number of macros in SCL. I think these should be written out whenever possible for code clarity. Some, such as SDAI_BOOLEAN, can probably be replaced by types from C++0X or boost.

grep found 1400 #defines in headers in include/ and src/.

edit: Many of these 1400 define constants and are probably best left alone.

However, there are 653 function-style macros present in files in include/ and src/.

errors with AP203 2nd Edition IS

schema from http://www.cax-if.org/joint_testing_info.html#schemas

both the original NIST version and the version modified here and for BRL-CAD print warnings and errors for this schema.

Current fedex_plus output

../../data/ap203e2/ap203e2_mim_lf.exp:15505: WARNING: Possibly ambiguous implicit downcast (vector?).
../../data/ap203e2/ap203e2_mim_lf.exp:15507: WARNING: Possibly ambiguous implicit downcast (direction?).
../../data/ap203e2/ap203e2_mim_lf.exp:11634: --ERROR: Query expression source must be an aggregate.
../../data/ap203e2/ap203e2_mim_lf.exp:15390: WARNING: Possibly ambiguous implicit downcast (vector?).
../../data/ap203e2/ap203e2_mim_lf.exp:15390: WARNING: Possibly ambiguous implicit downcast (vector?).
../../data/ap203e2/ap203e2_mim_lf.exp:15397: WARNING: Possibly ambiguous implicit downcast (direction?).
../../data/ap203e2/ap203e2_mim_lf.exp:10418: WARNING: Possibly ambiguous implicit downcast (defined_symbol?).
../../data/ap203e2/ap203e2_mim_lf.exp:14003: --ERROR: Query expression source must be an aggregate.
../../data/ap203e2/ap203e2_mim_lf.exp:14001: --ERROR: Query expression source must be an aggregate.
../../data/ap203e2/ap203e2_mim_lf.exp:13999: --ERROR: Query expression source must be an aggregate.
../../data/ap203e2/ap203e2_mim_lf.exp:13952: WARNING: Possibly ambiguous implicit downcast (direction?).
../../data/ap203e2/ap203e2_mim_lf.exp:13953: WARNING: Possibly ambiguous implicit downcast (direction?).
../../data/ap203e2/ap203e2_mim_lf.exp:16289: --ERROR: Query expression source must be an aggregate.
../../data/ap203e2/ap203e2_mim_lf.exp:16286: --ERROR: Query expression source must be an aggregate.
../../data/ap203e2/ap203e2_mim_lf.exp:14032: --ERROR: Query expression source must be an aggregate.
../../data/ap203e2/ap203e2_mim_lf.exp:14033: --ERROR: Query expression source must be an aggregate.
../../data/ap203e2/ap203e2_mim_lf.exp:14031: --ERROR: Query expression source must be an aggregate.
../../data/ap203e2/ap203e2_mim_lf.exp:14019: --ERROR: Query expression source must be an aggregate.
../../data/ap203e2/ap203e2_mim_lf.exp:14017: --ERROR: Query expression source must be an aggregate.
../../data/ap203e2/ap203e2_mim_lf.exp:14015: --ERROR: Query expression source must be an aggregate.
../../data/ap203e2/ap203e2_mim_lf.exp:16316: --ERROR: Query expression source must be an aggregate.
../../data/ap203e2/ap203e2_mim_lf.exp:16304: --ERROR: Query expression source must be an aggregate.
../../data/ap203e2/ap203e2_mim_lf.exp:16303: --ERROR: Query expression source must be an aggregate.
../../data/ap203e2/ap203e2_mim_lf.exp:16344: WARNING: Possibly ambiguous implicit downcast (vector?).
../../data/ap203e2/ap203e2_mim_lf.exp:16351: WARNING: Possibly ambiguous implicit downcast (vector?).
Errors in input

NIST (mkProbe) output:

$ bin/mkProbe -p ../express_files/ap203_2nd_ed_is_part403ts_wg3n2635mim_lf.exp ap203_2e

Creating a Data Probe...
 
EXPRESS file = ../express_files/ap203_2nd_ed_is_part403ts_wg3n2635mim_lf.exp
schema name = ap203_2e
pdes root dir = /opt/scl
 
Translating the schema...
/opt/scl/express_files/ap203_2nd_ed_is_part403ts_wg3n2635mim_lf.exp:15505: WARNING: Possibly ambiguous implicit downcast (vector?).
/opt/scl/express_files/ap203_2nd_ed_is_part403ts_wg3n2635mim_lf.exp:15507: WARNING: Possibly ambiguous implicit downcast (direction?).
/opt/scl/express_files/ap203_2nd_ed_is_part403ts_wg3n2635mim_lf.exp:11634: --ERROR: Query expression source must be an aggregate.
/opt/scl/express_files/ap203_2nd_ed_is_part403ts_wg3n2635mim_lf.exp:15390: WARNING: Possibly ambiguous implicit downcast (vector?).
/opt/scl/express_files/ap203_2nd_ed_is_part403ts_wg3n2635mim_lf.exp:15390: WARNING: Possibly ambiguous implicit downcast (vector?).
/opt/scl/express_files/ap203_2nd_ed_is_part403ts_wg3n2635mim_lf.exp:15397: WARNING: Possibly ambiguous implicit downcast (direction?).
/opt/scl/express_files/ap203_2nd_ed_is_part403ts_wg3n2635mim_lf.exp:10418: WARNING: Possibly ambiguous implicit downcast (defined_symbol?).
/opt/scl/express_files/ap203_2nd_ed_is_part403ts_wg3n2635mim_lf.exp:14003: --ERROR: Query expression source must be an aggregate.
/opt/scl/express_files/ap203_2nd_ed_is_part403ts_wg3n2635mim_lf.exp:14001: --ERROR: Query expression source must be an aggregate.
/opt/scl/express_files/ap203_2nd_ed_is_part403ts_wg3n2635mim_lf.exp:13999: --ERROR: Query expression source must be an aggregate.
/opt/scl/express_files/ap203_2nd_ed_is_part403ts_wg3n2635mim_lf.exp:13952: WARNING: Possibly ambiguous implicit downcast (direction?).
/opt/scl/express_files/ap203_2nd_ed_is_part403ts_wg3n2635mim_lf.exp:13953: WARNING: Possibly ambiguous implicit downcast (direction?).
/opt/scl/express_files/ap203_2nd_ed_is_part403ts_wg3n2635mim_lf.exp:16289: --ERROR: Query expression source must be an aggregate.
/opt/scl/express_files/ap203_2nd_ed_is_part403ts_wg3n2635mim_lf.exp:16286: --ERROR: Query expression source must be an aggregate.
/opt/scl/express_files/ap203_2nd_ed_is_part403ts_wg3n2635mim_lf.exp:14032: --ERROR: Query expression source must be an aggregate.
/opt/scl/express_files/ap203_2nd_ed_is_part403ts_wg3n2635mim_lf.exp:14033: --ERROR: Query expression source must be an aggregate.
/opt/scl/express_files/ap203_2nd_ed_is_part403ts_wg3n2635mim_lf.exp:14031: --ERROR: Query expression source must be an aggregate.
/opt/scl/express_files/ap203_2nd_ed_is_part403ts_wg3n2635mim_lf.exp:14019: --ERROR: Query expression source must be an aggregate.
/opt/scl/express_files/ap203_2nd_ed_is_part403ts_wg3n2635mim_lf.exp:14017: --ERROR: Query expression source must be an aggregate.
/opt/scl/express_files/ap203_2nd_ed_is_part403ts_wg3n2635mim_lf.exp:14015: --ERROR: Query expression source must be an aggregate.
/opt/scl/express_files/ap203_2nd_ed_is_part403ts_wg3n2635mim_lf.exp:16316: --ERROR: Query expression source must be an aggregate.
/opt/scl/express_files/ap203_2nd_ed_is_part403ts_wg3n2635mim_lf.exp:16304: --ERROR: Query expression source must be an aggregate.
/opt/scl/express_files/ap203_2nd_ed_is_part403ts_wg3n2635mim_lf.exp:16303: --ERROR: Query expression source must be an aggregate.
/opt/scl/express_files/ap203_2nd_ed_is_part403ts_wg3n2635mim_lf.exp:16344: WARNING: Possibly ambiguous implicit downcast (vector?).
/opt/scl/express_files/ap203_2nd_ed_is_part403ts_wg3n2635mim_lf.exp:16351: WARNING: Possibly ambiguous implicit downcast (vector?).
Errors in input
 
 
Compiling...
Makefile:32: make_schema: No such file or directory
make: *** No rule to make target `make_schema'.  Stop.
mkProbe was unsuccessful in creating the Schema Library.
 
Resolve previous error messages and try again.

Related errors in AP242,AP210E3

I think the following errors all have the same cause (an entity has the same name as an enum value). If so, this is related to #71, Redeclaration of XXX.

$ bin/fedex_plus ../data/cd242/242_n2813_mim_lf.exp 
../data/cd242/242_n2813_mim_lf.exp:2278: --ERROR: Expected a type (or entity) but point is expression.
../data/cd242/242_n2813_mim_lf.exp:1102: --ERROR: Expected a type (or entity) but line is expression.
../data/cd242/242_n2813_mim_lf.exp:16015: --ERROR: Unknown supertype point for entity degenerate_pcurve.
../data/cd242/242_n2813_mim_lf.exp:6018: --ERROR: Unknown supertype point for entity point_on_surface.
../data/cd242/242_n2813_mim_lf.exp:448: --ERROR: Expected a type (or entity) but point is expression.
../data/cd242/242_n2813_mim_lf.exp:3777: --ERROR: Expected a type (or entity) but point is expression.
../data/cd242/242_n2813_mim_lf.exp:3488: --ERROR: Expected a type (or entity) but plane is expression.
../data/cd242/242_n2813_mim_lf.exp:9514: --ERROR: Unknown supertype point for entity cartesian_point.
../data/cd242/242_n2813_mim_lf.exp:3483: --ERROR: Expected a type (or entity) but plane is expression.
../data/cd242/242_n2813_mim_lf.exp:2798: --ERROR: Expected a type (or entity) but point is expression.
../data/cd242/242_n2813_mim_lf.exp:24492: --ERROR: Unknown subtype plane for entity elementary_surface.
Errors in input

If enum values and types/entities can have the same name, perhaps enums should use a separate dictionary.

version string

In 6851b27, I added a version string that is printed with fedex_plus -v. However, the version string is only calculated at configure time, not at compile time.

  • The version of fedex_plus used for the generated code might differ from the other libs. Perhaps the version should be embedded by fedex_plus in the generated code and included in the libs via a header.
  • Print the version with p21read -v
  • Use something similar to what I wrote for mpictor/cutsim@497a878918047cd953bdfd5e23943d3817217814

ERROR: Indexing is only permitted on aggregates

Thomas Thurman wrote:

relevant to the error on line 21471 in the AP 210 mim schema processor.

context:

ENTITY general_datum_reference
...
SUBTYPE OF (shape_aspect);
base : datum_or_common_datum;
modifiers : OPTIONAL SET[1:?] OF datum_reference_modifier;
...
WR6: NOT('AP210_ELECTRONIC_ASSEMBLY_INTERCONNECT_AND_PACKAGING_DESIGN_MIM_LF.COMMON_DATUM_LIST' IN TYPEOF(base)) OR (SELF\shape_aspect.of_shape = base[1]\shape_aspect.of_shape);
END_ENTITY;

We purposely designed this rule to provide extra information to a processor to indicate that only in the case that base is a common_datum_list will there be an aggregate reference.

In 30739 we were not able to build the structure as one logical expression since there is an assignment statement,
but the modeling logic is similar.

Multiple inheritance is not well supported in fedex_plus

This schema gives the following error when running p21read_sdai_TEST_SCHEMA (that is, the compilation of fedex_plus outputs):

build\TEST_SCHEMA\SdaiTEST_SCHEMA.cc:337:65: error: 'class SdaiPerson_and_organization_address' has no member named 'people_'

The error is related to multiple inheritance of attributes and redefined attributes.

Part 3) of the SDAI C++ binding for a select class -- access functions for the data members of underlying entity types is not well implemented because it does not take care of redefined attributes (see selects.c line 1146).

SdaiPerson_and_organization_address has its own _personal_address_people, redefinition of people_. This redefined attribute should replace people_ on line SdaiTEST_SCHEMA.cc:337.

fedex_plus segfault

Backtrace

$ gdb --args bin/fedex_plus ../test/causes_crash.exp 
GNU gdb (GDB) 7.2-debian
...
Reading symbols from /opt/step/scl/build/bin/fedex_plus...done.
(gdb) r
Starting program: /opt/step/scl/build/bin/fedex_plus ../test/causes_crash.exp
fedex_plus: /opt/step/scl/src/express/hash.c:362: HASHsearch: Assertion `CurrentSegment != ((void *)0)' failed.

Program received signal SIGABRT, Aborted.
0x00007ffff6ea8405 in raise (sig=) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64      ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
        in ../nptl/sysdeps/unix/sysv/linux/raise.c
(gdb) bt
#0  0x00007ffff6ea8405 in raise (sig=) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  0x00007ffff6eab680 in abort () at abort.c:92
#2  0x00007ffff6ea15b1 in __assert_fail (assertion=0x7ffff79c78f9 "CurrentSegment != ((void *)0)", 
    file=, line=362, function=0x7ffff79c7917 "HASHsearch") at assert.c:81
#3  0x00007ffff79bd2b2 in HASHsearch (table=0x64000a, item=0x7fffffffc840, action=HASH_FIND)
    at /opt/step/scl/src/express/hash.c:362
#4  0x00007ffff79bcbae in DICTlookup (dictionary=0x64000a, name=0x6bc5c0 "END_ENTITY")
    at /opt/step/scl/src/express/dict.c:182
#5  0x00007ffff79baa18 in SCANprocess_identifier_or_keyword () at /opt/step/scl/src/express/lexact.c:332
#6  0x00007ffff79afd6c in yylex () at expscan.l:361
#7  0x00007ffff79aa294 in yyparse () at /opt/step/scl/build/src/express/expparse.c:2380
#8  0x00007ffff79bf7ad in PARSERrun (filename=0x6b74b0 "../test/causes_crash.exp", fp=0x6b7250)
    at /opt/step/scl/src/express/express.c:435
#9  0x00007ffff79bf6fa in EXPRESSparse (model=0x673330, fp=0x6b7250, 
    filename=0x6b74b0 "../test/causes_crash.exp") at /opt/step/scl/src/express/express.c:415
#10 0x0000000000408fcb in main (argc=2, argv=0x7fffffffe1f8) at /opt/step/scl/src/express/fedex.c:278

Schema

(*
_Every_ change I have made to the commented-out WR1 line below has caused fedex_plus to not abort,
with one exception.

  Changing the following causes fedex_plus to generate code:
  - number of spaces between -- and WR1
  - shortening the names of any of the entities referenced in SIZEOF

  This causes an error to be printed before the crash:
  - Removing the last letter of CHARACTERIZED_PRODUCT_DEFINITION causes fedex_plus to print a different error
*)

SCHEMA comment_causes_crash;

ENTITY crash_me;
  --    WR1: SIZEOF(['AP210_ELECTRONIC_ASSEMBLY_INTERCONNECT_AND_PACKAGING_DESIGN_MIM_LF.CHARACTERIZED_PRODUCT_DEFINITION', 'AP210_ELECTRONIC_ASSEMBLY_INTERCONNECT_AND_PACKAGING_DESIGN_MIM_LF.CHARACTERIZED_OBJECT'] * TYPEOF(SELF\property_definition.definition)) > 0;
END_ENTITY;

END_SCHEMA;

Changing the last part of the comment to the following affects output in the same way as deleting the last letter of CHARACTERIZED_PRODUCT_DEFINITION.

  This causes an error to be printed before the crash:
  - Removing the last letter of CHARACTERIZED_PRODUCT_DEFINITION causes fedex_plus to print
"fedex_plus: /opt/step/scl/src/express/hash.c:362: HASHsearch: Assertion `CurrentSegment != ((void *)0)' failed."
instead of simply "Aborted"

'abc\S\'def' is a valid Part 21 string

From Thomas Krijnen:

at work we've had issues with SCL-based implementations not being able to parse p21 files containing string values using an apostrophe in an encoding character sequence, e.g. 'abc\S'def' is actually valid but SCL fails to recognize this as such.

Use the header schema to generate cleditor/s_HEADER_SCHEMA.* (?)

Should the header schemae be used to generate s_HEADER_SCHEMA.h, s_HEADER_SCHEMA.cc, s_HEADER_SCHEMA.init.cc?

  • If yes, does the latest revision of that schema work with Edition 1 and N214 (the pre-DIS format) files? The files in cleditor/ appears to support N214 and Edition 1 DIS but not Edition 1 IS and (obviously) not Edition 2.
  • If the latest does not work with N214, how prevalent are these files? Is it worth maintaining support for them?
  • We will surely need to maintain support for Edition1 unless Edition 2 is backward compatible.

ap242/ap210 error - Redeclaration of xxx

From Tom Thurman:
-incorrect handling of enumerations; enum identifiers are being mixed in symbol table (sic) with entity identifiers.

5721 Redeclaration of line.  Previous declaration was on line 2060.
6007 Redeclaration of plane.  Previous declaration was on line 2066.
17461 Redeclaration of contacting_feature.  Previous declaration was on line 2050.
18756 Redeclaration of point.  Previous declaration was on line 2067.

Schema error list: ap242 and ap210

edit 04 Nov 11: update line numbers for CD

Part 21 - Trouble reading files with out-of-order entities

as1-pe-203 has many entities that are not in numerical order. p21read has trouble with this, but it doesn't seem to be repeatable with a small file, even if thousands of lines of whitespace are inserted below the higher-numbered entities and above the lower-numbered entities that the higher-numbered entites reference

edit: the underlying cause was SCL mis-handling strings ending with S. See pull request #76.

OSX p21read segfault

p21read has a segfault on OSX:

$ gdb --args ./p21read_sdai_AP214E3_2010 ../../data/ap214e3/dm1-id-214.stp 
GNU gdb 6.3.50-20050815 (Apple version gdb-1515) (Sat Jan 15 08:33:48 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries ......... done

(gdb) r
Starting program: /Users/thomas/Devel/StepClassLibrary/cmake-build/bin/p21read_sdai_AP214E3_2010 ../../data/ap214e3/dm1-id-214.stp
Reading symbols for shared libraries .++++++++ done

EXAMPLE :  load file ...
Reading Data from /Users/thomas/Devel/StepClassLibrary/data/ap214e3/dm1-id-214.stp...

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000010
0x0000000100e6e790 in AttrDescriptor::NonRefType (this=0x0) at /Users/thomas/Devel/StepClassLibrary/src/clstepcore/ExpDict.cc:625
625     if( _domainType ) {
(gdb) bt
#0  0x0000000100e6e790 in AttrDescriptor::NonRefType (this=0x0) at /Users/thomas/Devel/StepClassLibrary/src/clstepcore/ExpDict.cc:625
#1  0x0000000100e5ed06 in STEPattribute::NonRefType (this=0x1010ec600) at /Users/thomas/Devel/StepClassLibrary/src/clstepcore/STEPattribute.inline.cc:101
#2  0x0000000100e5c4b0 in STEPattribute::set_null (this=0x1010ec600) at /Users/thomas/Devel/StepClassLibrary/src/clstepcore/STEPattribute.cc:653
#3  0x0000000100e1b06a in SdaiFile_name::SdaiFile_name (this=0x1010ec520) at /Users/thomas/Devel/StepClassLibrary/src/cleditor/SdaiHeaderSchema.cc:228
#4  0x0000000100e1da56 in create_SdaiFile_name () at SdaiHeaderSchema.h:132
#5  0x0000000100e6d6f5 in Registry::ObjCreate (this=0x1010ea850, nm=0x7fff5fbfde10 "FILE_NAME", schnm=0x0, check_case=0) at /Users/thomas/Devel/StepClassLibrary/src/clstepcore/Registry.inline.cc:280
#6  0x0000000100e0f4fe in STEPfile::ReadHeader (this=0x7fff5fbfe900, in=@0x1010ebc40) at /Users/thomas/Devel/StepClassLibrary/src/cleditor/STEPfile.cc:154
#7  0x0000000100e0fd78 in STEPfile::AppendFile (this=0x7fff5fbfe900, in=0x1010ebc40, useTechCor=1) at /Users/thomas/Devel/StepClassLibrary/src/cleditor/STEPfile.cc:2265
#8  0x0000000100e120ec in STEPfile::ReadExchangeFile (this=0x7fff5fbfe900, filename=@0x7fff5fbfe9d0, useTechCor=1) at /Users/thomas/Devel/StepClassLibrary/src/cleditor/STEPfile.inline.cc:119
#9  0x0000000100003e9b in main (argc=2, argv=0x7fff5fbfea28) at /Users/thomas/Devel/StepClassLibrary/src/test/p21read/p21read.cc:131
(gdb) 

I think that the segfault is because aDesc is 0 at STEPattribute.inline.cc:101

At SdaiHeaderSchema.cc:227, a_5name is zero. It becomes param d at STEPattribute.inline.cc:34.

a_5name is initialized in SdaiHEADER_SECTION_SCHEMAInit() at SdaiHeaderSchemaInit.cc:71, which is called from HeaderSchemaInit(). A function pointer to HeaderSchemaInit() is passed to the Registry ctor in the STEPfile ctor.

There is an extern declaration in that file on line 21, as well:

extern void HeaderSchemaInit( Registry & reg );

I am not very familiar with extern, but I wonder if it is causing the unexpected behavior.


See also https://github.com/mpictor/StepClassLibrary/pull/85#issuecomment-2633438

proper handling of /* comments */ in exchange file

Looking through the BNF for Part 21, I don't see anything about comments.

I was testing a large (220 meg) file and noticed that SCL had trouble with comments inside entities, but not stand-alone comments. Are all of the comments below valid?

Also, if the comments in entities are valid, should they be written to the output file or discarded? I suspect that modifying SCL to save them won't be trivial, unless that functionality is present but broken.

small input file:

ISO-10303-21;
HEADER;
/* Generated by software containing ST-Developer
 * from STEP Tools, Inc. (www.steptools.com) 
 */
/* OPTION: using custom schema-name function */

FILE_DESCRIPTION(
/* description */ (''),
/* implementation_level */ '2;1');

FILE_NAME(
/* name */ 'ferrari sharknose',
/* time_stamp */ '2011-08-29T18:28:04+02:00',
/* author */ (''),
/* organization */ (''),
/* preprocessor_version */ 'ST-DEVELOPER v10',
/* originating_system */ '',
/* authorisation */ '');

FILE_SCHEMA (('AUTOMOTIVE_DESIGN'));
ENDSEC;

DATA;
#3595070=CARTESIAN_POINT('',(-225.634641,1981.754858,39.00155337));
#3595071=CARTESIAN_POINT('',(-225.5303759,1983.749129,38.89194937));
#3595072=CARTESIAN_POINT('',(-227.1763985,1953.834831,40.44931888));
ENDSEC;
END-ISO-10303-21;

output file:

ISO-10303-21;
HEADER;
/*Generated by software containing ST-Developer
 * from STEP Tools, Inc. (www.steptools.com) 
 */
/*OPTION: using custom schema-name function */
FILE_DESCRIPTION($,$);
FILE_NAME($,$,$,$,$,$,$);
FILE_SCHEMA(('AUTOMOTIVE_DESIGN'));
ENDSEC;
DATA;
#3595070=CARTESIAN_POINT('',(-225.634641,1981.754858,39.00155337));
#3595071=CARTESIAN_POINT('',(-225.5303759,1983.749129,38.89194937));
#3595072=CARTESIAN_POINT('',(-227.1763985,1953.834831,40.44931888));
ENDSEC;
END-ISO-10303-21;

output messages:

Reading Data from /opt/step/scl/test/p21-test-comments.stp...
ERROR:  ENTITY #1 File_Description
  description :  Delimiter expected after attribute value.
        Found invalid ENTITY value...
        data lost looking for end of attribute: * description */ (''
Error: Invalid character ',' in GetKeyword.
keyword was: 
Unable to create header section entity: ''.
        data lost: ,/*implementation_level*/'2;1')
ERROR:  ENTITY #2 File_Name
  name :        Found invalid string value...
        data lost looking for end of attribute: /* name */ 'ferrari sharknose'
  time_stamp :          Found invalid string value...
        data lost looking for end of attribute: /* time_stamp */ '2011-08-29T18:28:04+02:00'
  author :  Delimiter expected after attribute value.
        Found invalid ENTITY value...
        data lost looking for end of attribute: * author */ (''
Error: Invalid character ',' in GetKeyword.
keyword was: 
Unable to create header section entity: ''.
        data lost: ,/*implementation_level*/'2;1'),
/* organization */ (''),
/* preprocessor_version */ 'ST-DEVELOPER v10',
/* originating_system */ '',
/* authorisation */ '')
HEADER read:  4  ERRORS   0  WARNINGS

FIRST PASS complete:  3 instances created.
  0  ERRORS       0  WARNINGS

SECOND PASS complete:  3 instances valid.
  0  ERRORS       0  WARNINGS
Finished reading file.
Severity: SEVERITY_WARNING
User message in parens:
(  0  ERRORS      0  WARNINGS
)
EXAMPLE :  write file ...
Severity: SEVERITY_NULL

Statistics from p21read

  • Time reading and writing the exchange file
  • Measure memory consumption once file is read
  • Count number of entities
  • Other?
  • Print out these numbers, as well as the average time and memory per entity

ap242/ap210 error - Return type or local variable requires type label

From Tom Thurman:
-incorrect handling of GENERICS; part 11 does not require a variable defined in a LOCAL to have a type label.

37293   Return type or local variable requires type label in 'validate_dependently_instantiable_entity_data_types'
37295   Return type or local variable requires type label in 'validate_dependently_instantiable_entity_data_types'

Schema error list: ap242 and ap210

edit 04 Nov 11: update line numbers for CD version of 242

fedex_plus: enums should be in schema namespace

See output of scl/test/unitary_schemas/enums_same_name.exp

in SdaiTEST_ENUMS_SAME_NAME.h:

//////////  ENUMERATION TYPE hair_color
enum Hair_color {
        Hair_color__red,
        Hair_color__bald,
        Hair_color_unset
};

This should be in namespace test_enums_same_name.

Create schema matrix from ctest output

build_all.sh requires modification every time a new schema is added, and it is not integrated with CTest. It should be replaced with a script that takes advantage of CTest. I suspect that python will be best for this.

The script will need to parse the ctest xml (in build_dir/Testing/datestamp/Text.xml) and write a file in one of the formats supported by the github wiki.

Ideally, this could be automatically uploaded to the wiki, if it can be done without a username and password embedded in the script.

part 21 read/write issues with ap203e2

Craig pointed out to me that as1-tu-203.stp conforms to a schema called CONFIGURATION_CONTROL_3D_DESIGN_ED2_MIM_LF.

The schema that is named ap203e2_mim_lf.exp in the SCL repo is Ap203_configuration_controlled_3d_design_of_mechanical_parts_and_assemblies_mim_lf. Apparently, SCL is not checking the schema name from a part 21 file. This schema lacks PRODUCT_CATEGORY_RELATIONSHIP, which is used in as1-tu-203.stp.

In as1_pe_203.stp, the entities are not in order. I assume this is what trips SCL up, as it complains that it can't find entity # 1.

Unuseful line in lexact.c

In the file lexact.c, the function SCANsave_comment is defined at line 431. gcc, with -Wall -Wextra, reports an issue at line 433 with the line "last_comment = last_comment" :
This function is defined as:

void
SCANsave_comment( void ) {
    strcpy( last_comment_, yytext );
    last_comment = last_comment;
}

I do think that an unsercore "_" is missing in this line. Shouldn't it be:

last_comment = last_comment_

?

Fix format compiler warnings

There are still a set of warnings reported by gcc-4.2.1 I don't know how to fix. They are all of type:
too many arguments for format.

For instance, take the line 1511 of file fedex_plus/classes.c:
fprintf( file, "\t((EnumNode*)n)->node->put( (int)x[i] );\n", nm );

nmcan be removed in order to fix the warning. However, what was the former developers intent with this mnvariable? Is it really unuseful? If not, where does it go in the format string?

5 or 6 warnings are of this type.

p21read trashes strings

p21read writes many (but not all) strings as $ - not just strings that were empty.

This output is from commit 76c9d99bc3e1851cbbab9fad7aa10f01cbfe9589.

I created a small p21 file from as1-oc-214.stp. I ran p21read_sdai_AUTOMOTIVE_DESIGN on it, and compared input and output with diff:
diff -u ../../data/parts/dollarsign214.stp file.out

--- ../../data/parts/dollarsign214.stp  2011-09-13 21:50:38.000000000 -0400
+++ file.out    2011-09-13 22:03:10.000000000 -0400
@@ -1,21 +1,17 @@
-ISO-10303-21;
-HEADER;
-FILE_DESCRIPTION(('Open CASCADE Model'),'2;1');
-FILE_NAME('Open CASCADE Shape Model','2008-07-24T15:00:20',(
-    '--- Datakit Converter ---'),('--- Datakit www.datakit.com---'),
-  ' Release Version  Jun 30 2008','Open CASCADE 6.1',' ');
-FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 1 1 1 1 }'));
-ENDSEC;
-DATA;
-#1 = APPLICATION_PROTOCOL_DEFINITION('international standard',
-  'automotive_design',2000,#2);
-#2 = APPLICATION_CONTEXT(
-  'core data for automotive mechanical design processes');
-#4 = PRODUCT_DEFINITION_SHAPE('','',#5);
-#5 = PRODUCT_DEFINITION('design','',#6,#9);
-#6 = PRODUCT_DEFINITION_FORMATION('','',#7);
-#7 = PRODUCT('as1','as1','',(#8));
-#8 = PRODUCT_CONTEXT('',#2,'mechanical');
-#9 = PRODUCT_DEFINITION_CONTEXT('part definition',#2,'design');
-ENDSEC;
-END-ISO-10303-21;
+ISO-10303-21;
+HEADER;
+FILE_DESCRIPTION(('Open CASCADE Model'),$);
+FILE_NAME($,$,('--- Datakit Converter ---'),('--- Datakit www.datakit.com---'),$,$,$);
+FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 1 1 1 1 }'));
+ENDSEC;
+DATA;
+#1=APPLICATION_PROTOCOL_DEFINITION($,$,2000,#2);
+#2=APPLICATION_CONTEXT($);
+#4=PRODUCT_DEFINITION_SHAPE($,$,#5);
+#5=PRODUCT_DEFINITION($,$,#6,#9);
+#6=PRODUCT_DEFINITION_FORMATION($,$,#7);
+#7=PRODUCT($,$,$,(#8));
+#8=PRODUCT_CONTEXT($,#2,$);
+#9=PRODUCT_DEFINITION_CONTEXT($,#2,$);
+ENDSEC;
+END-ISO-10303-21;

Occurrences of << "$" and = "$" in scl/src:

$ grep -r '= "$"' * -n

clstepcore/STEPundefined.cc:121:        s = "$";
clstepcore/STEPaggregate.cc:756:        s = "$";
clstepcore/STEPaggregate.cc:1011:        s = "$";
clstepcore/sdaiBinary.cc:50:        s = "$";

$ grep -r '<< "$"' * -n

clstepcore/STEPundefined.cc:131:        out << "$";
clstepcore/STEPaggregate.cc:766:        out << "$";
clstepcore/STEPaggregate.cc:1021:        out << "$";
clstepcore/sdaiBinary.cc:33:        out << "$";
clstepcore/sdaiSelect.cc:522:        out << "$";
clstepcore/STEPattribute.cc:549:        out << "$";
clstepcore/STEPattribute.cc:614:                out << "$";
clstepcore/STEPattribute.cc:636:                out << "$";
clstepcore/STEPattribute.cc:656:                out << "$";
clstepcore/STEPattribute.cc:685:                out << "$";
clstepcore/STEPattribute.cc:704:                out << "$";

files with identical names and similar content

There are a number of files with the same names in different dirs.
Some are identical:

src/test/tio/testfile.step              
src/test/p21read/testfile.step

src/fedex_plus/non-ors.cc
src/clstepcore/non-ors.cc

src/fedex_plus/match-ors.cc
src/clstepcore/match-ors.cc

src/fedex_plus/trynext.cc
src/clstepcore/trynext.cc

src/cleditor/needFunc.h
src/test/needFunc.h

src/cleditor/needFunc.cc
src/test/needFunc.cc

Others are not identical:

size    name

6244    src/clstepcore/collect.cc
6238    src/fedex_plus/collect.cc
10016   src/clstepcore/complexlist.cc
11122   src/fedex_plus/complexlist.cc
12363   src/clstepcore/complexSupport.h
12679   src/fedex_plus/complexSupport.h
4265    src/clstepcore/entlist.cc
4580    src/fedex_plus/entlist.cc
6372    src/clstepcore/entnode.cc
4504    src/fedex_plus/entnode.cc
8000    src/clstepcore/multlist.cc
12411   src/fedex_plus/multlist.cc
3277    src/clstepcore/orlist.cc
3283    src/fedex_plus/orlist.cc
3348    src/clstepcore/print.cc
3344    src/fedex_plus/print.cc

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.