Doxygen
Loading...
Searching...
No Matches
constexp.l File Reference
#include <stdint.h>
#include "constexp_p.h"
#include "constexp.h"
#include "cppvalue.h"
#include "ce_parse.hpp"
#include "message.h"
#include "debug.h"
#include "doxygen_lex.h"
#include "constexp.l.h"
+ Include dependency graph for constexp.l:

Go to the source code of this file.

Classes

struct  ConstExpressionParser::Private
 

Macros

#define YY_NO_INPUT   1
 
#define YY_NO_UNISTD_H   1
 
#define YY_INPUT(buf, result, max_size)
 
#define LEX_NO_INPUT_FILENAME
 

Functions

static const char * stateToString (int state)
 
static int yyread (char *buf, int max_size, yyscan_t yyscanner)
 
static const char * getLexerFILE ()
 
int yylex (YYSTYPE *yylval_param, yyscan_t yyscanner)
 
int constexpYYwrap (yyscan_t)
 

Macro Definition Documentation

◆ LEX_NO_INPUT_FILENAME

#define LEX_NO_INPUT_FILENAME

Definition at line 49 of file constexp.l.

◆ YY_INPUT

#define YY_INPUT ( buf,
result,
max_size )
Value:
result=yyread(buf,max_size,yyscanner);
static int yyread(char *buf, int max_size, yyscan_t yyscanner)
Definition constexp.l:110

Definition at line 45 of file constexp.l.

◆ YY_NO_INPUT

#define YY_NO_INPUT   1

Definition at line 37 of file constexp.l.

◆ YY_NO_UNISTD_H

#define YY_NO_UNISTD_H   1

Definition at line 38 of file constexp.l.

Function Documentation

◆ constexpYYwrap()

int constexpYYwrap ( yyscan_t )

Definition at line 166 of file constexp.l.

166{ return 1; }

◆ getLexerFILE()

static const char * getLexerFILE ( )
inlinestatic

Definition at line 48 of file constexp.l.

48{return __FILE__;}

◆ stateToString()

static const char * stateToString ( int state)
static

◆ yylex()

int yylex ( YYSTYPE * yylval_param,
yyscan_t yyscanner )

Definition at line 57 of file constexp.l.

59 { return TOK_QUESTIONMARK; }
60":" { return TOK_COLON; }
61"||" { return TOK_OR; }
62"&&" { return TOK_AND; }
63"|" { return TOK_BITWISEOR; }
64"^" { return TOK_BITWISEXOR; }
65"&" { return TOK_AMPERSAND; }
66"!=" { return TOK_NOTEQUAL; }
67"==" { return TOK_EQUAL; }
68"<" { return TOK_LESSTHAN; }
69">" { return TOK_GREATERTHAN; }
70"<=" { return TOK_LESSTHANOREQUALTO; }
71">=" { return TOK_GREATERTHANOREQUALTO; }
72"<<" { return TOK_SHIFTLEFT; }
73">>" { return TOK_SHIFTRIGHT; }
74"+" { return TOK_PLUS; }
75"-" { return TOK_MINUS; }
76"*" { return TOK_STAR; }
77"/" { return TOK_DIVIDE; }
78"%" { return TOK_MOD; }
79"~" { return TOK_TILDE; }
80"!" { return TOK_NOT; }
81"(" { return TOK_LPAREN; }
82")" { return TOK_RPAREN; }
83"'"(([^\'\n\r\\]+)|(\\‍(([ntvbrfa\\?'\"])|([0-9]+)|([xX][0-9a-fA-F]+))))"'" {
84 yyextra->strToken=yytext;
85 return TOK_CHARACTER;
86 }
870[0-7]*{CONSTSUFFIX}? { yyextra->strToken=yytext;
88 return TOK_OCTALINT;
89 }
90[1-9][0-9]*{CONSTSUFFIX}? { yyextra->strToken=yytext;
91 return TOK_DECIMALINT;
92 }
93(0x|0X)[0-9a-fA-F]+{CONSTSUFFIX}? { yyextra->strToken=yytext+2;
94 return TOK_HEXADECIMALINT;
95 }
96(0b|0B)[01]+{CONSTSUFFIX}? { yyextra->strToken=yytext+2;
97 return TOK_BINARYINT;
98 }
99(([0-9]+\.[0-9]*)|([0-9]*\.[0-9]+))([eE]([\-\+])?[0-9]+)?([fFlL])? {
100 yyextra->strToken=yytext; return TOK_FLOAT;
101 }
102([0-9]+[eE])([\-\+])?[0-9]+([fFlL])? {
103 yyextra->strToken=yytext; return TOK_FLOAT;
104 }
105.
106\n
107
108%%

◆ yyread()

static int yyread ( char * buf,
int max_size,
yyscan_t yyscanner )
static

Definition at line 110 of file constexp.l.

111{
112 struct yyguts_t *yyg = static_cast<struct yyguts_t*>(yyscanner);
113 int c=0;
114 while( c < max_size && yyextra->inputString[yyextra->inputPosition] )
115 {
116 *buf = yyextra->inputString[yyextra->inputPosition++] ;
117 c++; buf++;
118 }
119 return c;
120}