01: package antlr.ASdebug;
02:
03: import antlr.Token;
04: import antlr.TokenStream;
05:
06: /**
07: * Default implementation of <code>IASDebugStream</code> methods.
08: * @author Prashant Deva
09: */
10: public final class ASDebugStream {
11:
12: public static String getEntireText(TokenStream stream) {
13: if (stream instanceof IASDebugStream) {
14: IASDebugStream dbgStream = (IASDebugStream) stream;
15: return dbgStream.getEntireText();
16: }
17: return null;
18: }
19:
20: public static TokenOffsetInfo getOffsetInfo(TokenStream stream,
21: Token token) {
22: if (stream instanceof IASDebugStream) {
23: IASDebugStream dbgStream = (IASDebugStream) stream;
24: return dbgStream.getOffsetInfo(token);
25: }
26: return null;
27: }
28:
29: }
|