Commit graph

54 commits

Author SHA1 Message Date
561dcd87ff Allow nonterminals to be renamed 2024-05-30 19:15:20 -07:00
4b8fef9ad6 Starts and ends in the output 2024-05-30 08:36:35 -07:00
dfef449c33 Better tree output 2024-05-30 08:24:36 -07:00
56d24c5fb9 Chaos: split tables, interactions, Terminal
- Tables are split into `actions` and `goto` now to make formatting
  nicer
- Token is renamed Terminal
- Likes are now Florps
- Lexer now loaded dynamically (badly)
2024-05-30 08:02:47 -07:00
71078f76b4 Interactive grammar editing 2024-05-29 19:28:42 -07:00
45a9303a27 Transparent rules
Better parsing/action types
Good grief
2024-05-29 09:07:19 -07:00
4f8aef3f89 Start working on the harness 2024-05-29 07:48:55 -07:00
7c4705714e Faster still.
Also somehow I was not merging things correctly for LALR; this merges
more completely and winds up with 215 states for the fine grammar,
which is like half of what it used to be?
2024-05-28 08:07:11 -07:00
28634677bf A little more faster. 2024-05-28 05:56:44 -07:00
bde22a5c99 A little faster but I think I might be doing this wrong. 2024-05-28 04:58:23 -07:00
8d58c64040 Fix LALR. Small, but very very slow. 2024-05-27 22:31:33 -07:00
0fc04cf11e Fix grammar bugs, work on debugging harness. 2024-05-27 19:02:10 -07:00
797ec8cd76 Correct type annotations for pyright
Work around microsoft/pyright#8008.
2024-05-27 06:50:15 -07:00
7c1d9b5f2b A cleaner API
I've been hacking on this in a different repository, so I thought I'd
bring it over here.
2024-05-05 08:45:45 -07:00
f656dbd8f3 faster: Significant performance boost on large grammar
15s to 5s
2024-04-17 23:25:15 -07:00
6fa89a9757 faster: Finish the big grammar 2024-04-17 17:23:14 -07:00
de0a76818e faster: Correct precedence but don't use it
Precedence now works for, like, resolving expressions in a single
big table but uh... it takes the time from 700ms to like 7s so I've
reverted it for now.
2024-04-17 17:13:18 -07:00
7147557e2b faster: Snapshot a big grammar I'm playing with 2024-04-17 11:07:56 -07:00
d0be3ea267 faster: Precedence support, necessary for IfStatement 2024-04-17 11:06:14 -07:00
c100613ff5 faster: Trace parse when reporting ambiguity, fix first 2024-04-16 21:45:47 -07:00
86d7306082 faster: An attempt at better error messages 2024-04-15 21:23:03 -07:00
c840174dc6 faster: Pre-compute successors and lookups 2024-04-15 20:15:31 -07:00
a818a4a498 faster: All symbols are integers 2024-04-15 16:05:42 -07:00
ee60951ffc faster: only consider possible values when generating successors 2024-04-15 09:55:44 -07:00
5f89f460e5 faster: Be explicit about Configuration, cache hash
The next step though will be to replace the Configuration with an
integer, and intern all Configurations, along with all other objects.
2024-04-15 09:48:03 -07:00
be93498e96 faster: Better set index for table building 2024-04-15 06:56:59 -07:00
ab7313339a faster: Iterative/Cached first and follow 2024-04-15 06:33:50 -07:00
f4ac1a4cc0 faster: Type annotation and grammar -> dict 2024-04-14 09:10:07 -07:00
7ea47075ea faster: Extract table builder 2024-04-13 14:10:54 -07:00
d60566c5a4 faster: report multiple ambiguities 2024-04-13 13:53:41 -07:00
066ad1e982 faster: Iterative gen_sets 2024-04-13 13:33:36 -07:00
c5552ab36f faster: split out recursive sets 2024-04-13 13:20:33 -07:00
44c71b2ea9 faster: tuples and some caching 2024-04-13 13:19:00 -07:00
ade859d6a0 faster: gen closure iterative 2024-04-13 13:17:02 -07:00
e1240759eb faster: first symbol cache 2024-04-13 13:16:26 -07:00
9cf9880bd1 faster: sort with None properly 2024-04-13 12:32:26 -07:00
02e8282e0f Baseline: "faster" 2024-04-13 12:30:54 -07:00
3218367c65 Fix some lints 2018-03-21 20:13:45 -07:00
a96c88a39e Create README.md 2016-12-13 16:15:33 -08:00
1ee06dde59 LALR parsers
I'm starting to get worried about quadratic behavior though.
2016-12-13 16:14:14 -08:00
9fe44d30e0 Canonical LR1.
Also:

- Reorganize the file into sections so I can keep track of where I am,
  and so it reads more cleanly from top to bottom.

- A little more work on documentation and comments and the like.
2016-12-13 16:14:14 -08:00
c4be7bcd9f Handle mutual recursion in gen_follow
Also an example of a case where SLR1 fails, to lead into LR1
generation.
2016-12-13 16:14:14 -08:00
a2e8a784c2 Fiddle with message. 2016-12-13 16:14:14 -08:00
86bd8fffc8 SLR1 parsing. 2016-12-13 16:14:14 -08:00
8d0726b3a4 Ok, one more bit of documentation. 2016-12-13 16:14:14 -08:00
95b01a627d Docs
(And a small bug fix.)
2016-12-13 16:14:14 -08:00
cf10891c19 Make it so Configuration() is constructed fewer places
This will make it so that I can add fields to Configuration to support
additional parser generators without breaking any individual
generator.
2016-12-13 16:14:14 -08:00
169ec4ff08 First and follow. 2016-12-13 16:14:14 -08:00
5a0b1654a9 Conflicting examples. 2016-12-13 16:14:14 -08:00
9781765043 More docs, more stuff. 2016-12-13 16:14:14 -08:00