// // aegis - project change supervisor // Copyright (C) 2008 Peter Miller // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 3 of the License, or (at // your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // General Public License for more details. // // You should have received a copy of the GNU General Public License along // with this program. If not, see . // #ifndef LIBAEGIS_META_CONTEXT_INTROSPECTOR_H #define LIBAEGIS_META_CONTEXT_INTROSPECTOR_H #include #include #include /** * The meta_context_introspector class is used to represent the * processing for parsing meta-data using the introspector technique. */ class meta_context_introspector: public meta_context { public: /** * The destructor. */ virtual ~meta_context_introspector(); /** * The default constructor. */ meta_context_introspector(); /** * The parse_file method is used to parse the given file through * the given introspector. It expected that this will be called * from code generated by fmtgen. * * @param filename * The name of the file to be parsed. * @param ip * The instrospector to parse into (it is expected to have its * own reference to the data destination). */ void parse_file(const nstring &filename, const introspector::pointer &ip); protected: // See base class for documentation. void integer(long n); // See base class for documentation. void real(double n); // See base class for documentation. void string(const nstring &s); // See base class for documentation. void enumeration(const nstring &s); // See base class for documentation. void list(); // See base class for documentation. void list_end(); // See base class for documentation. void field(const nstring &name); // See base class for documentation. void field_end(); // See base class for documentation. void end(); private: /** * The stack instance variable is used to remember the push-don * stack of introspectors used to parse the meta-data. */ introspector_vector stack; /** * The copy constructor. Do not use. */ meta_context_introspector(const meta_context_introspector &); /** * The assignment operator. Do not use. */ meta_context_introspector &operator=(const meta_context_introspector &); }; #endif // LIBAEGIS_META_CONTEXT_INTROSPECTOR_H