AirInv Logo  1.00.8
C++ Simulated Airline Inventory Management System Library
Loading...
Searching...
No Matches
FRAT5ParserHelper.hpp
Go to the documentation of this file.
1#ifndef __AIRINV_CMD_FRAT5PARSERHELPER_HPP
2#define __AIRINV_CMD_FRAT5PARSERHELPER_HPP
3
4// //////////////////////////////////////////////////////////////////////
5// Import section
6// //////////////////////////////////////////////////////////////////////
7// STL
8#include <string>
9// StdAir
10#include <stdair/command/CmdAbstract.hpp>
11// Airinv
15
16// Forward declarations
17namespace stdair {
18 class BomRoot;
19}
20
21namespace AIRINV {
22
23 namespace FRAT5ParserHelper {
24
25 // ///////////////////////////////////////////////////////////////////
26 // Semantic actions
27 // ///////////////////////////////////////////////////////////////////
35
41 void operator() (iterator_t iStr, iterator_t iStrEnd) const;
42 };
43
49 void operator() (int iDTD) const;
50 };
51
57 void operator() (double iReal) const;
58 };
59
63 doEndCurve (stdair::BomRoot&, FRAT5Struct&);
65 void operator() (iterator_t iStr, iterator_t iStrEnd) const;
67 stdair::BomRoot& _bomRoot;
68 };
69
71 //
72 // (Boost Spirit) Grammar Definition
73 //
75
89 struct FRAT5Parser :
90 public boost::spirit::classic::grammar<FRAT5Parser> {
91
92 FRAT5Parser (stdair::BomRoot&, FRAT5Struct&);
93
94 template <typename ScannerT>
95 struct definition {
96 definition (FRAT5Parser const& self);
97
98 // Instantiation of rules
99 boost::spirit::classic::rule<ScannerT> curve_list,
101
103 boost::spirit::classic::rule<ScannerT> const& start() const;
104 };
105
106 // Parser Context
107 stdair::BomRoot& _bomRoot;
109 };
110 }
111
117 //
118 // Entry class for the file parser
119 //
121
126 class FRAT5FileParser : public stdair::CmdAbstract {
127 public:
129 FRAT5FileParser (stdair::BomRoot& ioBomRoot,
130 const stdair::Filename_T& iFilename);
131
133 bool generateFRAT5Curves ();
134
135 private:
137 void init();
138
139 private:
140 // Attributes
142 stdair::Filename_T _filename;
143
145 iterator_t _startIterator;
146
148 iterator_t _endIterator;
149
151 stdair::BomRoot& _bomRoot;
152
154 FRAT5Struct _frat5;
155 };
156
157}
158#endif // __AIRINV_CMD_FRAT5PARSERHELPER_HPP
FRAT5FileParser(stdair::BomRoot &ioBomRoot, const stdair::Filename_T &iFilename)
boost::spirit::classic::file_iterator< char_t > iterator_t
Forward declarations.
boost::spirit::classic::rule< ScannerT > curve_end
boost::spirit::classic::rule< ScannerT > curve_list
boost::spirit::classic::rule< ScannerT > const & start() const
boost::spirit::classic::rule< ScannerT > value_pair
boost::spirit::classic::rule< ScannerT > key
boost::spirit::classic::rule< ScannerT > not_to_be_parsed
boost::spirit::classic::rule< ScannerT > map
boost::spirit::classic::rule< ScannerT > curve
FRAT5Parser(stdair::BomRoot &, FRAT5Struct &)
void operator()(iterator_t iStr, iterator_t iStrEnd) const
doEndCurve(stdair::BomRoot &, FRAT5Struct &)
void operator()(iterator_t iStr, iterator_t iStrEnd) const