manager.hh

Go to the documentation of this file.
00001 /*
00002    The lestes compiler suite
00003    Copyright (C) 2002, 2003, 2004, 2005 Miroslav Tichy
00004    Copyright (C) 2002, 2003, 2004, 2005 Petr Zika
00005    Copyright (C) 2002, 2003, 2004, 2005 Vojtech Hala
00006    Copyright (C) 2002, 2003, 2004, 2005 Jiri Kosina
00007    Copyright (C) 2002, 2003, 2004, 2005 Pavel Sanda
00008    Copyright (C) 2002, 2003, 2004, 2005 Jan Zouhar
00009    Copyright (C) 2002, 2003, 2004, 2005 Rudolf Thomas
00010 
00011    This program is free software; you can redistribute it and/or modify
00012    it under the terms of the GNU General Public License as published by
00013    the Free Software Foundation; version 2 of the License.
00014 
00015    This program is distributed in the hope that it will be useful,
00016    but WITHOUT ANY WARRANTY; without even the implied warranty of
00017    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018    GNU General Public License for more details.
00019 
00020    See the full text of the GNU General Public License version 2, and
00021    the limitations in the file doc/LICENSE.
00022 
00023    By accepting the license the licensee waives any and all claims
00024    against the copyright holder(s) related in whole or in part to the
00025    work, its use, and/or the inability to use it.
00026  
00027  */
00028 #ifndef lestes__lang__cplus__syn__manager_hh__included
00029 #define lestes__lang__cplus__syn__manager_hh__included
00030 
00031 #include <lestes/common.hh>
00032 #include <lestes/std/action.g.hh>
00033 #include <lestes/std/event.hh>
00034 #include <lestes/std/list.hh>
00035 
00036 package(lestes);
00037 package(std);
00038 class source_location;
00039 end_package(std);
00040 package(lang);
00041 package(cplus);
00042 package(lex);
00043 class preprocessor;
00044 end_package(lex);
00045 package(syn);
00046 
00047 class bison_token;
00048 class bison_pack_token;
00049 
00050 class manager {
00051 public:
00052         typedef ::lestes::lang::cplus::lex::preprocessor preprocessor;
00053         static void init();
00054 
00055         static void spawn( ptr<bison_pack_token> );
00056         static void close();
00057 
00058         static ptr<bison_token> yylex();
00059         //! Returns value identical to the result of previous yylex() invocation.
00060         static ptr<bison_token> prev_yylex();
00061         //! Same as yylex(), but does not move to the next token.
00062         static ptr<bison_token> peek();
00063         static void back_up();
00064 
00065         static void start( int );
00066         static void commit( int );
00067         static void rollback();
00068 
00069         //! Packs the stream to form a pack token with given type and returns it.
00070         static ptr<bison_pack_token> pack( int, const ptr<source_location> & );
00071         //! Unpacks current token; current token is the one returned by peek(), it has to be a pack.
00072         static void unpack();
00073 
00074         static bool in_disambiguation();
00075 
00076         static void install_undo_action( ptr<action> );
00077 
00078         static bool failing_get();
00079         static void failing_set_true();
00080 
00081         static ptr<event> spawn_event;
00082         static ptr<event> close_event;
00083         static ptr<event> start_event;
00084         static ptr<event> commit_event;
00085         static ptr<event> rollback_event;
00086 
00087 private:
00088         //! Do no allow instantiating this class.
00089         manager();
00090         //! Hide copy-constructor.
00091         manager( const manager & );
00092 };
00093 
00094 end_package(syn);
00095 end_package(cplus);
00096 end_package(lang);
00097 end_package(lestes);
00098 
00099 #endif  // lestes__lang__cplus__syn__manager_hh__included

Generated on Mon Feb 12 18:27:09 2007 for lestes by doxygen 1.5.1-20070107