s1s0 / toped

Cross platform, open source IC layout editor
http://www.toped.org.uk/
GNU General Public License v2.0
15 stars 8 forks source link

warning and error messages have to include their complete location #133

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
if there are several files (with errors) which should be included
some error messages are quite un-precise in terms of the error location.

To illustrate the problem here an example:
----------------------------
<= Parsing 
"/home/taschi/work/private/toped/user_functions/technology/mosis_SCMOS_p2m6/laye
r.tll" ...
<= Parsing "/home/taschi/work/private/toped/user_functions/config/config.tll" 
...
<= Parsing 
"/home/taschi/work/private/toped/user_functions/config/config_misc.tll" ...
<= Parsing 
"/home/taschi/work/private/toped/user_functions/config/config_pattern.tll" ...
<= Parsing 
"/home/taschi/work/private/toped/user_functions/config/config_color.tll" ...
<= Parsing 
"/home/taschi/work/private/toped/user_functions/config/config_color_rgb.tll" ...
<= Parsing 
"/home/taschi/work/private/toped/user_functions/technology/mosis_SCMOS_p2m6/drc.
tll" ...
<= Parsing "/home/taschi/work/private/toped/user_functions/general/wires.tll" 
...
<= Parsing 
"/home/taschi/work/private/toped/user_functions/general/definitions.tll" ...
<= Parsing 
"/home/taschi/work/private/toped/user_functions/technology/helper.tll" ...
<= Parsing 
"/home/taschi/work/private/toped/user_functions/general/definitions.tll" ...
<= Parsing 
"/home/taschi/work/private/toped/user_functions/technology/default.tll" ...
<= Parsing "/home/taschi/work/private/toped/user_functions/general/helper.tll" 
...
<= Parsing 
"/home/taschi/work/private/toped/user_functions/general/definitions.tll" ...
<= line 177: col 29: syntax error, unexpected tknIDENTIFIER, expecting '{'
<= Parsing 
"/home/taschi/work/private/toped/user_functions/general/geometry.tll" ...
<= Parsing 
"/home/taschi/work/private/toped/user_functions/general/definitions.tll" ...
<= Parsing 
"/home/taschi/work/private/toped/user_functions/technology/default.tll" ...
<= Parsing "/home/taschi/work/private/toped/user_functions/general/helper.tll" 
...
<= line 56: col 10: in file "general/wires.tll" : variable not defined in this 
scope
<= Parsing "/home/taschi/work/private/toped/user_functions/general/helper.tll" 
...
<= line 7: col 11: syntax error, unexpected tknSTRING, expecting ')'
-----------------------------------

line 177 from which file? (definitions.tll has just 50 lines --> error can't be 
there)

g
armin

Original issue reported on code.google.com by analogc...@gmx.net on 20 Jan 2012 at 10:01

GoogleCodeExporter commented 9 years ago
The error message is certainly supposed to be related to the last file in the 
parse list. So - if there is no line 177 in definitions.tll - it is a bug in 
the location tracing of the lexer - let's fix it. (need a test case to recreate 
it)
It is quite possible that a message is missing here - something like:
"back to <the file where definitions.tll is included from>

I don't like the idea each error message to include complete location: Here is 
a small taster how it would look like:

<= "/home/taschi/work/private/toped/user_functions/general/definitions.tll" 
line 177: col 29: syntax error, unexpected tknIDENTIFIER, expecting '{'

Hard enough to get the essence of the error message

Bottom line - I need a test case to recreate the problem and to fix the lexer's 
tracker.

Original comment by krustev....@gmail.com on 22 Jan 2012 at 11:56

GoogleCodeExporter commented 9 years ago
I remember the error was actually in technology/helper.tll
and I agree, to including the complete path could make the error message quite 
long. I had just something in mind like in one of your other error messages
"<= line 56: col 10: in file "general/wires.tll" : variable not defined in this 
scope"

but your suggestion would be fine for me as long as the error-position can be 
backtracked.

I'll try to create a test-case but as you can see a lot of files are included 
-- could take some time.

Original comment by analogc...@gmx.net on 23 Jan 2012 at 9:59

GoogleCodeExporter commented 9 years ago
A missing info line:
Back to "<file name>" ...
is added in r2053.

Armin, would you try it and update this issue accordingly

Original comment by krustev....@gmail.com on 23 Jan 2012 at 11:29

GoogleCodeExporter commented 9 years ago

Original comment by krustev....@gmail.com on 23 Jan 2012 at 11:30

GoogleCodeExporter commented 9 years ago
Attached you will find a test case:
(error can be found in "bug5_tll2.tll")

Before rev2053:
=> #include "bug5.tll"
<= Parsing "/home/xxx/toped/bugs/jan2012/bug5.tll" ...
<= Parsing "/home/xxx/toped/bugs/jan2012/bug5_inc3.tll" ...
<= Parsing "/home/xxx/toped/bugs/jan2012/bug5_inc1.tll" ...
<= Parsing "/home/xxx/toped/bugs/jan2012/bug5_inc2.tll" ...
<= Parsing "/home/xxx/toped/bugs/jan2012/bug5_inc3.tll" ...
<= Parsing "/home/xxx/toped/bugs/jan2012/bug5_inc1.tll" ...
<= line 12: col 27: syntax error, unexpected ')'

error localization doesn't work properly

After rev2053:
=> #include "bug5.tll"
<= Parsing "/home/xxx/toped/bugs/jan2012/bug5.tll" ...
<= Parsing "/home/xxx/toped/bugs/jan2012/bug5_inc3.tll" ...
<= Parsing "/home/xxx/toped/bugs/jan2012/bug5_inc1.tll" ...
<= Back to "/home/xxx/toped/bugs/jan2012/bug5_inc3.tll" ...
<= Back to "/home/xxx/toped/bugs/jan2012/bug5.tll" ...
<= Parsing "/home/xxx/toped/bugs/jan2012/bug5_inc2.tll" ...
<= Parsing "/home/xxx/toped/bugs/jan2012/bug5_inc3.tll" ...
<= Back to "/home/xxx/toped/bugs/jan2012/bug5_inc2.tll" ...
<= Parsing "/home/xxx/toped/bugs/jan2012/bug5_inc1.tll" ...
<= Back to "/home/xxx/toped/bugs/jan2012/bug5_inc2.tll" ...
<= line 12: col 27: syntax error, unexpected ')'
<= Back to "/home/xxx/toped/bugs/jan2012/bug5.tll" ...

Seems, the analyser is working now more "accurate" ..

.. and fixes the issue 

Original comment by analogc...@gmx.net on 25 Jan 2012 at 8:27

Attachments:

GoogleCodeExporter commented 9 years ago
Maybe just one more comment on this issue:

Obviously a small bug was involved with this issue which is fixed now. But 
maybe this makes the newly introduced "back to .." information unnecessary. 
Anyway, it could be valuable in the case of errors for debugging reasons. For 
the default behavior the additional lines just blow up the number of messages.

This is my personal opinion  .. but I don't mind if you like to have it as it 
is now.

Original comment by analogc...@gmx.net on 25 Jan 2012 at 9:06

GoogleCodeExporter commented 9 years ago

Original comment by krustev....@gmail.com on 1 Apr 2012 at 12:21