GFC Logo GFC Title Logo
Reference Manual
Main Page  |  Namespace List  |  Alphabetical List  |  Class List  |  File List

scanner.hh

Go to the documentation of this file.
00001 /* GFC-Core: GTK+ Foundation Classes (Core Library) 00002 * Copyright (C) 2002-2004 The GFC 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 GFC_G_SCANNER_HH 00025 #define GFC_G_SCANNER_HH 00026 00027 #ifndef GFC_OBJECT_HH 00028 #include <gfc/object.hh> 00029 #endif 00030 00031 #ifndef __G_DATASET_H__ 00032 #include <glib/gdataset.h> 00033 #endif 00034 00035 #ifndef __G_SCANNER_H__ 00036 #include <glib/gscanner.h> 00037 #endif 00038 00039 namespace GFC { 00040 00041 namespace G { 00042 00045 00046 class Scanner : public GFC::Object 00047 { 00048 Scanner(const Scanner&); 00049 Scanner& operator=(const Scanner&); 00050 00051 GScanner *scanner_; 00052 00053 public: 00054 typedef sigc::slot<void, void*, void*> ScopeForeachSymbolSlot; 00056 00059 00060 Scanner(const GScannerConfig *initial_settings); 00065 00066 explicit Scanner(GScanner *scanner); 00072 00073 virtual ~Scanner(); 00075 00079 00080 GScanner* g_scanner() const; 00082 00083 operator GScanner* () const; 00085 00086 GTokenType token() const; 00088 00089 GTokenValue value() const; 00091 00092 unsigned int line() const; 00094 00095 unsigned int position() const; 00097 00098 bool eof() const; 00100 00101 GTokenType next_token() const; 00103 00104 GTokenValue next_value() const; 00106 00107 unsigned int next_line() const; 00109 00110 unsigned int next_position() const; 00112 00113 GTokenType get_next_token() const; 00116 00117 GTokenType peek_next_token() const; 00120 00124 00125 void input_file(int input_fd); 00128 00129 void sync_file_offset(); 00133 00134 void input_text(const char *text, unsigned int length); 00138 00139 void input_text(const String& text); 00142 00143 unsigned int set_scope(unsigned int scope_id); 00147 00148 void scope_add_symbol(unsigned int scope_id, const char *symbol, void *value); 00153 00154 void scope_remove_symbol(unsigned int scope_id, const char *symbol); 00158 00159 void* scope_lookup_symbol(unsigned int scope_id, const char *symbol); 00165 00166 void scope_foreach_symbol(unsigned int scope_id, const ScopeForeachSymbolSlot& slot); 00172 00173 void* lookup_symbol(const char *symbol); 00177 00178 void error(const char *format, ...); 00182 00183 void warn(const char *format, ...); 00187 00189 }; 00190 00191 } // namespace G 00192 00193 } // namespace GFC 00194 00195 #include <gfc/glib/inline/scanner.inl> 00196 00197 #endif // GFC_G_SCANNER_HH 00198

Generated on Tue Aug 24 00:04:56 2004 for GFC-Core by doxygen 1.3.8