KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > beaver > Scanner


1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2  * This file is part of Beaver Parser Generator. *
3  * Copyright (C) 2003,2004 Alexander Demenchuk <alder@softanvil.com>. *
4  * All rights reserved. *
5  * See the file "LICENSE" for the terms and conditions for copying, *
6  * distribution and modification of Beaver. *
7  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

8
9 package beaver;
10
11 import java.io.IOException JavaDoc;
12
13
14
15 /**
16  * Defines an interface expected by a generated parser.
17  */

18 public abstract class Scanner
19 {
20     public static class Exception extends java.lang.Exception JavaDoc
21     {
22         public final int line;
23         public final int column;
24         
25         public Exception(String JavaDoc msg)
26         {
27             this(0, 0, msg);
28         }
29         
30         public Exception(int line, int column, String JavaDoc msg)
31         {
32             super(msg);
33             this.line = line;
34             this.column = column;
35         }
36     }
37
38     public abstract Symbol nextToken() throws IOException JavaDoc, Scanner.Exception;
39 }
40
Popular Tags