summaryrefslogtreecommitdiff
path: root/tests/javapush.at
diff options
context:
space:
mode:
authorAkim Demaille <akim.demaille@gmail.com>2019-03-31 18:44:56 +0200
committerAkim Demaille <akim.demaille@gmail.com>2019-04-03 19:20:39 +0200
commit0b42cf8a3639fdeef5e8ca9ed85612f44feb06d4 (patch)
tree8ce9b40904892a3ef775fb80926096789d850c3b /tests/javapush.at
parent10175e4a6590ba4d29941d49a67d0f9d0012884f (diff)
downloadbison-0b42cf8a3639fdeef5e8ca9ed85612f44feb06d4.tar.gz
tests: formatting changes
* tests/javapush.at: here.
Diffstat (limited to 'tests/javapush.at')
-rw-r--r--tests/javapush.at93
1 files changed, 45 insertions, 48 deletions
diff --git a/tests/javapush.at b/tests/javapush.at
index 829d988e..572b8666 100644
--- a/tests/javapush.at
+++ b/tests/javapush.at
@@ -273,8 +273,7 @@ input:
line:
'\n'
-| exp '\n'
- {System.out.println("total = "+$[]1);}
+| exp '\n' { System.out.println("total = "+$[]1); }
| error '\n'
;
@@ -349,54 +348,52 @@ AT_DATA([Calc.y],[[/* Infix notation calculator--calc */
%define api.parser.class {Calc}
%code {
-static class UserLexer implements Calc.Lexer
-{
- StreamTokenizer st;
- StringReader rdr;
-
- public UserLexer(StringReader reader)
+ static class UserLexer implements Calc.Lexer
{
- rdr = reader;
- st = new StreamTokenizer(rdr);
- st.resetSyntax();
- st.eolIsSignificant(true);
- st.whitespaceChars(9, 9);
- st.whitespaceChars(32, 32);
- st.wordChars(48, 57);
- }
+ StreamTokenizer st;
+ StringReader rdr;
+
+ public UserLexer(StringReader reader)
+ {
+ rdr = reader;
+ st = new StreamTokenizer(rdr);
+ st.resetSyntax();
+ st.eolIsSignificant(true);
+ st.whitespaceChars(9, 9);
+ st.whitespaceChars(32, 32);
+ st.wordChars(48, 57);
+ }
- Integer yylval;
+ Integer yylval;
- public Object getLVal() { return yylval; }
+ public Object getLVal() { return yylval; }
- public void yyerror(String msg) { System.err.println(msg); }
+ public void yyerror(String msg) { System.err.println(msg); }
- public int yylex () throws IOException
- {
- switch (st.nextToken()) {
- case StreamTokenizer.TT_EOF: return EOF;
- case StreamTokenizer.TT_EOL: return (int) '\n';
- case StreamTokenizer.TT_WORD:
- yylval = new Integer (st.sval);
- return NUM;
- default: return st.ttype;
+ public int yylex () throws IOException
+ {
+ switch (st.nextToken()) {
+ case StreamTokenizer.TT_EOF: return EOF;
+ case StreamTokenizer.TT_EOL: return (int) '\n';
+ case StreamTokenizer.TT_WORD:
+ yylval = new Integer (st.sval);
+ return NUM;
+ default: return st.ttype;
+ }
}
}
}
-}
-
%code {
-public static void main (String[] argv)
- throws IOException
-{
- StringReader reader = getinput(argv[0]);
- UserLexer lexer = new UserLexer(reader);
- Calc calc = new Calc(lexer);
- calc.setDebugLevel(1);
- calc.parse();
-}//main
-
+ public static void main (String[] argv)
+ throws IOException
+ {
+ StringReader reader = getinput(argv[0]);
+ UserLexer lexer = new UserLexer(reader);
+ Calc calc = new Calc(lexer);
+ calc.setDebugLevel(1);
+ calc.parse();
+ }//main
}
]AT_CALC_BODY[
@@ -676,14 +673,14 @@ AT_DATA([Calc.y],[[/* Infix notation calculator--calc. */
%code { ]AT_JAVA_POSITION_DEFINE[ }
%code {
-public static void main (String[] argv)
- throws IOException
-{
- StringReader reader = getinput(argv[0]);
- Calc calc = new Calc(reader);
- calc.setDebugLevel(1);
- calc.parse();
-}
+ public static void main (String[] argv)
+ throws IOException
+ {
+ StringReader reader = getinput(argv[0]);
+ Calc calc = new Calc(reader);
+ calc.setDebugLevel(1);
+ calc.parse();
+ }
}
]AT_CALC_BODY[