PandA-2024.02
parser_flow_step.cpp
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) 2015-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  */
41 #include "parser_flow_step.hpp"
43 
44 #include <utility>
45 
47 #include "design_flow_manager.hpp"
48 #include "string_manipulation.hpp" // for STR
49 
50 ParserFlowStep::ParserFlowStep(const DesignFlowManagerConstRef _design_flow_manager,
51  const ParserFlowStep_Type _parser_step_type, const std::string& _file_name,
52  const ParameterConstRef _parameters)
53  : DesignFlowStep(_design_flow_manager, _parameters), parser_step_type(_parser_step_type), file_name(_file_name)
54 {
55 }
56 
58 
59 std::string ParserFlowStep::GetSignature() const
60 {
62 }
63 
64 std::string ParserFlowStep::GetName() const
65 {
66  return "Parser::" + GetKindText() + "::" + file_name;
67 }
68 
70  const std::string& file_name)
71 {
72  return "Parser::" + STR(parser_step_type) + "::" + file_name;
73 }
74 
75 std::string ParserFlowStep::GetKindText() const
76 {
78 }
79 
81 {
82  switch(parser_step_type)
83  {
84 #if HAVE_FROM_AADL_ASN_BUILT
85  case AADL:
86  return "Aadl";
87  case ASN:
88  return "Asn";
89 #endif
90  default:
92  }
94  return "";
95 }
96 
98 {
99  return true;
100 }
101 
103 {
104 }
105 
106 DesignFlowStepFactoryConstRef ParserFlowStep::CGetDesignFlowStepFactory() const
107 {
108  return design_flow_manager.lock()->CGetDesignFlowStepFactory("Parser");
109 }
~ParserFlowStep() override
Destructor.
static const std::string ComputeSignature(const ParserFlowStep_Type parser_step_type, const std::string &file_name)
Compute the signature of a parser flow step.
const std::string file_name
The name of the file to be parsed.
This class contains the base representation for a generic parser step.
RelationshipType
The relationship type.
ParserFlowStep(const DesignFlowManagerConstRef design_flow_manager, const ParserFlowStep_Type parser_step_type, const std::string &file_name, const ParameterConstRef parameters)
Constructor.
The base class for design step.
static const std::string EnumToKindText(const ParserFlowStep_Type parser_step_type)
Given a parser step type, return the name of the type.
std::string GetSignature() const override
Return the signature of this step.
#define STR(s)
Macro which performs a lexical_cast to a string.
Auxiliary methods for manipulating string.
enum ParserFlowStep_Type { } ParserFlowStep_Type
Autoheader include.
#define THROW_UNREACHABLE(str_expr)
helper function used to specify that some points should never be reached
Definition: exceptions.hpp:292
std::string GetName() const override
Return the name of this design step.
const ParserFlowStep_Type parser_step_type
The type of the parse.
void ComputeRelationships(DesignFlowStepSet &relationship, const DesignFlowStep::RelationshipType relationship_type) override
Compute the relationships of a step with other steps.
virtual std::string GetKindText() const final
Return the name of the type of this frontend flow step.
const Wrefcount< const DesignFlowManager > design_flow_manager
The design flow manager.
Wrapper of design_flow.
refcount< T > lock() const
Definition: refcount.hpp:212
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
Definition: refcount.hpp:94
DesignFlowStepFactoryConstRef CGetDesignFlowStepFactory() const override
Return the factory to create this type of steps.
bool HasToBeExecuted() const override
Check if this step has actually to be executed.

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