WsParser_VS/libSyntax/ast_gen.h

39 lines
950 B
C
Raw Normal View History

2024-03-17 07:58:28 +00:00
#pragma once
2025-02-07 15:26:20 +00:00
#include "libsyntax.h"
2024-03-17 07:58:28 +00:00
#include "ast_basic.h"
2025-02-07 15:26:20 +00:00
namespace ast_gen {
2024-03-17 07:58:28 +00:00
/**
2025-02-11 14:32:10 +00:00
* @brief
2025-02-07 15:26:20 +00:00
*/
2025-02-08 01:06:39 +00:00
class LIBSYNTAX_EXPORT SyntaxParser {
2024-03-17 07:58:28 +00:00
private:
2025-02-08 05:40:36 +00:00
std::shared_ptr<const lib_syntax::IBasicRule> _rule_bind = nullptr;
2024-03-17 07:58:28 +00:00
public:
2025-02-08 05:40:36 +00:00
SyntaxParser(std::shared_ptr<const lib_syntax::IBasicRule> rule);
2024-03-17 07:58:28 +00:00
/**
2025-02-11 14:32:10 +00:00
* @brief
* @param wods
* @return ->
2025-02-07 15:26:20 +00:00
*/
2025-02-08 05:40:36 +00:00
QList<std::shared_ptr<const lib_syntax::MatchCursor>> parse(std::shared_ptr<const lib_words::IPrimitiveWord> words);
2025-02-07 15:26:20 +00:00
/**
2025-02-11 14:32:10 +00:00
* @brief
* @param cursor
* @param root
* @return
2025-02-07 15:26:20 +00:00
*/
std::shared_ptr<ast_basic::IExprInstance> getAst(
std::shared_ptr<const lib_syntax::MatchCursor> cursor, std::shared_ptr<ast_basic::IExprInstance> root);
2024-03-17 07:58:28 +00:00
};
2024-03-17 07:58:28 +00:00
}