53 Commits

Author SHA1 Message Date
Niko Matsakis
13bc31f0ee add a random parse tree generation facility, use it to provide random inputs 2015-06-20 18:02:52 -04:00
Niko Matsakis
c9502edefd add a comment 2015-06-20 08:33:09 -04:00
Niko Matsakis
fadd3f2c66 Make a general prefix we can use for later 2015-06-20 08:32:01 -04:00
Niko Matsakis
5c71e53c6b distinguish lifetimes of the state table from the underlying grammar 2015-06-20 06:03:15 -04:00
Niko Matsakis
a661d9ee94 add an LR(1) interpreter that executes the action tables and constructs
a parse-tree. Use is to test the results from the LR(1) table generation
algorithm.
2015-06-20 05:43:06 -04:00
Niko Matsakis
077ed9060d build up action tables 2015-06-19 19:03:21 -04:00
Niko Matsakis
c66f7e2d40 lr1 construction seems to be working, tests are not yet really stable 2015-06-19 17:28:03 -04:00
Niko Matsakis
990f2a931a sketch out the state enumeration algorithm 2015-06-19 13:27:24 -04:00
Niko Matsakis
b324075eb3 expand test to test when we are in the middle of a configuration 2015-06-19 10:35:10 -04:00
Niko Matsakis
8c577422bf Start the naive LR(1) algorithm with support for transitive closures
over epsilon moves
2015-06-19 10:17:35 -04:00
Niko Matsakis
4e5204078a Start working on a naive LR(1) algorithm (seems like a good starting
point). Implement first set computation.
2015-06-19 06:42:11 -04:00
Niko Matsakis
334a419c49 Make newtypes for TerminalString and NonterminalString, among other
refactorings. I found it was annoying keeping them straight.
2015-06-19 05:30:43 -04:00
Niko Matsakis
048def7654 rather than the hacky Debug impl, just only compare stuff that is more
stable (and more imp't anyway)
2015-06-18 06:34:19 -04:00
Niko Matsakis
8dd121a8e7 lower test passes 2015-06-18 06:13:18 -04:00
Niko Matsakis
088ad2f444 remove two unused imports 2015-06-18 05:57:48 -04:00
Niko Matsakis
753244f598 remove nonce (unused) 2015-06-18 05:57:32 -04:00
Niko Matsakis
8755723e7a kill some dead code, write a lower test (that fails) 2015-06-18 05:57:11 -04:00
Niko Matsakis
9d3f7db25a Improve the Debug/Display impls 2015-06-18 05:48:08 -04:00
Niko Matsakis
6ea20abb8f Code up the lowering step (or a rough draft; no tests yet...) 2015-06-18 05:35:09 -04:00
Niko Matsakis
e7b377793b Add some tests for repeat ops, lay groundwork for lowering 2015-06-17 21:33:14 -04:00
Niko Matsakis
13df4186ed remove debugging printfs 2015-06-17 17:23:43 -04:00
Niko Matsakis
261c9a1446 remove unnecessary counter 2015-06-17 17:18:26 -04:00
Niko Matsakis
8c111030b0 remove steps from the normalization plan that no longer apply 2015-06-17 17:17:30 -04:00
Niko Matsakis
f282b943ba normalize away all repeat actions in macro expansion 2015-06-17 17:16:44 -04:00
Niko Matsakis
44d7050ddb generate action code in macro expand 2015-06-17 15:02:34 -04:00
Niko Matsakis
cc155debd7 Various bits of cleanup; add some routines to compute type repr
from parse-tree given types table
2015-06-17 06:16:44 -04:00
Niko Matsakis
9200285d49 Rewrite type inferencer to produce a separate Types table
using a simpler types grammar than rewrite the tree in place
2015-06-17 06:05:11 -04:00
Niko Matsakis
975ae0a200 cleanup tests a little 2015-06-16 11:34:01 -04:00
Niko Matsakis
7219b9c2d6 Type inference basically working now 2015-06-16 11:28:41 -04:00
Niko Matsakis
1b94c4276f Get type inference compiling, cleanup some dead code 2015-06-16 07:50:03 -04:00
Niko Matsakis
6875896e76 Fix macro tests to hide spans 2015-06-16 06:39:12 -04:00
Niko Matsakis
b940c0fab8 Start writing type inferencer, but adding spans broke our tests 2015-06-16 06:20:47 -04:00
Niko Matsakis
3d77afc278 Pull out () into their own rule 2015-06-16 04:59:32 -04:00
Niko Matsakis
0d9758c1dd Add a test for condition matching 2015-06-15 19:15:20 -04:00
Niko Matsakis
411c1be63f Add a macro facility and add the ability to escape out so we can
write some tests for the intermediate results.
2015-06-15 19:01:40 -04:00
Niko Matsakis
5283f62df7 Add support for conditions 2015-06-15 16:58:59 -04:00
Niko Matsakis
3a8992ab84 macro expansion compiles now 2015-06-15 11:00:15 -04:00
Niko Matsakis
3ddc0dfe02 sketch out macro expansion more 2015-06-15 10:33:11 -04:00
Niko Matsakis
7bf7f686d9 Richer typeref model 2015-06-15 07:49:29 -04:00
Niko Matsakis
9e311d41d3 Conditional alternatives. 2015-06-15 07:26:38 -04:00
Niko Matsakis
3305bbdd3e Macro definitions, references. 2015-06-15 07:11:32 -04:00
Niko Matsakis
30e3274477 Playing around with examples, syntax, etc 2015-06-15 06:42:56 -04:00
Niko Matsakis
20bb505929 Test with multiple alternatives 2015-06-13 22:26:03 -04:00
Niko Matsakis
2186eed80b Code blocks need a => 2015-06-13 22:15:05 -04:00
Niko Matsakis
3ab3bee0e1 More tests 2015-06-13 22:09:14 -04:00
Niko Matsakis
70280285bf some tests 2015-06-13 22:07:10 -04:00
Niko Matsakis
fb57e6295a Parser builds 2015-06-13 21:10:40 -04:00
Niko Matsakis
da84db12b9 Work on grammar, model 2015-06-13 09:45:43 -04:00
Niko Matsakis
855e8344f1 Add a new parse tree and plan out a bit more what we want 2015-06-13 07:01:50 -04:00
Niko Matsakis
ea577095c3 Convert to use interning 2015-06-13 06:11:15 -04:00