PropertyParser.hpp
Go to the documentation of this file.
1 // @formatter:off
2 //
3 // Balau core C++ library
4 //
5 // Copyright (C) 2017 Bora Software (contact@borasoftware.com)
6 //
7 // Licensed under the Boost Software License - Version 1.0 - August 17th, 2003.
8 // See the LICENSE file for the full license text.
9 //
10 
16 
17 #ifndef COM_BORA_SOFTWARE__BALAU_LANG_PROPERTY_PARSER__PROPERTY_PARSER
18 #define COM_BORA_SOFTWARE__BALAU_LANG_PROPERTY_PARSER__PROPERTY_PARSER
19 
22 
23 #include <regex>
24 
25 namespace Balau::Lang::Property {
26 
35 
39  public: explicit PropertyParser(ScannerApiScannedTokens && scannedTokens_)
40  : scannedTokens(std::move(scannedTokens_)) {}
41 
45  public: AST::Properties parse();
46 
48 
49  private: std::vector<std::unique_ptr<AST::PropertyNode>> producePropertyNodes(PropertyToken endToken);
50  private: std::unique_ptr<AST::PropertyNode> produceProperty();
51  private: std::unique_ptr<AST::PropertyNode> produceSimple(std::string_view key);
52  private: std::unique_ptr<AST::PropertyNode> produceComplex(std::string_view key);
53  private: std::unique_ptr<AST::PropertyNode> produceInclude();
54  private: std::unique_ptr<AST::PropertyNode> produceComment();
55  private: std::unique_ptr<AST::PropertyNode> produceEmptyLine();
56 
57  private: ScannerApiScannedTokens scannedTokens;
58 };
59 
60 } // namespace Balau::Lang::Property
61 
62 #endif // COM_BORA_SOFTWARE__BALAU_LANG_PROPERTY_PARSER__PROPERTY_PARSER
A recursive descent property language parser.
Definition: PropertyParser.hpp:32
The Property parser AST node classes.
AST::Properties parse()
Parse the input provided by the scanner to produce a property data object.
STL namespace.
PropertyParser(ScannerApiScannedTokens &&scannedTokens_)
Create a property parser which will parse the input provided by the scanner.
Definition: PropertyParser.hpp:39
PropertyToken
Property language tokens.
Definition: PropertyToken.hpp:29
Represents a single scanned token in the data structure.
Definition: ScannedTokens.hpp:434
A scanner for the property parser.
The Property parser.
The outer structure.
Definition: PropertyAst.hpp:175