72 std::vector<ncnt>& getIndents();
80 template <
typename T>
void setScan() { _mode = &T::instance; }
98 using stelaTokenScanable::onScan;
235 std::string _removeCRLF(
const std::string&
codes);
247 nbool _isIgnoreWhitespace;
249 std::vector<ncnt> _indents;
251 std::vector<nint> _states;
253 std::string _postfix;
254 nbool _isTokenInLine;
256 std::vector<std::pair<std::string, std::string>> _defComments;
257 std::vector<std::string> _assignComments;
260 std::vector<std::string> _errs;
Boolean literal — the BOOLVAL form of stela source.
Definition boolStela.hpp:13
Numeric literal — the INTVAL and FLTVAL forms of stela source.
Definition numStela.hpp:18
Parser for stela configuration language.
Definition stelaParser.hpp:39
void onCommentBegin(const nchar *text, ncnt col)
Collects the # or ## that opens a comment.
void setScan()
Sets the scanning mode for the lexer.
Definition stelaParser.hpp:80
stela * onInt(const std::string &repr)
Creates a number node from an integer literal, keeping its spelling.
nint onScan(stelaParser &ps, ZZSTYPE *val, ZZLTYPE *loc, zzscan_t scanner, nbool &isBypass) override
Handles scanning for the lexer, overriding the base stelaTokenScanable behavior.
nint onIndent(ncnt col, nint tok)
Handles an increase in indentation.
tstr< stela > parseFromFile(const std::string &path)
Parses stela code from the specified file path.
int popState()
Pops a Flex scanner state from the state stack.
int pushState(int newState)
Pushes a new Flex scanner state onto the state stack.
nint onTokenComma(nint tok)
Handles the comma token.
void onParseErr(const std::string &msg, const nchar *symbolName)
Handles a parse error, reporting the message and the symbol where the error occurred.
nint onTokenColon(nint tok)
Handles the colon token.
tstr< stela > parseFromFile(const nchar *path)
Parses stela code from the specified C-style file path.
tstr< stela > parse(const nchar *codes)
Parses the given C-style string of stela code.
stela * onFlt(const std::string &repr)
Creates a number node from a float literal, keeping its spelling.
nint onTokenDefAssign(nint tok)
Holds aside the comments above an assignment until its value is complete.
tstr< stela > parse(const std::string &codes)
Parses the given string of stela code.
nchar onScanUnexpected(const nchar *token)
Handles an unexpected token encountered during scanning.
nint onIgnoreIndent(nint tok)
Handles ignoring indentation (e.g., for inline blocks).
stela * onPrimitive(const T &arg)
Creates a value stela node from a primitive value.
Definition stelaParser.hpp:196
void report(const std::string &msg)
Reports a message, typically an error or warning, encountered during parsing.
nint onTokenDef(nint tok)
Marks the start of a def header so its comments can be held aside.
void onComment(const nchar *text)
Collects a piece of comment text the scanner would otherwise drop.
nint onTokenNewLine(nint tok)
Handles the newline token.
nint onTokenEndOfFile()
Handles the end-of-file token.
nint onDedent(ncnt col, nint tok)
Handles a decrease in indentation.
Smart dedent handler for indentation-based parsing.
Definition stelaSmartDedent.hpp:25
Token dispatcher for managing token queue during parsing.
Definition stelaTokenDispatcher.hpp:14
Base class for token scanning strategies.
Definition stelaTokenScan.hpp:30
Interface for token scanning during stela parsing.
Definition stelaTokenScanable.hpp:19
Version stela node for semantic version handling.
Definition verStela.hpp:26
Rich logging support with polymorphic type conversion.
Definition richLog.hpp:34