Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
genicam
library
CPP
include
GenApi
impl
MathParser
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
typedef
unsigned
char
uchar
;
32
33
typedef
enum
34
{
35
CH_LETTER
= 0x01,
CH_DIGIT
= 0x02,
CH_SEPARAT
= 0x04,
36
CH_SYMBOL
= 0x08,
CH_QUOTE
= 0x10,
37
CH_UNKNOWN
= 0x7E,
CH_FINAL
= 0x7F
38
}
hqCharType
;
39
40
typedef
enum
41
{
42
TOK_ERROR
,
TOK_NONE
,
TOK_FINAL
,
TOK_INT
,
TOK_FLOAT
,
TOK_SYMBOL
,
43
TOK_NAME
,
TOK_STRING
44
}
hqTokenType
;
45
46
class
CLexer
47
{
48
char
*
m_pSS
;
49
char
*
SS
;
50
#ifdef _WIN32
51
_locale_t
CLocale
;
52
#else
53
#ifndef VXWORKS
54
locale_t
CLocale
;
55
#endif
56
#endif
57
public
:
58
void
SetParams
(
int
cssn
,
const
char
ComEnd
[],
const
CSymTable
*
SymTable
,
const
hqCharType
*
CharTypeTable
);
59
private
:
60
// input params
61
int
cssn
;
// Comment Start Symbol Number. -1 if none
62
char
*
ComEnd
;
// End of comment
63
const
CSymTable
*
SymTable
;
64
const
hqCharType
*
CharTypeTable
;
65
public
:
66
// output params
67
char
*
Name
;
68
size_t
NameLen
;
69
double
ExtValue
;
70
int
IntValue
;
71
hqTokenType
PrevTokenType
;
72
hqCharType
CharType
;
73
int
NoIntegers
;
74
public
:
75
int
SetParseString
(
const
char
* str );
76
hqTokenType
GetNextToken
();
77
CLexer
();
78
~CLexer
();
79
char
*
GetCurrentPos
();
80
};
81
82
83
#endif //_LEXER_H_
Types.h
Common types used in the public GenApi interface.
CLexer::SS
char * SS
Definition:
Lexer.h:49
CLexer::CLocale
locale_t CLocale
Definition:
Lexer.h:54
CLexer::Name
char * Name
Definition:
Lexer.h:67
CLexer::m_pSS
char * m_pSS
Definition:
Lexer.h:48
TOK_NAME
Definition:
Lexer.h:43
CLexer::SetParseString
int SetParseString(const char *str)
hqTokenType
hqTokenType
Definition:
Lexer.h:40
CH_SYMBOL
Definition:
Lexer.h:36
TOK_SYMBOL
Definition:
Lexer.h:42
CLexer::~CLexer
~CLexer()
TOK_INT
Definition:
Lexer.h:42
SymTable.h
Implementation of CSymTable.
CLexer::NameLen
size_t NameLen
Definition:
Lexer.h:68
TOK_STRING
Definition:
Lexer.h:43
CLexer::PrevTokenType
hqTokenType PrevTokenType
Definition:
Lexer.h:71
TOK_FLOAT
Definition:
Lexer.h:42
CH_FINAL
Definition:
Lexer.h:37
CLexer::SymTable
const CSymTable * SymTable
Definition:
Lexer.h:63
hqCharType
hqCharType
Definition:
Lexer.h:33
CLexer::NoIntegers
int NoIntegers
Definition:
Lexer.h:73
TOK_NONE
Definition:
Lexer.h:42
CLexer::ComEnd
char * ComEnd
Definition:
Lexer.h:62
uchar
unsigned char uchar
Definition:
Lexer.h:31
TOK_ERROR
Definition:
Lexer.h:42
CSymTable
Definition:
SymTable.h:20
CH_UNKNOWN
Definition:
Lexer.h:37
CLexer::CharTypeTable
const hqCharType * CharTypeTable
Definition:
Lexer.h:64
CLexer::GetNextToken
hqTokenType GetNextToken()
CLexer::SetParams
void SetParams(int cssn, const char ComEnd[], const CSymTable *SymTable, const hqCharType *CharTypeTable)
CLexer::CLexer
CLexer()
CLexer::GetCurrentPos
char * GetCurrentPos()
CLexer::cssn
int cssn
Definition:
Lexer.h:61
CLexer::CharType
hqCharType CharType
Definition:
Lexer.h:72
CH_LETTER
Definition:
Lexer.h:35
CLexer::ExtValue
double ExtValue
Definition:
Lexer.h:69
CLexer::IntValue
int IntValue
Definition:
Lexer.h:70
CH_DIGIT
Definition:
Lexer.h:35
CH_SEPARAT
Definition:
Lexer.h:35
CLexer
Definition:
Lexer.h:46
CH_QUOTE
Definition:
Lexer.h:36
TOK_FINAL
Definition:
Lexer.h:42
rc_genicam_api
Author(s): Heiko Hirschmueller
autogenerated on Thu Jun 6 2019 19:10:54