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