mpictor/StepClassLibrary — Issue #87: proper handling of /* comments */ in exchange file
Author: mpictor
Created: 2011-11-04 15:55:03+00:00
State: open

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