mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 20:33:03 +00:00
examples: clean up the Java/D examples
* examples/java/Calc.y: Fix indentation. Sort. Don't use %name-prefix, since api.parser.class is already defined. * examples/d/calc.y: Likewise.
This commit is contained in:
@@ -1,9 +1,19 @@
|
||||
%language "Java"
|
||||
%name-prefix "Calc"
|
||||
|
||||
%define api.parser.class {Calc}
|
||||
%define public
|
||||
|
||||
%define parse.error verbose %locations
|
||||
%define parse.error verbose
|
||||
%locations
|
||||
|
||||
%code imports {
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.Reader;
|
||||
import java.io.StreamTokenizer;
|
||||
}
|
||||
|
||||
%code {
|
||||
public static void main (String args[]) throws IOException
|
||||
{
|
||||
@@ -13,14 +23,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
%code imports {
|
||||
import java.io.StreamTokenizer;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.Reader;
|
||||
import java.io.IOException;
|
||||
}
|
||||
|
||||
/* Bison Declarations */
|
||||
%token <Integer> NUM "number"
|
||||
%type <Integer> exp
|
||||
|
||||
Reference in New Issue
Block a user