63 |
*/ |
*/ |
64 |
struct YYSTYPE { |
struct YYSTYPE { |
65 |
union { |
union { |
66 |
char Char; |
char Char; |
67 |
unsigned int Number; |
unsigned int Number; |
68 |
double Dotnum; |
double Dotnum; |
69 |
fill_response_t FillResponse; |
fill_response_t FillResponse; |
70 |
LSCPEvent::event_t Event; |
LSCPEvent::event_t Event; |
71 |
}; |
}; |
72 |
std::string String; |
std::string String; |
75 |
#define yystype YYSTYPE ///< For backward compatibility. |
#define yystype YYSTYPE ///< For backward compatibility. |
76 |
#define YYSTYPE_IS_DECLARED ///< We tell the lexer / parser that we use our own data structure as defined above. |
#define YYSTYPE_IS_DECLARED ///< We tell the lexer / parser that we use our own data structure as defined above. |
77 |
|
|
|
// pointer to an (reentrant) scanner / lexical analyzer |
|
|
typedef void* yyscan_t; |
|
|
|
|
78 |
/** |
/** |
79 |
* Parameters given to the parser on every yyparse() call. |
* Parameters given to the parser on every yyparse() call. |
80 |
*/ |
*/ |
81 |
struct yyparse_param_t { |
struct yyparse_param_t { |
82 |
LSCPServer* pServer; |
LSCPServer* pServer; |
83 |
int hSession; |
int hSession; |
|
yyscan_t pScanner; |
|
84 |
bool bVerbose; ///< if true then all commands will immediately sent back (echo) |
bool bVerbose; ///< if true then all commands will immediately sent back (echo) |
85 |
|
|
86 |
yyparse_param_t() { |
yyparse_param_t() { |
87 |
pServer = NULL; |
pServer = NULL; |
88 |
hSession = -1; |
hSession = -1; |
|
pScanner = NULL; |
|
89 |
bVerbose = false; |
bVerbose = false; |
90 |
} |
} |
91 |
}; |
}; |
94 |
/** |
/** |
95 |
* Prototype of the main scanner function (lexical analyzer). |
* Prototype of the main scanner function (lexical analyzer). |
96 |
*/ |
*/ |
97 |
#define YY_DECL int yylex(YYSTYPE* yylval, yyscan_t yyscanner) |
#define YY_DECL int yylex(YYSTYPE* yylval) |
|
|
|
|
/** |
|
|
* Override lex's input function which just reads from stdin by default. |
|
|
* We read from a socket instead. |
|
|
*/ |
|
|
extern int GetLSCPCommand( void *buf, int max_size); |
|
|
#define YY_INPUT(buf,result,max_size) \ |
|
|
result = GetLSCPCommand(buf, max_size) |
|
98 |
|
|
99 |
#endif // __LSCPPARSER_H__ |
#endif // __LSCPPARSER_H__ |