MantisBT - Community
View Issue Details
0025171Community[OCCT] OCCT:Data Exchangepublic2014-08-20 14:162020-12-02 17:11
drazmyslovich 
bugmaster 
normalmajor 
closedfixed 
WindowsVC++ 201064 bit
[OCCT] 6.6.0 
[OCCT] 7.5.0[OCCT] 7.5.0 
bugs/step/bug25171
0025171: Data Exchange, STEP Lexer - the strings with quote sign inside can't be properly lexed
In my case, I had a file generated by PRO/ENGINEER with some french words used as strings. Example: DESCRIPTIVE_REPRESENTATION_ITEM('MATIERE', 'Fil d'acier');
The current STEP lexer can't properly handle this situation and the application refuses to parse a file at all.
ReadStep D c:/as1-oc-214_parse_error.stp
No tags attached.
related to 0030014closed bugmaster Community Data Exchange - Step File import does not create shapes, after transfer roots 
? as1-oc-214_parse_error.stp (441,968) 2014-08-20 14:16
https://tracker.dev.opencascade.org/
c lex.step.c (50,704) 2014-08-20 14:25
https://tracker.dev.opencascade.org/
Issue History
2014-08-20 14:16drazmyslovichNew Issue
2014-08-20 14:16drazmyslovichAssigned To => gka
2014-08-20 14:16drazmyslovichFile Added: as1-oc-214_parse_error.stp
2014-08-20 14:25drazmyslovichNote Added: 0030935
2014-08-20 14:25drazmyslovichFile Added: lex.step.c
2014-08-20 14:26drazmyslovichNote Added: 0030936
2014-08-20 14:26drazmyslovichStatusnew => assigned
2014-08-20 14:27drazmyslovichDescription Updatedbug_revision_view_page.php?rev_id=7902#r7902
2014-09-26 16:21abvTarget Version6.8.0 => 7.1.0
2015-01-29 13:42akzNote Added: 0036813
2016-10-26 12:14gkaTarget Version7.1.0 => 7.2.0
2017-07-27 09:33abvTarget Version7.2.0 => 7.4.0
2019-07-10 21:58abvTarget Version7.4.0 => 7.5.0
2020-09-10 13:18abvRelationship addedrelated to 0030848
2020-09-10 13:38abvAssigned Togka => dpasukhi
2020-09-14 13:57gitNote Added: 0094722
2020-09-14 14:38dpasukhiNote Added: 0094734
2020-09-15 12:51dpasukhiNote Added: 0094824
2020-09-15 12:51dpasukhiAssigned Todpasukhi => ika
2020-09-15 12:51dpasukhiStatusassigned => resolved
2020-09-15 12:51dpasukhiSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=23468#r23468
2020-09-17 20:56gitNote Added: 0094981
2020-09-18 09:54kgvSummarySTEP Lexer - the strings with quote sign inside can't be properly lexed => Data Exchange, STEP Lexer - the strings with quote sign inside can't be properly lexed
2020-09-18 10:59ikaNote Added: 0095013
2020-09-18 10:59ikaAssigned Toika => bugmaster
2020-09-18 10:59ikaStatusresolved => reviewed
2020-09-18 11:07dpasukhiNote Edited: 0094824bug_revision_view_page.php?bugnote_id=94824#r23533
2020-09-18 11:19ikaRelationship addedrelated to 0025440
2020-09-18 11:21ikaRelationship addedrelated to 0030014
2020-09-18 11:21ikaRelationship addedrelated to 0031191
2020-09-18 11:22ikaRelationship addedrelated to 0030539
2020-09-19 15:52bugmasterTest case number => bugs/step/bug25171
2020-09-19 17:23bugmasterNote Added: 0095089
2020-09-19 17:23bugmasterStatusreviewed => tested
2020-09-20 10:55bugmasterChangeset attached => occt master 4661dcad
2020-09-20 10:55bugmasterStatustested => verified
2020-09-20 10:55bugmasterResolutionopen => fixed
2020-09-20 11:13gitNote Added: 0095105
2020-12-02 16:40emoFixed in Version => 7.5.0
2020-12-02 17:11emoStatusverified => closed

Notes
(0030935)
drazmyslovich   
2014-08-20 14:25   
Unfortunately, here I can't provide a straight-forward fix to the problem. As a temporary fix on my side I use the modified lex.step.c file, which normally generated by flex from step.lex file.
Since, I'm not that familiar with flex syntax, I would prefer somebody else to fix the original source file. While the modified lex.step.c I've attached to this ticket (all modification are marked with 0025171 string - 5 modifications in total)
(0030936)
drazmyslovich   
2014-08-20 14:26   
Please, check the provided modifications and fix the original source file.
(0036813)
akz   
2015-01-29 13:42   
The problem is that the regular expression for the text arguments (described in step.lex) does not pass the single apostrophe - ' in the text.

Current regexp for the text arguments:
[\']([\n]|[\000\011-\046\050-\176\201-\237\240-\777]|[\047][\047])*[\']
(0094722)
git   
2020-09-14 13:57   
Branch CR25171 has been created by dpasukhi.

SHA-1: 48a8d0aba30d50304b0047d1975cfed7f48cf95e


Detailed log of new commits:

Author: dpasukhi
Date: Sun Sep 13 13:23:00 2020 +0300

    0025171: STEP Lexer - the strings with quote sign inside can't be properly lexed
    
    Add a test case to verify that the .STEP is read correctly

Author: dpasukhi
Date: Sun Sep 13 12:43:48 2020 +0300

    0030539: Data Exchange - Step file can't be imported (ADT.step)
    
    Add a test case to verify that the .STEP is read correctly

Author: dpasukhi
Date: Sun Sep 13 13:05:04 2020 +0300

    0031191: Data Exchange - STEP import returns empty shape for a file written by SolidWorks 2018
    
    Add a test case to verify that the .STEP is read correctly

Author: dpasukhi
Date: Sun Sep 13 13:12:16 2020 +0300

    0030014: Step File import does not create shapes, after transfer roots
    
    Add a test case to verify that the .STEP is read correctly

Author: dpasukhi
Date: Sun Sep 13 11:35:47 2020 +0300

    0025440: Data Exchange - STEP file with Japanese unicode symbols cannot be read
    
    Add a test case to verify that the .STEP is read correctly
(0094734)
dpasukhi   
2020-09-14 14:38   
Fix included in branch CR30848_3 is reviewed, tested and integrated.
Test cases ( with related issues ) added to verify that the .STEP is read correctly.
(0094824)
dpasukhi   
2020-09-15 12:51   
(edited on: 2020-09-18 11:07)
Dear Irina,
please review CR25171/
All tests are Ok. NO regressions/
Related issues:
 - #0025440
 - 0030014
 - #0031191
 - #0030539
Fix included in 0030848.

(0094981)
git   
2020-09-17 20:56   
Branch CR25171 has been updated forcibly by dpasukhi.

SHA-1: 1c393bbf3c9c91c593cf3a20d9365d1e601c41ab
(0095013)
ika   
2020-09-18 10:59   
No remarks.

Dear bugmaster,

please integrate
OCCT-CR25171
Products - NOT
(0095089)
bugmaster   
2020-09-19 17:23   
Combination -
OCCT branch : IR-2020-09-18
master SHA - b0b766826118f74b9857a932b8cec8c52a25c492
a206de37fbfa0bf71bd534ae47192bbec23b8522
Products branch : IR-2020-09-18 SHA - a6486d839da1ba1383ef6cc1a1a446a172f494c7
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian80-64:
OCCT
Total CPU difference: 17528.97000000011 / 17378.390000000145 [+0.87%]
Products
Total CPU difference: 12127.32000000009 / 12079.540000000095 [+0.40%]
Windows-64-VC14:
OCCT
Total CPU difference: 18862.703125 / 18898.921875 [-0.19%]
Products
Total CPU difference: 13314.828125 / 13329.21875 [-0.11%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
(0095105)
git   
2020-09-20 11:13   
Branch CR25171 has been deleted by inv.

SHA-1: 1c393bbf3c9c91c593cf3a20d9365d1e601c41ab