Talk:Syntax checking/Parser
find more than one error
As far as I've seen, the Parser throws an ERROR as soon as it doesn't like something in the source, which aborts parsing. The found error is in the SHARED_ERROR_HANDLER's error_list (I've never seen more than one error in there, why is it a list anyway?). Has anybody found a way to tell the parser to parse the whole file?
maser 14:55, 17 May 2006 (CEST)
Hmmm... I don't know how to get all the errors with one call. But you haven't to parse the whole file, so you can parse piecewise and if an error occurs, you have to parse after the string that occurs the error. This is a way to get all errors, it's complicated, but it should work!?
Chrigu 17:19, 17 May 2006 (CEST)
Actually read http://www.gobosoft.com/eiffel/gobo/geyacc/error.html for more info on how modifying `eiffel.y' to recover from error and therefore detect more than one error at a time.
--manus 18:10, 17 May 2006 (CEST)
Chrigu: How exactly do you parse piecewise? Though it wouldn't solve the problem because there can be several errors in one piece.
Manu: Thanks for the hint! Looks very promising!
maser 22:55, 17 May 2006 (CEST)
Maser: Couldn't we read several strings of the file and use parse_with_string instead of parse? I'm not sure...
Chrigu 15:52, 18 May 2006 (CEST)
Chrigu: A normal EIFFEL_PARSER accepts just classes, but you can use set_expression_parser (or some other `Parser type setting' feature) to create a parser that parses Eiffel expressions (I knew I had seen something like that before, but couldn't find it yesterday). But changing the eiffel.y file seems like a better solution. Maybe we should use expression and/or feature parsers while checking if a previously found error has been corrected by the user (I assume parsing just one expression is pretty fast).
I've looked through the documentation of gayacc and I think it shouldn't be too difficult to change eiffel.y to our needs, the file's size will probably bethe biggest problem.
maser 16:31, 18 May 2006 (CEST)