QtNovelUI/libParse/parser_foundation.h

59 lines
1.4 KiB
C
Raw Normal View History

#ifndef PARSER_FOUNDATION_H
#define PARSER_FOUNDATION_H
#include "libParse_global.h"
#include "syntax_foundation.h"
namespace Parser {
/**
* @brief
*/
class KeywordDef : public Lex::TokenDef {
public:
KeywordDef(const QString &regex, const QString &type);
private:
QString regex_store;
QString type_store;
// TokenDef interface
public:
virtual QString typeName() const override;
virtual QString regexp() const override;
virtual Lex::Token *analysis(const Lex::WordBase &word) override;
};
/**
* @brief
*/
class SectionMatch : public Lex::TokenDef {
public:
SectionMatch(const QString &regex, const QString &type);
private:
QString regex_store;
QString type_store;
// TokenDef interface
public:
virtual QString typeName() const override;
virtual QString regexp() const override;
virtual Lex::Token *analysis(const Lex::WordBase &word) override;
};
class LIBPARSE_EXPORT ChainParser {
public:
ChainParser();
private:
SyntaxX::ElmRule node_refer;
SyntaxX::ElmRule text_section;
SyntaxX::ElmRule desc_pragraph;
SyntaxX::ElmRule node_def;
SyntaxX::ElmRule chain_def;
};
} // namespace Parser
#endif // PARSER_FOUNDATION_H