-dnl AT_CHECK_JAVA_CALC([], [])
-
-AT_CHECK_JAVA_CALC([%define single_class %locations], [[
- StreamTokenizer st;
-
- public Calc (InputStream is)
- {
- Reader r = new InputStreamReader (is);
- st = new StreamTokenizer(r);
- st.resetSyntax ();
- st.eolIsSignificant (true);
- st.whitespaceChars (9, 9);
- st.whitespaceChars (32, 32);
- st.wordChars (48, 57);
-
- yyendpos = new Position (1);
- }
-
- public int yylex () throws IOException {
- int ttype = st.nextToken ();
- yystartpos = yyendpos;
- if (ttype == st.TT_EOF)
- return EOF;
-
- else if (ttype == st.TT_EOL)
- {
- yyendpos = new Position (yyendpos.lineno () + 1);
- return (int) '\n';
- }
-
- else if (ttype == st.TT_WORD)
- {
- yylval = new Integer (st.sval);
- return NUM;
- }
-
- else
- return st.ttype;
- }
-
- public void yyerror (Location l, String s)
- {
- if (l == null)
- System.err.println (s);
- else
- System.err.println (l.begin + ": " + s);
- }
-
- public static void main (String args[]) throws IOException
- {
- new Calc (System.in).parse ();
- }
-]])
-
-AT_CHECK_JAVA_CALC([%pure-parser], [[