|
Aegis
4.25.D505
|
00001 // 00002 // aegis - project change supervisor 00003 // Copyright (C) 2008 Peter Miller 00004 // 00005 // This program is free software; you can redistribute it and/or modify 00006 // it under the terms of the GNU General Public License as published by 00007 // the Free Software Foundation; either version 3 of the License, or (at 00008 // your option) any later version. 00009 // 00010 // This program is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 // General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU General Public License along 00016 // with this program. If not, see <http://www.gnu.org/licenses/>. 00017 // 00018 00019 #ifndef LIBAEGIS_META_CONTEXT_SEM_H 00020 #define LIBAEGIS_META_CONTEXT_SEM_H 00021 00022 #include <libaegis/meta_context.h> 00023 00024 class input; // forward 00025 class meta_type; // forward 00026 00032 class meta_context_sem: 00033 public meta_context 00034 { 00035 public: 00039 virtual ~meta_context_sem(); 00040 00044 meta_context_sem(); 00045 00055 void *parse(const nstring &filename, meta_type *type); 00056 00066 void *parse_env(const nstring &name, meta_type *type); 00067 00077 void *parse_input(input &ifp, meta_type *type); 00078 00079 protected: 00080 // See base class for documentation. 00081 void integer(long n); 00082 00083 // See base class for documentation. 00084 void real(double n); 00085 00086 // See base class for documentation. 00087 void string(const nstring &s); 00088 00089 // See base class for documentation. 00090 void enumeration(const nstring &s); 00091 00092 // See base class for documentation. 00093 void list(); 00094 00095 // See base class for documentation. 00096 void list_end(); 00097 00098 // See base class for documentation. 00099 void field(const nstring &name); 00100 00101 // See base class for documentation. 00102 void field_end(); 00103 00104 // See base class for documentation. 00105 void end(); 00106 00107 private: 00108 struct sem_ty 00109 { 00110 meta_type *type; 00111 sem_ty *next; 00112 void *addr; 00113 }; 00114 00120 sem_ty *root; 00121 00131 void sem_push(meta_type *type, void *addr); 00132 00137 void sem_pop(); 00138 00142 meta_context_sem(const meta_context_sem &); 00143 00147 meta_context_sem &operator=(const meta_context_sem &); 00148 }; 00149 00150 #endif // LIBAEGIS_META_CONTEXT_SEM_H
1.7.6.1