bison-patches
[Top][All Lists]
Advanced

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

[PATCH] master: lalr1.cc: syntax_error as exceptions


From: Akim Demaille
Subject: [PATCH] master: lalr1.cc: syntax_error as exceptions
Date: Wed, 9 Sep 2009 16:43:18 +0200


It is common to use sort of factories in the user actions.  These
factories may check some "syntactic" constraints that are not
enforced by the grammar itself.  This is possible using YYERROR
within the action itself.  Provide the user with a means to throw
a syntax_error exception.

        * data/c++.m4 (b4_public_types_declare, b4_public_types_define):
        Declare and define yy::parser::syntax_error.
        * data/lalr1.cc: Include stdexcept.
        (yy::parser::parse): Wrap the user action within a try/catch.
        * data/glr.cc: Include stdexcept.


Attachment: 0002-lalr1.cc-syntax_error-as-exceptions.txt
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]