VapourSynth-llvmexpr
Loading...
Searching...
No Matches
Preprocessor.hpp
Go to the documentation of this file.
1
19
20#ifndef LLVMEXPR_FRONTEND_INFIX2POSTFIX_PREPROCESSOR_HPP
21#define LLVMEXPR_FRONTEND_INFIX2POSTFIX_PREPROCESSOR_HPP
22
23#include <memory>
24#include <stdexcept>
25#include <string>
26#include <vector>
27
28namespace infix2postfix {
29
30class PreprocessorError : public std::runtime_error {
31 public:
32 using std::runtime_error::runtime_error;
33};
34
43
47 std::vector<MacroExpansion> expansions;
48};
49
51 std::string name;
52 std::string body;
53 bool is_function_like = false;
54 std::vector<std::string> parameters;
55};
56
58 std::string source;
59 std::vector<LineMapping> line_map;
60 std::vector<std::string> errors;
61 bool success;
63};
64
66 public:
67 explicit Preprocessor(std::string source);
69
70 Preprocessor(const Preprocessor&) = delete;
74
75 void addPredefinedMacro(std::string name, const std::string& value = "");
76
78
79 static std::string
80 formatDiagnosticWithExpansion(const std::string& message, int line,
81 const std::vector<LineMapping>& line_map);
82
83 static std::string
84 formatMacroExpansions(const std::vector<LineMapping>& line_map);
85
86 private:
87 class Impl;
88 std::unique_ptr<Impl> impl;
89};
90
91} // namespace infix2postfix
92
93#endif // LLVMEXPR_FRONTEND_INFIX2POSTFIX_PREPROCESSOR_HPP
Preprocessor(Preprocessor &&)=delete
static std::string formatMacroExpansions(const std::vector< LineMapping > &line_map)
Preprocessor & operator=(const Preprocessor &)=delete
Preprocessor(std::string source)
void addPredefinedMacro(std::string name, const std::string &value="")
static std::string formatDiagnosticWithExpansion(const std::string &message, int line, const std::vector< LineMapping > &line_map)
Preprocessor(const Preprocessor &)=delete
Preprocessor & operator=(Preprocessor &&)=delete
std::vector< MacroExpansion > expansions
std::vector< std::string > parameters
std::vector< LineMapping > line_map
std::vector< std::string > errors