Svc_Conf_Lexer.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=========================================================================
00004 /**
00005  * @file Svc_Conf_Lexer.h
00006  *
00007  * Svc_Conf_Lexer.h,v 4.1 2006/01/09 15:18:53 elliott_c Exp
00008  *
00009  * This class is a hand-coded replacement for the lexer generated from
00010  * Svc_Conf.l that correctly supports Unicode.
00011  *
00012  * @author Chad Elliott <elliott_c@ociweb.com>
00013  */
00014 //=========================================================================
00015 
00016 #ifndef SVC_CONF_LEXER_H
00017 #define SVC_CONF_LEXER_H
00018 
00019 #include /**/ "ace/pre.h"
00020 #include "ace/Svc_Conf.h"
00021 
00022 #if (ACE_USES_CLASSIC_SVC_CONF == 1)
00023 #include "ace/Encoding_Converter_Factory.h"
00024 
00025 class ACE_Encoding_Converter;
00026 
00027 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00028 
00029 /** This class lexes the classic ACE Service Configurator language.
00030  * The entry point is similar to what flex would generate.  However, it
00031  * is a static method in this class (which is really just name space).
00032  */
00033 class ACE_Svc_Conf_Lexer
00034 {
00035 public:
00036   /// This is similar to the C function, ace_yylex, which a bison
00037   /// generated parser expects.  It returns information in the ace_yylval
00038   /// parameter and uses input stored in the param parameter.
00039   static int yylex (ACE_YYSTYPE* ace_yylval,
00040                     ACE_Svc_Conf_Param* param);
00041 
00042 private:
00043   static size_t input(ACE_Svc_Conf_Param* param, char* buf, size_t max_size);
00044 
00045   static int scan (ACE_YYSTYPE* ace_yylval, ACE_Svc_Conf_Param* param);
00046 
00047 #if defined (ACE_USES_WCHAR)
00048   static bool convert_to_utf8 (
00049                    ACE_Svc_Conf_Param* param,
00050                    size_t skip_bytes,
00051                    ACE_Encoding_Converter_Factory::Encoding_Hint hint);
00052   static bool convert_from_utf8 (ACE_Encoding_Converter* converter,
00053                                  const char* source,
00054                                  size_t source_size,
00055                                  ACE_TCHAR* target,
00056                                  size_t target_size,
00057                                  size_t& length);
00058   static ACE_Encoding_Converter_Factory::Encoding_Hint
00059                    locate_bom (char* source,
00060                                size_t source_size,
00061                                size_t& bytes_used);
00062 #endif /* ACE_USES_WCHAR */
00063 };
00064 
00065 ACE_END_VERSIONED_NAMESPACE_DECL
00066 #endif /* ACE_USES_CLASSIC_SVC_CONF = 1 */
00067 
00068 #include /**/ "ace/post.h"
00069 
00070 #endif /* SVC_CONF_LEXER_H */

Generated on Thu Nov 9 09:42:06 2006 for ACE by doxygen 1.3.6