|
| tstr< stela > | parse (const std::string &codes) |
| | Parses the given string of stela code.
|
| |
| tstr< stela > | parse (const nchar *codes) |
| | Parses the given C-style string of stela code.
|
| |
| tstr< stela > | parseFromFile (const std::string &path) |
| | Parses stela code from the specified file path.
|
| |
| tstr< stela > | parseFromFile (const nchar *path) |
| | Parses stela code from the specified C-style file path.
|
| |
|
stelaTokenDispatcher & | getDispatcher () |
| |
|
std::vector< ncnt > & | getIndents () |
| |
|
nbool | isInit () const |
| |
| template<typename T > |
| void | setScan () |
| | Sets the scanning mode for the lexer.
|
| |
|
void | rel () |
| |
| int | pushState (int newState) |
| | Pushes a new Flex scanner state onto the state stack.
|
| |
| int | popState () |
| | Pops a Flex scanner state from the state stack.
|
| |
| 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 | onTokenEndOfFile () |
| | Handles the end-of-file token.
|
| |
| nint | onTokenColon (nint tok) |
| | Handles the colon token.
|
| |
| nint | onTokenNewLine (nint tok) |
| | Handles the newline token.
|
| |
| nint | onTokenComma (nint tok) |
| | Handles the comma token.
|
| |
| nint | onIndent (ncnt col, nint tok) |
| | Handles an increase in indentation.
|
| |
| nint | onDedent (ncnt col, nint tok) |
| | Handles a decrease in indentation.
|
| |
| nint | onIgnoreIndent (nint tok) |
| | Handles ignoring indentation (e.g., for inline blocks).
|
| |
| nchar | onScanUnexpected (const nchar *token) |
| | Handles an unexpected token encountered during scanning.
|
| |
|
stela * | onDefBlock (stela *stmt) |
| |
|
stela * | onDefBlock (stela *blk, stela *stmt) |
| |
|
stela * | onDefBlock () |
| |
| template<typename T > |
| stela * | onPrimitive (const T &arg) |
| | Creates a valStela object from a primitive value.
|
| |
|
verStela * | onVer (const std::string &version) |
| |
|
stela * | onDefProp (const std::string &name, stela &rhs) |
| |
|
stela * | onDefAssign (const std::string &name, stela *rhs) |
| |
|
stela * | onDefOrigin (const std::string &name, stela &blk) |
| |
|
stela * | onDefArray (const stela &elem) |
| |
|
stela * | onDefArray (stela &as, const stela &elem) |
| |
|
stela * | onCompilationUnit (stela *blk) |
| |
| void | onParseErr (const std::string &msg, const nchar *symbolName) |
| | Handles a parse error, reporting the message and the symbol where the error occurred.
|
| |
| void | report (const std::string &msg) |
| | Reports a message, typically an error or warning, encountered during parsing.
|
| |
| nint | onScan (stelaParser &ps, ZZSTYPE *val, ZZLTYPE *loc, zzscan_t scanner) |
| | Default entry point for token scanning.
|
| |
| virtual nint | onScan (stelaParser &ps, ZZSTYPE *yylval, ZZLTYPE *loc, zzscan_t yyscanner, nbool &isBypass)=0 |
| | Pure virtual method for concrete token scanning implementations.
|
| |
| nint | onScan (stelaParser &ps, ZZSTYPE *val, ZZLTYPE *loc, zzscan_t scanner) |
| | Default entry point for token scanning.
|
| |
Parser for stela configuration language
Entry point for the Stela parsing component. Specify scripts through parse() or parseFromFile(), and the parsed result is returned in Stela structure.
Similar structure to byeol parser
Since the stela language itself is a specialized language of byeol, the parser is also based on the byeol language parser. Since it's a less complex language than byeol, it's recommended to examine this parser code before looking at the core module.
- bison - stelaParser structure
Uses flex and bison, with flex named lowscanner and bison named lowparser. These low-level scanner and parser exist only within the parser component and are never exposed externally. When stelaParser::parse() executes, it runs lowscanner. lowscanner tokenizes and passes tokens to lowparser. When lowparser matches rules on received tokens, it passes events back to stelaParser. Therefore, stelaParser's functions starting with on are event handling functions that define how to create nodes and build the AST.
Indentation Rule
Like the byeol language, stela applies the offside rule, making it very sensitive to indentation. Unlike typical languages, it must count whitespace after newlines. Once indentation is confirmed and determines which scope the code line belongs to, whitespace should be ignored afterward.