Ashley Williams
27a3003da4
fix spacing and add trailing commas to calc3 example
2016-06-29 13:55:03 -04:00
Niko Matsakis
04be5f9a8c
Merge pull request #114 from nikomatsakis/lane-table
...
Towards lane table support
2016-06-01 05:32:06 -04:00
Niko Matsakis
35f7650d27
do a better job suppressing dead-code warnings
2016-06-01 05:31:21 -04:00
Niko Matsakis
728c33393d
squash dead-code warnings
2016-06-01 05:03:56 -04:00
Niko Matsakis
71672847d3
remove dead import
2016-06-01 05:03:56 -04:00
Niko Matsakis
6e777652a6
kill some dead code, reformat with rustfmt
2016-06-01 05:03:56 -04:00
Niko Matsakis
7a7fb269d8
get tests passing again
2016-06-01 05:03:56 -04:00
Niko Matsakis
31a3304be5
remove some unused variables and imports
2016-06-01 05:03:56 -04:00
Niko Matsakis
e88a104cf2
move conflicts vector out of State
2016-06-01 05:03:56 -04:00
Niko Matsakis
43e3fe2315
use TokenSet for LR1 lookahead and not Token
...
This way, instead of having:
X = A (*) B [c]
X = A (*) B [d]
you would have
X = A (*) B [c, d]
2016-06-01 05:03:56 -04:00
Niko Matsakis
0ff2b42f5c
switch TokenSet to use TLS to get terminals
...
hallelujah!
2016-06-01 04:58:38 -04:00
Niko Matsakis
e94d8c7331
Put terminals to in one struct and put it in TLS.
2016-06-01 04:58:38 -04:00
Niko Matsakis
a928c53f66
change to store reductions in a vector
2016-06-01 04:58:38 -04:00
Niko Matsakis
567e9687a1
fix small-conflict test
2016-06-01 04:58:38 -04:00
Niko Matsakis
f35691a6c1
add test for big lane table
2016-06-01 04:58:38 -04:00
Niko Matsakis
2f676abacd
pred -> succ, not vice versa :)
2016-06-01 04:58:38 -04:00
Niko Matsakis
e72378d2bc
shift conflicts do not need to be traced
2016-06-01 04:58:38 -04:00
Niko Matsakis
ed089c27fd
generalize interpreter to work for LR(0)
2016-06-01 04:58:38 -04:00
Niko Matsakis
b802906413
first basic test of lane table generation; seems to work
2016-06-01 04:58:38 -04:00
Niko Matsakis
d656a022fa
add can_shift_terminal helper
2016-06-01 04:58:38 -04:00
Niko Matsakis
41c270ce14
make stategraph generic over lookahead
2016-06-01 04:58:38 -04:00
Niko Matsakis
1871219032
some new multimap methods
2016-06-01 04:58:38 -04:00
Niko Matsakis
4424752f46
Extend Action::Shift
with the terminal being shifted, which is absent
...
in LR(0)
2016-06-01 04:58:38 -04:00
Niko Matsakis
9b42e78adc
add initial lane table types and infrastructure (no tests yet)
2016-06-01 04:58:38 -04:00
Niko Matsakis
7710a55947
add LR(0) variant of build
2016-06-01 04:56:41 -04:00
Niko Matsakis
0ca108c5d1
filter reduce examples by their lookahead
2016-06-01 04:53:47 -04:00
Niko Matsakis
3de4edd597
modify reduce to not consider lookahead
2016-06-01 04:53:47 -04:00
Niko Matsakis
c2be80e51c
refactor first into first0/first1
2016-06-01 04:53:47 -04:00
Niko Matsakis
61b2e52f51
refactor first
2016-06-01 04:53:47 -04:00
Niko Matsakis
fece7f5c5f
remove dead code from trace graph enumerator
2016-06-01 04:53:47 -04:00
Niko Matsakis
1742b18177
make state set construction generic over lookahead
2016-06-01 04:53:47 -04:00
Niko Matsakis
b7648bcd9e
separate shifts/reduces into distinct tables
2016-06-01 04:53:47 -04:00
Niko Matsakis
19a0852539
Make a trait for lookahead
2016-06-01 04:49:53 -04:00
Niko Matsakis
b0b7735bbc
Rename Lookahead
to Token
2016-06-01 04:48:16 -04:00
Niko Matsakis
568c2cf7be
make the core LR types generic over lookahead
2016-06-01 04:46:22 -04:00
Niko Matsakis
d34f87b339
Merge pull request #105 from nikomatsakis/pascal
...
Default actions for `()`, make fewer options in recursive ascent code
2016-04-20 04:26:32 -04:00
Niko Matsakis
948649f627
Merge pull request #108 from dflemstr/output-control
...
Input/output directory control
2016-04-20 04:26:08 -04:00
David Flemström
061a580569
Make lalrpop code gen respect configured dirs
2016-04-17 14:27:09 +02:00
David Flemström
b10b23f6d7
Make in/out dirs configurable
2016-04-17 13:41:30 +02:00
Niko Matsakis
f8471defdd
Merge pull request #106 from Nemikolh/fix-usage
...
Fix bug in USAGE and add regression tests.
2016-04-02 08:32:41 -04:00
Nemikolh
6056b9c8ff
Fix bug in USAGE and add regression tests.
2016-04-02 13:10:00 +01:00
Niko Matsakis
2db28a3650
add forgotten test for unit default actions
2016-03-22 04:45:45 -04:00
Niko Matsakis
0a577f46d4
update test output
2016-03-22 04:42:18 -04:00
Niko Matsakis
cea227af0c
modify ascent to avoid Option
when possible
...
Whereas before all data on the parser stack was always stored in an
`&mut Option<T>` slot, we know analyze whether the option is truly
needed. The idea is roughly this: for each state, we analyze its actions
to see what suffix of its stack it will *definitely* pop and which
suffix it *may* pop. This is basically the difference between the
largest and shortest prefixes.
2016-03-22 04:42:17 -04:00
Niko Matsakis
78779edfa9
add preliminary Pascal grammar and test harness
...
Caveats: requires uppercase keywords, cannot handle
comments, somewhat dated grammar
2016-03-22 04:42:17 -04:00
Niko Matsakis
d46f2b504b
Parse options properly
2016-03-22 04:42:17 -04:00
Niko Matsakis
7b4a4a870c
Synthesize default action of ()
if type is ()
2016-03-22 04:42:17 -04:00
Niko Matsakis
487004bddb
Merge pull request #103 from reuben/patch-1
...
Fix typo in report_error_suggest_inline
2016-03-14 05:48:34 -04:00
Reuben Morais
667f20cda2
Fix typo in report_error_suggest_inline
2016-03-13 14:32:21 -03:00
Niko Matsakis
bb5c741658
Merge pull request #102 from nikomatsakis/configuration
...
Introduce a `Configuration` builder for advanced usage
2016-03-07 09:25:48 -05:00