[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Echoing Line on errors



You can get line numbers from tokens, but not from productions. 

-----Original Message-----
From:
sablecc-discussion-bounces+chris.vankirk=fdcjapan.com@xxxxxxxxxxxxxxxxx
[mailto:sablecc-discussion-bounces+chris.vankirk=fdcjapan.com@xxxxxxxxxxxxxx
org] On Behalf Of Roger Pomeroy
Sent: Friday, October 31, 2008 6:53 AM
To: sablecc-discussion@xxxxxxxxxxxxxxxxx
Subject: Echoing Line on errors


Is there an easy way to access the lines of the file for error reporting
purposes?  When I am walking my tree, interpreting the code, I may encounter
an error that needs to be reported to the user.  I can get the line number
from the token, for example, but can I then access the line and show the
user where on the line that is happening? 
Note that this is not for finding syntax errors, but rather for execution
errors as I am interpreting (executing) the code as I walk the tree?

Roger

-- 
See Exclusive Video: Hollywood Life's 5th Annual Style Awards
http://www.hollywoodlife.net/Awards.aspx?AwardsID=style2008


_______________________________________________
SableCC-Discussion mailing list
SableCC-Discussion@xxxxxxxxxxxxxxxxx
http://lists.sablecc.org/listinfo/sablecc-discussion