2016-04-17 09:30:14 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
2018-01-03 10:23:14 +00:00
|
|
|
the official desktop application for the Telegram messaging service.
|
2016-04-17 09:30:14 +00:00
|
|
|
|
2018-01-03 10:23:14 +00:00
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
2016-04-17 09:30:14 +00:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2016-04-18 20:33:43 +00:00
|
|
|
#include <memory>
|
2016-04-17 09:30:14 +00:00
|
|
|
#include <QtCore/QString>
|
2016-04-18 20:33:43 +00:00
|
|
|
#include "codegen/style/options.h"
|
2016-04-17 09:30:14 +00:00
|
|
|
|
|
|
|
namespace codegen {
|
|
|
|
namespace style {
|
|
|
|
namespace structure {
|
2016-04-18 20:33:43 +00:00
|
|
|
class Module;
|
|
|
|
} // namespace structure
|
|
|
|
class ParsedFile;
|
2016-04-17 09:30:14 +00:00
|
|
|
|
2016-04-18 20:33:43 +00:00
|
|
|
// Walks through a file, parses it and parses dependency files if necessary.
|
|
|
|
// Uses Generator class to produce the final output.
|
|
|
|
class Processor {
|
|
|
|
public:
|
|
|
|
explicit Processor(const Options &options);
|
|
|
|
Processor(const Processor &other) = delete;
|
|
|
|
Processor &operator=(const Processor &other) = delete;
|
2016-04-17 09:30:14 +00:00
|
|
|
|
2016-04-18 20:33:43 +00:00
|
|
|
// Returns 0 on success.
|
|
|
|
int launch();
|
2016-04-17 13:22:00 +00:00
|
|
|
|
2016-04-18 20:33:43 +00:00
|
|
|
~Processor();
|
2016-04-17 09:30:14 +00:00
|
|
|
|
2016-04-18 20:33:43 +00:00
|
|
|
private:
|
|
|
|
bool write(const structure::Module &module) const;
|
2016-04-17 13:22:00 +00:00
|
|
|
|
2016-04-18 20:33:43 +00:00
|
|
|
std::unique_ptr<ParsedFile> parser_;
|
|
|
|
const Options &options_;
|
2016-04-17 09:30:14 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace style
|
|
|
|
} // namespace codegen
|