8#ifndef SEN_CORE_LANG_STL_PARSER_H
9#define SEN_CORE_LANG_STL_PARSER_H
41 [[nodiscard]] std::vector<StlStatement>
parse();
68 [[nodiscard]] std::optional<StlAttributeList> maybeAttributeList(
const std::string& subjectName);
69 [[nodiscard]]
StlAttributeList attributeList(
const std::string& subjectName);
71 [[nodiscard]] std::shared_ptr<StlExpr> expression();
72 [[nodiscard]] std::shared_ptr<StlExpr> logicOr();
73 [[nodiscard]] std::shared_ptr<StlExpr> logicAnd();
74 [[nodiscard]] std::shared_ptr<StlExpr> equality();
75 [[nodiscard]] std::shared_ptr<StlExpr> comparison();
76 [[nodiscard]] std::shared_ptr<StlExpr> term();
77 [[nodiscard]] std::shared_ptr<StlExpr> factor();
78 [[nodiscard]] std::shared_ptr<StlExpr> unary();
79 [[nodiscard]] std::shared_ptr<StlExpr> primary();
80 [[nodiscard]] std::shared_ptr<StlExpr> variable();
86 [[nodiscard]]
bool match(
const std::vector<StlTokenType>& types);
88 [[nodiscard]]
const StlToken& peek()
const;
89 [[nodiscard]]
StlToken peekNext()
const;
90 [[nodiscard]]
const StlToken& previous()
const;
91 [[nodiscard]]
bool isAtEnd() const noexcept;
92 [[nodiscard]] const
StlToken& advance();
95 void checkNotReserved(const
StlToken& token);
101 [[nodiscard]]
bool containsNewLine(
size_t startOffset,
size_t endOffset) const;
105 std::
size_t current_ = 0U;
StlParser(const StlTokenList &tokens)
Stores the tokens for eventual parsing.
std::vector< StlStatement > parse()
Parse the tokens given in the constructor into a set of statements.
QueryStatement parseQuery()
Parse the tokens as a query statement.
std::variant< std::monostate, StlImportStatement, StlPackageStatement, StlStructStatement, StlEnumStatement, StlVariantStatement, StlSequenceStatement, StlArrayStatement, StlQuantityStatement, StlTypeAliasStatement, StlOptionalTypeStatement, StlClassStatement, StlInterfaceStatement > StlStatement
Definition stl_statement.h:183
std::vector< StlToken > StlTokenList
Definition stl_token.h:121
std::vector< StlAttribute > StlAttributeList
Definition stl_statement.h:41
StlTokenType
Supported tokens.
Definition stl_token.h:28
Definition stl_statement.h:198
Definition stl_statement.h:204
Definition stl_statement.h:134
Definition stl_statement.h:111
Definition stl_statement.h:176
Definition stl_statement.h:72
Definition stl_statement.h:65
Definition stl_statement.h:159
Definition stl_statement.h:150
Definition stl_statement.h:26
Definition stl_statement.h:167
Definition stl_statement.h:127
Definition stl_statement.h:31
Definition stl_statement.h:93
Definition stl_statement.h:102
Definition stl_statement.h:50
Definition stl_statement.h:57
Definition stl_statement.h:120
Definition stl_statement.h:44
Definition stl_statement.h:141
Definition stl_statement.h:80
Definition stl_statement.h:86
Definition code_location.h:14
Definition stl_parser.h:36
ParseError(const std::string &msg)
Definition stl_parser.h:37
Definition stl_token.h:98