00001 //======================================================================== 00002 // 00003 // Parser.h 00004 // 00005 // Copyright 1996-2002 Glyph & Cog, LLC 00006 // 00007 //======================================================================== 00008 00009 #ifndef PARSER_H 00010 #define PARSER_H 00011 00012 #ifdef __GNUC__ 00013 #pragma interface 00014 #endif 00015 00016 #include "Lexer.h" 00017 00018 //------------------------------------------------------------------------ 00019 // Parser 00020 //------------------------------------------------------------------------ 00021 00022 class Parser { 00023 public: 00024 00025 // Constructor. 00026 Parser(XRef *xrefA, Lexer *lexerA); 00027 00028 // Destructor. 00029 ~Parser(); 00030 00031 // Get the next object from the input stream. 00032 #ifndef NO_DECRYPTION 00033 Object *getObj(Object *obj, 00034 Guchar *fileKey = NULL, int keyLength = 0, 00035 int objNum = 0, int objGen = 0); 00036 #else 00037 Object *getObj(Object *obj); 00038 #endif 00039 00040 // Get stream. 00041 Stream *getStream() { return lexer->getStream(); } 00042 00043 // Get current position in file. 00044 int getPos() { return lexer->getPos(); } 00045 00046 private: 00047 00048 XRef *xref; // the xref table for this PDF file 00049 Lexer *lexer; // input stream 00050 Object buf1, buf2; // next two tokens 00051 int inlineImg; // set when inline image data is encountered 00052 00053 Stream *makeStream(Object *dict); 00054 void shift(); 00055 }; 00056 00057 #endif 00058
1.4.2