c++: make operator() an alias to the parse function

* data/glr.cc, data/lalr1.cc (operator()): New.
* doc/bison.texi: Update.
This commit is contained in:
Akim Demaille
2018-10-23 18:42:37 +02:00
parent facfd9c406
commit f9bba892bd
4 changed files with 26 additions and 2 deletions

View File

@@ -10714,8 +10714,10 @@ Build a new parser object. There are no arguments, unless
Instantiate a syntax-error exception.
@end deftypeop
@deftypemethod {parser} {int} parse ()
Run the syntactic analysis, and return 0 on success, 1 otherwise.
@deftypemethod {parser} {int} operator() ()
@deftypemethodx {parser} {int} parse ()
Run the syntactic analysis, and return 0 on success, 1 otherwise. Both
routines are equivalent, @code{operator()} being more C++ish.
@cindex exceptions
The whole function is wrapped in a @code{try}/@code{catch} block, so that