Reference Manual
Inti Logo
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

scanner.h

Go to the documentation of this file.
00001 /*  Inti: Integrated Foundation Classes
00002  *  Copyright (C) 2002 The Inti Development Team.
00003  *
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU Library General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU Library General Public License
00015  *  along with this program; if not, write to the Free Software
00016  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00017  */
00018  
00023 
00024 #ifndef INTI_G_SCANNER_H
00025 #define INTI_G_SCANNER_H
00026 
00027 #ifndef INTI_OBJECT_H
00028 #include <inti/object.h>
00029 #endif
00030 
00031 #ifndef INTI_SLOT_H
00032 #include <inti/slot.h>
00033 #endif
00034 
00035 #ifndef __G_DATASET_H__
00036 #include <glib/gdataset.h>
00037 #endif
00038 
00039 #ifndef __G_SCANNER_H__
00040 #include <glib/gscanner.h>
00041 #endif
00042 
00043 namespace Inti {
00044 
00045 namespace G {
00046 
00049 
00050 class Scanner : public ReferencedObject
00051 {
00052         Scanner(const Scanner&);
00053         Scanner& operator=(const Scanner&);
00054 
00055         GScanner *scanner_;
00056 
00057 public:
00058         typedef Slot2<void, void*, void*> ScopeForeachSymbolSlot;
00060 
00063 
00064         Scanner(const GScannerConfig *initial_settings);
00069         
00070         explicit Scanner(GScanner *scanner);
00076 
00077         virtual ~Scanner();
00079 
00083         
00084         GScanner* g_scanner() const { return scanner_; }
00086 
00087         operator GScanner* () const;
00089         
00090         GTokenType token() const;
00092 
00093         GTokenValue value() const;
00095 
00096         unsigned int line() const;
00098 
00099         unsigned int position() const;
00101 
00102         bool eof() const;
00104 
00105         GTokenType next_token() const;
00107 
00108         GTokenValue next_value() const;
00110 
00111         unsigned int next_line() const;
00113 
00114         unsigned int next_position() const;
00116 
00117         GTokenType get_next_token() const;
00120 
00121         GTokenType peek_next_token() const;
00124         
00128 
00129         void input_file(int input_fd);
00132 
00133         void sync_file_offset();
00137 
00138         void input_text(const char *text, unsigned int length);
00142 
00143         void input_text(const String& text);
00146 
00147         unsigned int set_scope(unsigned int scope_id);
00151 
00152         void scope_add_symbol(unsigned int scope_id, const char *symbol, void *value);
00157 
00158         void scope_remove_symbol(unsigned int scope_id, const char *symbol);
00162 
00163         void* scope_lookup_symbol(unsigned int scope_id, const char *symbol);
00169 
00170         void scope_foreach_symbol(unsigned int scope_id, const ScopeForeachSymbolSlot *slot);
00176 
00177         void* lookup_symbol(const char *symbol);
00181         
00182         void error(const char *format, ...);
00186 
00187         void warn(const char *format, ...);
00191         
00193 };
00194 
00195 } // namespace G
00196 
00197 } // namespace Inti
00198 
00199 #endif // INTI_G_SCANNER_H
00200 
Main Page - Footer


Generated on Sun Sep 14 20:08:03 2003 for Inti by doxygen 1.3.2 written by Dimitri van Heesch, © 1997-2002