PandA-2024.02
PragmaParser.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 PRAGMAPARSER_HPP
46 #define PRAGMAPARSER_HPP
47 
49 #include <iosfwd>
50 
52 #include "custom_map.hpp"
53 #include "custom_set.hpp"
54 #include <list>
55 
57 #include "dbgPrintHelper.hpp"
58 #include "refcount.hpp"
59 
62 
69 {
70  private:
72  static unsigned int number;
73 
76 
78  const int debug_level;
79 
82 
86  bool analyze_pragma(std::string& Line);
87 
91  bool recognize_omp_pragma(std::string& Line);
92 
96  bool recognize_mapping_pragma(std::string& Line);
97 
102  bool recognize_call_point_hw_pragma(std::string& line) const;
103 
107  bool recognize_issue_pragma(std::string& Line);
108 
112  bool recognize_profiling_pragma(std::string& Line);
113 
117  bool recognize_generic_pragma(std::string& Line);
118 
120  unsigned int level;
121 
122  std::list<std::string> FloatingPragmas;
123 
125 
126  std::map<unsigned int, std::list<std::string>> OpenPragmas;
127 
129 
130  std::string name_function;
131 
132  public:
138  PragmaParser(const pragma_managerRef PM, const ParameterConstRef Param);
139 
143  ~PragmaParser();
144 
150  std::string substitutePragmas(const std::string& OldFile);
151 };
152 
155 
156 #endif
const ParameterConstRef Param
reference to the parameter data-structure
File containing functions and utilities to support the printing of debug messagges.
const int debug_level
current debugging level
REF_FORWARD_DECL(pragma_manager)
unsigned int level
counter for nesting level
redefinition of map to manage ordered/unordered structures
void line(int x1, int y1, int x2, int y2, unsigned int color)
Definition: main.c:110
bool recognize_generic_pragma(std::string &Line)
Retrieve information about a generic pragma directive (i.e., none of the known ones has been detected...
const pragma_managerRef PM
pointer to the pragma manager data-structure
std::map< unsigned int, std::list< std::string > > OpenPragmas
This class is used to manage the pragma directives found in the source code.
bool recognize_mapping_pragma(std::string &Line)
Retrieve information about a pragma directive when a mapping pragma has been found.
redefinition of set to manage ordered/unordered structures
CustomUnorderedSet< std::string > FunctionPragmas
std::string name_function
Template definition of refcount.
static unsigned int number
counter of generic pragma
bool recognize_issue_pragma(std::string &Line)
Retrieve information about a pragma directive when an issue pragma has been found.
~PragmaParser()
Destructor.
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
Definition: refcount.hpp:94
bool analyze_pragma(std::string &Line)
Retrieve information about a pragma directive when the token "#pragma" has been found.
std::list< std::string > FloatingPragmas
bool recognize_omp_pragma(std::string &Line)
Retrieve information about a pragma directive when a OpenMP (parallelism) pragma has been found...
PragmaParser(const pragma_managerRef PM, const ParameterConstRef Param)
Constructor.
std::string substitutePragmas(const std::string &OldFile)
Substitute the pragmas with proper functions.
bool recognize_call_point_hw_pragma(std::string &line) const
Retrieve information about a pragma directive of type pragma map call_point_hw.
Main class for parsing: contains the context associated with a parsing action and the methods to retr...
CONSTREF_FORWARD_DECL(Parameter)
STD include.
bool recognize_profiling_pragma(std::string &Line)
Retrieve information about a pragma directive when a profiling pragma has been found.

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