PandA-2024.02
Lexer_utilities.hpp
Go to the documentation of this file.
1 /*
2  *
3  * _/_/_/ _/_/ _/ _/ _/_/_/ _/_/
4  * _/ _/ _/ _/ _/_/ _/ _/ _/ _/ _/
5  * _/_/_/ _/_/_/_/ _/ _/_/ _/ _/ _/_/_/_/
6  * _/ _/ _/ _/ _/ _/ _/ _/ _/
7  * _/ _/ _/ _/ _/ _/_/_/ _/ _/
8  *
9  * ***********************************************
10  * PandA Project
11  * URL: http://panda.dei.polimi.it
12  * Politecnico di Milano - DEIB
13  * System Architectures Group
14  * ***********************************************
15  * Copyright (C) 2004-2024 Politecnico di Milano
16  *
17  * This file is part of the PandA framework.
18  *
19  * The PandA framework is free software; you can redistribute it and/or modify
20  * it under the terms of the GNU General Public License as published by
21  * the Free Software Foundation; either version 3 of the License, or
22  * (at your option) any later version.
23  *
24  * This program is distributed in the hope that it will be useful,
25  * but WITHOUT ANY WARRANTY; without even the implied warranty of
26  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27  * GNU General Public License for more details.
28  *
29  * You should have received a copy of the GNU General Public License
30  * along with this program. If not, see <http://www.gnu.org/licenses/>.
31  *
32  */
45 #ifndef LEXER_UTILITIES_HPP
46 #define LEXER_UTILITIES_HPP
47 
49 #include "config_HAVE_FLEX_2_5_34_OR_GREATER.hpp"
50 #include "config_HAVE_FLEX_2_5_35_OR_GREATER.hpp"
51 
52 #define yyalloc LN_CONCAT(yyalloc)
53 #define yyrealloc LN_CONCAT(yyrealloc)
54 #define yyfree LN_CONCAT(yyfree)
55 
56 #if HAVE_FLEX_2_5_35_OR_GREATER
57 
58 #include <cstddef>
59 
60 #ifndef YY_TYPEDEF_YY_SIZE_T
61 #define YY_TYPEDEF_YY_SIZE_T
62 using yy_size_t = size_t;
63 #endif
64 
65 void yyfree(void* ptr);
66 void* yyrealloc(void*, yy_size_t);
67 void* yyalloc(yy_size_t);
68 
69 #else
70 
71 void yyfree(void* ptr);
72 void* yyrealloc(void* ptr, unsigned int size);
73 void* yyalloc(unsigned int size);
74 
75 #endif
76 
77 #define YY_DECL int LN_CONCAT(FlexLexer)::yylex()
78 #include <iosfwd>
79 
80 #undef yyFlexLexer
81 #define yyFlexLexer LN_CONCAT(baseFlexLexer)
82 #include <FlexLexer.h>
83 
84 #ifndef LCLASS_SPECIALIZED
85 struct LN_CONCAT(FlexLexer) : public yyFlexLexer
86 {
87  LN_CONCAT(FlexLexer)(std::istream* argin = nullptr, std::ostream* argout = nullptr) : yyFlexLexer(argin, argout)
88  {
89  }
90  ~LN_CONCAT(FlexLexer)()
91  {
92  }
93  void yyerror(const char* msg)
94  {
95  LexerError(msg);
96  }
97  void LexerError(const char* msg)
98  {
99  std::cout << msg << " at line number |" << lineno() << "|\t";
100  std::cout << "text is |" << YYText() << "|" << std::endl;
101  throw "Parse Error";
102  }
103  int yywrap()
104  {
105  return 1;
106  }
107  YYSTYPE* lvalp;
108  int yylex();
109 };
110 #endif
111 
112 inline int yyFlexLexer::yylex()
113 {
114  return 0;
115 }
116 
117 #if HAVE_FLEX_2_5_34_OR_GREATER
118 inline int yyFlexLexer::yywrap()
119 {
120  return 1;
121 }
122 #else
123 #define yywrap LN_CONCAT(yywrap)
124 extern "C" inline int yywrap()
125 {
126  return 1;
127 }
128 #endif
129 
130 #endif
#define yyalloc
Autoheader include.
#define YYSTYPE
Header include.
#define yyfree
#define yywrap
#define yyrealloc
#define yyFlexLexer
#define LN_CONCAT(name)
unsigned int size_t
Definition: test.c:1

Generated on Mon Feb 12 2024 13:02:56 for PandA-2024.02 by doxygen 1.8.13