PropertyParserService.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__PROPERTY_PARSER_SERVICE
18 #define COM_BORA_SOFTWARE__BALAU_LANG_PROPERTY__PROPERTY_PARSER_SERVICE
19 
22 
23 #include <stack>
24 
25 namespace Balau::Lang::Property {
26 
30 class PropertyParserService final {
34  public: static AST::Properties parse(const std::shared_ptr<Resource::Uri> & uri) {
35  PropertyScanner scanner(uri);
37  return parser.parse();
38  }
39 
43  public: static AST::Properties parse(const Resource::Uri & uri) {
44  PropertyScanner scanner(uri.clone());
46  return parser.parse();
47  }
48 
50 
51  public: PropertyParserService() = delete;
52  public: PropertyParserService(const PropertyParserService &) = delete;
53  public: PropertyParserService & operator = (const PropertyParserService &) = delete;
54 };
55 
56 } // namespace Balau::Lang::Property
57 
58 #endif // COM_BORA_SOFTWARE__BALAU_LANG_PROPERTY__PROPERTY_PARSER_SERVICE
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.
ScannedTokens< TokenT > scan()
Scan the input and return a ScannedTokens data structure.
Definition: AbstractScanner.hpp:54
Encapsulates the creation and execution of a pre-processor, scanner, and parser in a single function...
Definition: PropertyParserService.hpp:30
An abstract universal resource identifier.
Definition: Uri.hpp:131
virtual std::unique_ptr< Uri > clone() const =0
Clone the concrete Uri.
static AST::Properties parse(const Resource::Uri &uri)
Parse the input represented by the URI and generate a property AST tree.
Definition: PropertyParserService.hpp:43
A recursive descent property language parser.
A scanner for the property parser.
Definition: PropertyScanner.hpp:30
static AST::Properties parse(const std::shared_ptr< Resource::Uri > &uri)
Parse the input represented by the URI and generate a property AST tree.
Definition: PropertyParserService.hpp:34
The Property parser.
The outer structure.
Definition: PropertyAst.hpp:175