Bug 71530 - [Scanner] CModel Line Numbers are incorrect w/Scanner2
Summary: [Scanner] CModel Line Numbers are incorrect w/Scanner2
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-parser (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows XP
: P2 major (vote)
Target Milestone: 2.0.1   Edit
Assignee: John Camelon CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-05 18:11 EDT by John Camelon CLA
Modified: 2004-08-16 15:58 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Camelon CLA 2004-08-05 18:11:38 EDT
I'm raising this defect as a placeholder for the regression that our new 
Scanner migration has created.  

Both our CModelElementsTest (Quick & Structural) have the body of 
checkLineNumbers() commented out.  These tests fail regularily.
Comment 1 John Camelon CLA 2004-08-16 15:34:30 EDT
I haven't committed this fix yet, as it negatively affects performance.  

Attempt 1 (where we keep track of \n's throughout the scanner) yielded 
incorrect results.  

Attempt 2 (where we figure it out as we go without storing information) hurt 
our performance by an order of magnitude ... ~41 seconds to parse the trilogy. 

Attempt 3 (where we store some meta-data to help us take shortcuts in figuring 
out line numbers) yield 30% degradation over what is currently in 2.0.1 
branch/HEAD.  

I'll keep plowing away at this with further optimizations.  
Since we do not need line numbers for content assist, I plan to short-circuit 
this code in COMPLETION_PARSE mode.  The same can go for handleProblem() since 
Content Assist cares not for IProblem.  
Comment 2 John Camelon CLA 2004-08-16 15:58:01 EDT
I've managed to find a solution which adds only a couple of milliseconds 
overhead to parsing the trilogy.  

Fix applied to HEAD and 2_0 branch.