01: /*
02: * SExprStream.java
03: *
04: * Copyright 1997 Massachusetts Institute of Technology.
05: * All Rights Reserved.
06: *
07: * Author: Ora Lassila
08: *
09: * $Id: SExprStream.java,v 1.3 1998/02/10 13:31:17 bmahe Exp $
10: */
11:
12: package org.w3c.tools.sexpr;
13:
14: import java.io.IOException;
15: import java.util.Dictionary;
16:
17: /**
18: * An interface for a full s-expression parser.
19: */
20: public interface SExprStream extends SExprParser {
21:
22: /**
23: * Parse a single object from the stream.
24: */
25: public Object parse() throws SExprParserException, IOException;
26:
27: /**
28: * Access the symbol table of the parser.
29: */
30: public Dictionary getSymbols();
31:
32: /**
33: * Assign the symbol table of the parser.
34: */
35: public Dictionary setSymbols(Dictionary symbols);
36:
37: /**
38: * Access the dispatch table of the parser.
39: */
40: public Readtable getReadtable();
41:
42: /**
43: * Assign the dispatch table of the parser.
44: */
45: public Readtable setReadtable(Readtable readtable);
46:
47: /**
48: * Associate an input character with a "sub-parser."
49: */
50: public SExprParser addParser(char key, SExprParser parser);
51:
52: /**
53: * Checks whether lists are to be parsed as Vectors or Cons cells.
54: */
55: public boolean getListsAsVectors();
56:
57: /**
58: * Controls whether parsed lists are Vectors or Cons cells.
59: */
60: public boolean setListsAsVectors(boolean listsAsVectors);
61:
62: /**
63: * Accesses an empty string buffer available temporary storage.
64: */
65: public StringBuffer getScratchBuffer();
66:
67: /**
68: * Reads from the stream, skipping whitespace.
69: */
70: public char readSkipWhite() throws IOException;
71:
72: /**
73: * Read a single character from the stream.
74: * This method is here because there is no InputStream interface in the
75: * java.io package (JavaSoft please take notice!).
76: */
77: public int read() throws IOException;
78:
79: }
|