1 //========================================================================
5 // Copyright 1996 Derek B. Noonburg
7 //========================================================================
19 #define tokBufSize 128 // size of token buffer
21 //------------------------------------------------------------------------
23 //------------------------------------------------------------------------
28 // Construct a lexer for a single stream. Deletes the stream when
32 // Construct a lexer for a stream or array of streams (assumes obj
33 // is either a stream or array of streams).
39 // Get the next object from the input stream.
40 Object *getObj(Object *obj);
42 // Skip to the beginning of the next line in the input stream.
43 void skipToNextLine();
45 // Skip over one character.
46 void skipChar() { getChar(); }
50 { return curStr.isNone() ? (Stream *)NULL : curStr.getStream(); }
52 // Get current position in file.
54 { return curStr.isNone() ? -1 : curStr.streamGetPos(); }
56 // Set position in file.
58 { if (!curStr.isNone()) curStr.streamSetPos(pos); }
65 Array *streams; // array of input streams
66 int strPtr; // index of current stream
67 Object curStr; // current stream
68 GBool freeArray; // should lexer free the streams array?
69 char tokBuf[tokBufSize]; // temporary token buffer