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
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
{
44
TOK_ERROR
,
TOK_NONE
,
TOK_FINAL
,
TOK_INT
,
TOK_FLOAT
,
TOK_SYMBOL
,
45
TOK_NAME
,
TOK_STRING
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
65
const
CSymTable
*
SymTable
;
66
const
hqCharType
*
CharTypeTable
;
67
public
:
68
// output params
69
char
*
Name
;
70
size_t
NameLen
;
71
double
ExtValue
;
72
int
IntValue
;
73
hqTokenType
PrevTokenType
;
74
hqCharType
CharType
;
75
int
NoIntegers
;
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_
GENAPI_NAMESPACE::CLexer::CharType
hqCharType CharType
Definition:
Lexer.h:74
Types.h
Common types used in the public GenApi interface.
GENAPI_NAMESPACE::CLexer::SymTable
const CSymTable * SymTable
Definition:
Lexer.h:65
GENAPI_NAMESPACE::CH_SEPARAT
Definition:
Lexer.h:37
GENAPI_NAMESPACE::CLexer::NameLen
size_t NameLen
Definition:
Lexer.h:70
GENAPI_NAMESPACE::TOK_STRING
Definition:
Lexer.h:45
GENAPI_NAMESPACE::CH_SYMBOL
Definition:
Lexer.h:38
GENAPI_NAMESPACE::TOK_FLOAT
Definition:
Lexer.h:44
GENAPI_NAMESPACE::CLexer::CLexer
CLexer()
GENAPI_NAMESPACE::CLexer::ComEnd
char * ComEnd
Definition:
Lexer.h:64
GENAPI_NAMESPACE::hqTokenType
hqTokenType
Definition:
Lexer.h:42
GENAPI_NAMESPACE::CLexer::CharTypeTable
const hqCharType * CharTypeTable
Definition:
Lexer.h:66
GENAPI_NAMESPACE::CLexer::ExtValue
double ExtValue
Definition:
Lexer.h:71
GENAPI_NAMESPACE::TOK_INT
Definition:
Lexer.h:44
GENAPI_NAMESPACE::CH_QUOTE
Definition:
Lexer.h:38
GENAPI_NAMESPACE::hqCharType
hqCharType
Definition:
Lexer.h:35
GENAPI_NAMESPACE::TOK_ERROR
Definition:
Lexer.h:44
GENAPI_NAMESPACE::CH_UNKNOWN
Definition:
Lexer.h:39
GENAPI_NAMESPACE::CLexer::Name
char * Name
Definition:
Lexer.h:69
SymTable.h
Implementation of CSymTable.
GENAPI_NAMESPACE::CLexer::m_pSS
char * m_pSS
Definition:
Lexer.h:50
GENAPI_NAMESPACE::uchar
unsigned char uchar
Definition:
Lexer.h:33
GENAPI_NAMESPACE::TOK_SYMBOL
Definition:
Lexer.h:44
GENAPI_NAMESPACE::CH_FINAL
Definition:
Lexer.h:39
GENAPI_NAMESPACE::CLexer::~CLexer
~CLexer()
GENAPI_NAMESPACE::CLexer::GetNextToken
hqTokenType GetNextToken()
GENAPI_NAMESPACE::CLexer::PrevTokenType
hqTokenType PrevTokenType
Definition:
Lexer.h:73
GENAPI_NAMESPACE::TOK_NONE
Definition:
Lexer.h:44
GENAPI_NAMESPACE::TOK_FINAL
Definition:
Lexer.h:44
GENAPI_NAMESPACE::CLexer::CLocale
locale_t CLocale
Definition:
Lexer.h:56
GENAPI_NAMESPACE::TOK_NAME
Definition:
Lexer.h:45
GENAPI_NAMESPACE::CLexer::SetParams
void SetParams(int cssn, const char ComEnd[], const CSymTable *SymTable, const hqCharType *CharTypeTable)
GENAPI_NAMESPACE::CLexer::IntValue
int IntValue
Definition:
Lexer.h:72
GENAPI_NAMESPACE::CH_DIGIT
Definition:
Lexer.h:37
GENAPI_NAMESPACE::CLexer::GetCurrentPos
char * GetCurrentPos()
GENAPI_NAMESPACE::CSymTable
Definition:
SymTable.h:26
GENAPI_NAMESPACE::CLexer
Definition:
Lexer.h:48
GENAPI_NAMESPACE::CH_LETTER
Definition:
Lexer.h:37
GENAPI_NAMESPACE
Lexical analyzer for CIntSwissKnife.
Definition:
Autovector.h:48
GENAPI_NAMESPACE::CLexer::SS
char * SS
Definition:
Lexer.h:51
GENAPI_NAMESPACE::CLexer::cssn
int cssn
Definition:
Lexer.h:63
GENAPI_NAMESPACE::CLexer::NoIntegers
int NoIntegers
Definition:
Lexer.h:75
GENAPI_NAMESPACE::CLexer::SetParseString
int SetParseString(const char *str)
rc_genicam_api
Author(s): Heiko Hirschmueller
autogenerated on Wed Mar 17 2021 02:48:40