2026-06-16 19:06:48 +05:30
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <vector>
|
|
|
|
|
#include <unordered_map>
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
|
|
namespace pdfengine {
|
|
|
|
|
|
|
|
|
|
enum class AstNodeType {
|
|
|
|
|
Number,
|
|
|
|
|
Name,
|
|
|
|
|
String,
|
|
|
|
|
HexString,
|
|
|
|
|
Boolean,
|
|
|
|
|
Null,
|
|
|
|
|
Array,
|
|
|
|
|
Dictionary
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class AstNode {
|
|
|
|
|
public:
|
|
|
|
|
AstNodeType type;
|
|
|
|
|
std::string stringValue;
|
|
|
|
|
std::vector<uint8_t> bytesValue;
|
|
|
|
|
double numberValue = 0.0;
|
|
|
|
|
bool boolValue = false;
|
|
|
|
|
|
|
|
|
|
std::vector<std::shared_ptr<AstNode>> arrayItems;
|
|
|
|
|
std::unordered_map<std::string, std::shared_ptr<AstNode>> dictItems;
|
|
|
|
|
|
|
|
|
|
AstNode() = default;
|
|
|
|
|
explicit AstNode(AstNodeType t) : type(t) {}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct Operation {
|
|
|
|
|
std::string op;
|
|
|
|
|
std::vector<std::shared_ptr<AstNode>> operands;
|
|
|
|
|
};
|
|
|
|
|
|
2026-06-22 15:18:47 +05:30
|
|
|
}
|