d: create getter for the number of errors from the parser

* data/skeletons/lalr1.d: Here.
This commit is contained in:
Adela Vais
2021-01-07 14:02:01 +02:00
committed by Akim Demaille
parent c13b3c02d3
commit 8d01c60e9c

View File

@@ -303,6 +303,12 @@ b4_user_union_members
yylexer.yyerror (]b4_locations_if([loc, ])[s);
}
/**
* The number of syntax errors so far.
*/
public int numberOfErrors() const { return yynerrs_; }
private int yynerrs_ = 0;
/**
* Returned by a Bison action in order to stop the parsing process and
* return success (<tt>true</tt>). */
@@ -434,7 +440,7 @@ b4_user_union_members
YYStack yystack;
/* Error handling. */
int yynerrs_ = 0;]b4_locations_if([[
]b4_locations_if([[
/// The location where the error started.
Location yyerrloc;