How to make yyerror() report line?

View: New views
3 Messages — Rating Filter:   Alert me  

How to make yyerror() report line?

by Rui Maciel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

How is it possible to make yyerror also report the line where an error was
found?


Thanks in advance,
Rui Maciel


_______________________________________________
help-bison@... http://lists.gnu.org/mailman/listinfo/help-bison

Parent Message unknown Re: How to make yyerror() report line?

by Luca Marzolla :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Rui Maciel ha scritto:

> How is it possible to make yyerror also report the line where an error was
> found?
>
>
> Thanks in advance,
> Rui Maciel
>
>
> _______________________________________________
> help-bison@... http://lists.gnu.org/mailman/listinfo/help-bison
>
>  
Use yylineno variable.
See %option yylineno in Flex:
http://flex.sourceforge.net/manual/Options-Affecting-Scanner-Behavior.html#Options-Affecting-Scanner-Behavior

Luca




_______________________________________________
help-bison@... http://lists.gnu.org/mailman/listinfo/help-bison

Re: How to make yyerror() report line?

by Rui Maciel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Luca Marzolla wrote:

> Use yylineno variable.
> See %option yylineno in Flex:
> http://flex.sourceforge.net/manual/Options-Affecting-Scanner-Behavior.html#
> Options-Affecting-Scanner-Behavior

Thanks, Luca. It was just what the doctor ordered. Thanks!


Best regards,
Rui Maciel


_______________________________________________
help-bison@... http://lists.gnu.org/mailman/listinfo/help-bison