]> git.ipfire.org Git - thirdparty/cups.git/blob - pdftops/Parser.h
Load cups into easysw/current.
[thirdparty/cups.git] / pdftops / Parser.h
1 //========================================================================
2 //
3 // Parser.h
4 //
5 // Copyright 1996-2003 Glyph & Cog, LLC
6 //
7 //========================================================================
8
9 #ifndef PARSER_H
10 #define PARSER_H
11
12 #include <config.h>
13
14 #ifdef USE_GCC_PRAGMAS
15 #pragma interface
16 #endif
17
18 #include "Lexer.h"
19
20 //------------------------------------------------------------------------
21 // Parser
22 //------------------------------------------------------------------------
23
24 class Parser {
25 public:
26
27 // Constructor.
28 Parser(XRef *xrefA, Lexer *lexerA);
29
30 // Destructor.
31 ~Parser();
32
33 // Get the next object from the input stream.
34 Object *getObj(Object *obj,
35 Guchar *fileKey = NULL, int keyLength = 0,
36 int objNum = 0, int objGen = 0);
37
38 // Get stream.
39 Stream *getStream() { return lexer->getStream(); }
40
41 // Get current position in file.
42 int getPos() { return lexer->getPos(); }
43
44 private:
45
46 XRef *xref; // the xref table for this PDF file
47 Lexer *lexer; // input stream
48 Object buf1, buf2; // next two tokens
49 int inlineImg; // set when inline image data is encountered
50
51 Stream *makeStream(Object *dict);
52 void shift();
53 };
54
55 #endif
56