Lexer.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 // (c) 2006 by Basler Vision Technologies
3 // Section: Vision Components
4 // Project: GenApi
5 // Author: Margret Albrecht
6 // $Header$
7 //
8 // License: Derived from Kirill Zaborski's MathParser library (http://kirya.narod.ru/mathparser.html ).
9 // This library comes under LGPL license (see http://www.gnu.org/licenses/lgpl.html).
10 // Kirill's implementation is a C++ port of the CCalc library from Walery Studennikov (http://www.sama.ru/~despair/ccalc/)
11 // which also comes under the LGPL.
12 //-----------------------------------------------------------------------------
18 #ifndef _LEXER_H_
19 #define _LEXER_H_
20 
21 #include <cstdlib>
22 
23 #ifdef __APPLE__
24 #include <xlocale.h>
25 #endif
26 
27 #include "GenApi/Types.h"
28 #include "GenApi/impl/Internal_Compatibility.h"
29 #include "SymTable.h"
30 
31 namespace GENAPI_NAMESPACE
32 {
33  typedef unsigned char uchar;
34 
35  typedef enum
36  {
37  CH_LETTER = 0x01, CH_DIGIT = 0x02, CH_SEPARAT = 0x04,
38  CH_SYMBOL = 0x08, CH_QUOTE = 0x10,
39  CH_UNKNOWN = 0x7E, CH_FINAL = 0x7F
40  } hqCharType;
41 
42  typedef enum
43  {
46  } hqTokenType;
47 
48  class CLexer
49  {
50  char* m_pSS;
51  char* SS;
52  #ifdef _WIN32
53  _locale_t CLocale;
54  #else
55  #ifndef VXWORKS
56  locale_t CLocale;
57  #endif
58  #endif
59  public:
60  void SetParams( int cssn, const char ComEnd[], const CSymTable* SymTable, const hqCharType* CharTypeTable );
61  private:
62  // input params
63  int cssn; // Comment Start Symbol Number. -1 if none
64  char* ComEnd; // End of comment
67  public:
68  // output params
69  char* Name;
70  size_t NameLen;
71  double ExtValue;
72  int IntValue;
73  hqTokenType PrevTokenType;
76  public:
77  int SetParseString( const char* str );
78  hqTokenType GetNextToken();
79  CLexer();
80  ~CLexer();
81  char* GetCurrentPos();
82  };
83 
84 } /* GENAPI_NAMESPACE*/
85 
86 #endif //_LEXER_H_
hqCharType CharType
Definition: Lexer.h:74
Common types used in the public GenApi interface.
const CSymTable * SymTable
Definition: Lexer.h:65
const hqCharType * CharTypeTable
Definition: Lexer.h:66
Implementation of CSymTable.
unsigned char uchar
Definition: Lexer.h:33
hqTokenType GetNextToken()
hqTokenType PrevTokenType
Definition: Lexer.h:73
void SetParams(int cssn, const char ComEnd[], const CSymTable *SymTable, const hqCharType *CharTypeTable)
Lexical analyzer for CIntSwissKnife.
Definition: Autovector.h:48
int SetParseString(const char *str)


rc_genicam_api
Author(s): Heiko Hirschmueller
autogenerated on Wed Mar 17 2021 02:48:40