* Copyright (c) Huawei Technologies Co., Ltd. 2025. All rights reserved.
* This source file is part of the Cangjie project, licensed under Apache-2.0
* with Runtime Library Exception.
*
* See https://cangjie-lang.cn/pages/LICENSE for license information.
*/
#ifndef CANGJIE_PARSER_SYNTAX_H
#define CANGJIE_PARSER_SYNTAX_H
#include "ParserSyntaxImpl.h"
using namespace Cangjie;
using namespace Cangjie::AST;
class ParserSyntax : public Parser {
public:
ParserSyntax(const std::string& input, DiagnosticEngine& diag, SourceManager& sm, const Position& pos = {0, 1, 1},
bool attachComment = false);
ParserSyntax(const std::vector<Token>& inputTokens, DiagnosticEngine& diag, SourceManager& sm, bool attachComment = false);
~ParserSyntax();
OwnedPtr<AST::Node> ParseExprOrDecl(ScopeKind sk);
void AttachComment(std::vector<OwnedPtr<AST::Node>>& nodes);
private:
std::unique_ptr<class ParserSyntaxImpl> implSyntax;
};
#endif