amber@dartvax.UUCP (11/07/83)
I realize that trying to get YACC to handle errors gracefully is difficult, but that sort of thing makes the world go around. So.... Is there any way to get at the token that YACC dies on, resulting in the error recovery? The 'error' operator in YACC will scan off tokens until it recovers and I'd like to get at the first token it scanned off to see why it died. Any suggestions would be appreciated. -David Kovar ...decvax!dartvax!amber
jay@rochester.UUCP (Jay Weber) (11/08/83)
When an error is detected, the yacc variable "yychar" will be set to the lookahead token number. For character tokens like ';', the token number will be the integer value corresponding to it, but if it is a declared token then you will have to come up with a cross-reference table if you want what the token is in english. Jay Weber {..!seismo!rochester!jay, jay@rochester.arpa}