mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 20:33:03 +00:00
java: example: improve
* examples/java/Calc.y: Propagate the exit status. Support -p.
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
%define api.parser.public
|
||||
|
||||
%define parse.error verbose
|
||||
%define parse.trace
|
||||
|
||||
%locations
|
||||
|
||||
%code imports {
|
||||
@@ -19,7 +21,11 @@
|
||||
{
|
||||
CalcLexer l = new CalcLexer (System.in);
|
||||
Calc p = new Calc (l);
|
||||
p.parse ();
|
||||
for (String arg : args)
|
||||
if (arg.equals ("-p"))
|
||||
p.setDebugLevel (1);
|
||||
if (!p.parse ())
|
||||
System.exit (1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user