100 Commits

Author SHA1 Message Date
24af3590d1 Allow user to terminate the parser - close #13 2024-01-03 22:32:10 -05:00
f152cd9da1 Turn on simplecov to measure code coverage 2023-09-25 19:38:55 -04:00
db6dc0e099 Add dspec task to test distributable script 2023-09-24 18:54:19 -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
fff9700f91 Report the unexpected token for P_UNEXPECTED_TOKEN returns - close #11 2023-07-28 15:42:18 -04:00
c4bcb465da Remove std.stdio import and printing of unexpected tokens 2023-07-17 21:57:31 -04:00
d39fa61af0 Remove D language reference from test names 2023-07-15 14:19:30 -04:00
6333762414 Add user guide math expression example 2023-07-14 20:32:50 -04:00
653b4e00f6 Add testutils module with assert_eq() 2023-07-14 15:48:44 -04:00
5ce562cbc3 Allow configuring API prefix - close #9 2023-07-13 18:06:24 -04:00
424ddfe55a Output position info for various error return codes - close #10 2023-07-12 19:22:44 -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
779ba052c1 Use P_SUCCESS instead of P_TOKEN 2023-07-11 15:43:15 -04:00
eee6513384 Remove outer namespacing class 2023-07-10 22:54:33 -04:00
78ce7fb77a Replace 'ref' arguments with plain pointers 2023-07-10 22:40:03 -04:00
1c50d37a3e Add Position struct to track text positions 2023-07-10 11:18:57 -04:00
83a4037740 Return a lexer error on unexpected input - close #3 2023-07-08 10:36:58 -04:00
ecef933255 Consolidate return codes 2023-07-08 09:23:31 -04:00
0232b204c6 Return integer result code from Parser.parse() 2023-07-08 08:52:21 -04:00
8a377b4950 Just return integer result code from Lexer.lex_token() 2023-07-08 08:08:36 -04:00
d56cc2deeb Just return integer result code from Decoder.decode_code_point() 2023-07-05 16:54:52 -04:00
9895733a05 Switch unit tests from gdc to ldc2 2023-06-29 19:16:36 -04:00
f402315201 Name internally generated tokens with double-underscore 2023-03-13 14:13:13 -04:00
b92679e0c2 Replace LexedToken with Result struct 2023-03-11 21:16:55 -05:00
b00f53050b Clean up Decoder result handling 2023-03-06 20:32:01 -05:00
e2100f6ccd Move JSON parser source to standalone file 2023-01-16 14:59:43 -05:00
dbc5560aec Add JSON parser test case 2022-11-14 23:07:10 -05:00
62451f3a92 Allow multiple test files to be compiled 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
ca8a360c0e Provide matched text to lexer user code block 2022-10-15 13:37:34 -04:00
623c644e74 Work on real D strings instead of ubyte pointer and length
Also fix a couple UTF-8 decoder bugs!
2022-10-15 13:32:33 -04:00
de93d23585 Add test for non-LALR grammar failing to generate parser 2022-10-13 05:17:06 -04:00
ad09ff039a Add spec to test parsing lists 2022-10-13 05:02:05 -04:00
727c8cd1ea Execute rule user code blocks when reducing the rule 2022-10-13 04:56:50 -04:00
31970522de Store parse result; add result_type grammar keyword 2022-10-12 20:56:14 -04:00
02be6de48e Add lexer modes and $mode() code expansion 2022-10-09 22:49:01 -04:00
b2d11321fe Add grammar syntax to specify lexer mode for tokens and patterns 2022-10-04 22:23:39 -04:00
66d654b6b9 Add $token() user code block expansion 2022-10-02 10:43:47 -04:00
43fb74fe4b Capture and verify stdout results from tests 2022-10-02 10:31:07 -04:00
01ef4fc27c Rename some test files 2022-10-02 10:10:04 -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
e7e30c4f28 Add pattern statement 2022-09-30 21:05:18 -04:00
04367db0ac Add forward slashes around patterns and parse more robustly 2022-09-28 23:05:01 -04:00
4b148f3797 Add Grammar spec 2022-09-27 14:45:29 -04:00