47 Commits

Author SHA1 Message Date
ca9c23f96b Add lexer user code expansions to access lexer match text positions 2026-07-02 21:27:55 -04:00
1729546d69 Track rule component positions - close #41 2026-07-02 16:42:50 -04:00
45843da0df Fix #line reset directives 2026-06-29 22:21:45 -04:00
7a140623ff Use #line for user code blocks to report input grammar position for errors 2026-05-21 16:24:25 -07:00
51b09a5799 Support custom lex function 2026-04-10 16:36:16 -04:00
d4ad67c23d Allow user to specify custom token node fields 2026-02-21 21:06:40 -05:00
78adf86103 Allow user-defined context fields 2026-02-13 23:53:18 -05:00
77ec7c9de4 Rename AST generation mode to tree generation mode 2026-02-09 21:59:00 -05:00
6a87bb2d56 Add support for multiple starting rules - close #38 2026-02-09 21:21:49 -05:00
072af73b1e Support C++ output language 2026-02-07 18:59:01 -05:00
eb9d9026fc Allow multiple lexer modes to be specified for a lexer pattern - close #35 2025-03-11 20:40:10 -04:00
a7348be95d Add rule field aliases - #24 2024-07-22 20:16:52 -04:00
2dd89445fc Add command line switch to output warnings to stderr - close #26 2024-07-14 15:36:07 -04:00
0d1ee74ca6 Give a better error message when a referenced ptype has not been declared 2024-05-09 17:35:27 -04:00
f3e4941ad8 Allow rule terms to be marked as optional 2024-05-09 11:56:13 -04:00
494afb7307 Allow specifying the start rule name 2024-05-05 12:39:00 -04:00
153f9d28f8 Allow user to specify AST node prefix or suffix
Add ast_prefix and ast_suffix grammar statements.
2024-05-04 21:49:13 -04:00
cb06a56f81 Add AST generation - #22 2024-04-22 20:51:27 -04:00
fad7f4fb36 Allow user termination from lexer code blocks - close #15 2024-03-29 13:45:08 -04:00
24af3590d1 Allow user to terminate the parser - close #13 2024-01-03 22:32:10 -05:00
197f126109 Add Assets module to abstract accessing asset files 2023-09-25 16:16:20 -04:00
562c24ce9e Remove grammar "class" statement 2023-09-24 13:23:44 -04:00
3c8794058f Add C backend - close #4 2023-08-24 09:40:01 -04:00
ce22e3465b Use consistent styling
Prefix public symbols with "p_".
User lowercase for all type aliases.
Clean up some comments.
2023-07-12 16:45:59 -04:00
7a1b4064c1 Switch to new API - close #8
The new API is more C-like and will allow consistency across all future
supported language targets.
2023-07-12 15:46:13 -04:00
ffd02c16d1 Add StateID; remove TransitionResult 2023-07-08 16:46:38 -04:00
8a377b4950 Just return integer result code from Lexer.lex_token() 2023-07-08 08:08:36 -04:00
b78827746a Return a Token object from Lexer.user_code() 2023-03-17 20:24:48 -04:00
b92679e0c2 Replace LexedToken with Result struct 2023-03-11 21:16:55 -05:00
2e48921bb1 Fix $n expansion for rules to use rule component ptype 2022-11-14 21:00:49 -05:00
c6ea4f83c2 Store parser values according to the rule/pattern type 2022-11-13 22:20:30 -05:00
e4a160f918 Allow defining multiple parser types and assigning parser types to tokens and rules 2022-11-13 13:35:19 -05:00
8dc27686aa Rename result_type to ptype, parser result to pvalue 2022-11-12 13:29:10 -05:00
bca0a14371 Allow storing a result value for a token from a lexer code block 2022-10-16 21:40:25 -04:00
727c8cd1ea Execute rule user code blocks when reducing the rule 2022-10-13 04:56:50 -04:00
02be6de48e Add lexer modes and $mode() code expansion 2022-10-09 22:49:01 -04:00
6bd9d4a09b Remove _TOKEN_NONE and use _TOKEN_COUNT instead 2022-10-03 21:40:34 -04:00
66d654b6b9 Add $token() user code block expansion 2022-10-02 10:43:47 -04:00
f46b5b3f4d Remove TOKEN_EOF; define EOF token and start rule in Generator 2022-10-02 10:07:44 -04:00
150be33826 Assign pattern code IDs in Generator instead of Grammar 2022-10-01 10:36:35 -04:00
38ae5ac7a1 Split Token class into Token/Pattern 2022-09-15 22:46:44 -04:00
30f4cfcc99 Write parser log file
Fix bug of skipping rule set IDs.
Remove unneeded out_sets from ItemSet class.
2022-06-26 11:06:55 -04:00
f17efe8c82 Add RuleSet#id to use when reducing
Parser will know what state to go to after reducing a Rule based on the
RuleSet ID.
Start on Parser class.
2022-06-21 20:07:27 -04:00
60e2818075 Determine the reduce actions for each parser state 2022-06-17 01:45:48 -04:00
11ea02fb86 Determine the possibly-empty RuleSets 2022-06-17 01:35:02 -04:00
c42c3576a5 Remove RuleSet creation from Grammar 2022-06-05 15:16:41 -04:00
ca6a93a4c5 Move generation logic to new Generator class 2022-06-05 14:57:58 -04:00