[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Fwd: help with syntax errors]
Hi Brad,
I think that what you describe is not possible with the current
version Of SableCC. We need to make this the ability to restore the
parser to a correct state, provided for example by a command within
the SableCC grammar that allow us to "jump" to a state in case of
error.
I've seen some kind of other CC tool that allow this, but they are far
less objet oriented than SableCC.
If you take a look at the SableCC newsgroup, there's a discussion
about your kind of problem, and the overall conclusion is that is not
a good idea to "bufferize" the errors messages.
Anyway, I have a tricky solution : Think about gettting the line
number of the error when it occurs, and after this restart the parser
on the next line in your input stream. This could work if you're
grammar is simple.
(If I'm wrong, I hope that Etienne will correct me ;-)
Regards,
Nadir
______________________________ Reply Separator _________________________________
Subject: [Fwd: help with syntax errors]
Author: egagnon (egagnon@j-meg.com) at internet
Date: 11/04/00 16:31
From: "Bradley Slater" <bradleys@usko-e.com>
To: <sablecc-list@sable.mcgill.ca>
Subject: help with syntax errors
Date: Tue, 11 Apr 2000 15:26:31 +0200
Hi,
Please could you help me with a problem,
Take for example, the minibasic example, when I purposely place a syntax
error in test.basic the interpreter will give me an error. Say for
example I did not want the interpreter to give me a error and instead I
wanted to log the error and continue with the interpreting, how would I
go about modifing the java files that SableCC produces to be able to do
this
Thanks,
Bradley Slater
BradleyS@usko-e.com