Slava Pestov
c22af5c7a6
Rename 2apply to bi@
2008-03-29 20:36:58 -05:00
Chris Double
691d26068d
Refactor peg compiler cache
...
Instead of a cache stored in a global variable, the compiled parser is stored in a slot in the parser delegate.
2008-03-30 14:00:45 +13:00
Slava Pestov
2aafe074b2
Merge branch 'master' of git://double.co.nz/git/factor
2008-03-29 00:38:31 -05:00
Chris Double
ca4f775756
Fix PEG:
2008-03-29 18:33:37 +13:00
Chris Double
8105e66aec
Add box parser to docs
2008-03-29 17:45:21 +13:00
Chris Double
86653e7a46
Don't use 'delay' parser in ebnf
2008-03-29 17:42:21 +13:00
Slava Pestov
2c3c66c6af
Update peg for words being moved
2008-03-28 23:37:52 -05:00
Chris Double
0db0d9cd44
Move towards having ebnf infer
2008-03-29 16:24:13 +13:00
Chris Double
5f37b4fc72
compiled pegs infer
2008-03-29 16:11:08 +13:00
Chris Double
7bf27a5eb2
EBNF test using Java Primary production
2008-03-29 03:41:40 +13:00
Chris Double
25eea7ea1b
Fix ebnf tests for left recursion
2008-03-29 02:51:49 +13:00
Chris Double
261539a86a
Unit test for left recursive grammar
2008-03-29 02:47:03 +13:00
Chris Double
dd979c8b3b
Indirect Left recursive grammars working
2008-03-29 02:45:21 +13:00
Chris Double
68cbdf76aa
Handle direct left recusion
2008-03-29 01:17:54 +13:00
Chris Double
010ce80076
Handle left recursion by failing again
2008-03-29 00:49:39 +13:00
Chris Double
cca4700e49
Fix ebnf for peg changes
2008-03-29 00:41:41 +13:00
Chris Double
4b353c7529
Rewrite peg internals
2008-03-29 00:37:40 +13:00
Chris Double
1d87e513f5
lr2 wip
2008-03-28 21:17:08 +13:00
Chris Double
d2190fd1ec
Direct left recurson working
2008-03-28 14:30:10 +13:00
Chris Double
749f10ba9f
Implement direct left recursion
...
As per VPRI Technical Report TR-2007-002 section 3.2
2008-03-28 14:30:10 +13:00
Chris Double
f596aa2d71
Handle compilation of circular parsers
2008-03-28 14:26:05 +13:00
Chris Double
f96a251f8a
Refactor pegs to remove MEMO: and use unique id's
2008-03-28 12:35:47 +13:00
Chris Double
89c7698738
Fix MEMO problem with seq* and choice*
2008-03-28 11:30:46 +13:00
Chris Double
fa8b311b27
Add packrat-parse, etc
2008-03-28 00:04:08 +13:00
Chris Double
f6b7f8197e
Add tests for left recusion in pegs
2008-03-27 23:54:34 +13:00
Chris Double
4e29081e93
Make left recursion in pegs a failed parse
...
Eventually left recursion will work fine, but this is prevents an infinite loop for now.
2008-03-27 18:15:22 +13:00
Chris Double
4c50daed22
Testcase for packrat behaviour
2008-03-27 17:58:08 +13:00
Chris Double
bc5f82255f
peg refactorings
2008-03-27 17:24:05 +13:00
Chris Double
708726d208
Add with-packrat word and more memoization
2008-03-27 15:50:27 +13:00
Chris Double
7c0535884e
Fix up peg memoization of compiled parsers
2008-03-27 15:34:49 +13:00
Chris Double
e6da3bc43a
Use cache in compiled-parser in peg
2008-03-27 14:55:14 +13:00
Chris Double
c0f4e37427
Fix usage of cache in pegs
2008-03-27 12:58:53 +13:00
Chris Double
2614792254
Implement packrat algorithm
2008-03-27 12:31:13 +13:00
Chris Double
c793a381fe
Add hook for packrat implementation
2008-03-27 11:24:06 +13:00
Chris Double
85a3ee3e5b
Remove memoization in 'compile' word in pegs
...
This creates issues when recompiling a an existing EBNF parser for reasons I've not yet tracked down. Disabling it slows things down but makes things work correctly till I investigate the issue.
2008-03-27 11:24:06 +13:00
Chris Double
de3e4e049f
Use cleave instead of get-slots in peg
2008-03-26 16:21:33 +13:00
Chris Double
1ec945ba4c
Use new slots in peg.ebnf
2008-03-26 16:16:23 +13:00
Chris Double
8569d18068
Use new slots in peg
2008-03-26 16:08:14 +13:00
Chris Double
b1561de0f6
Reduce amount of generated code for peg token parser
2008-03-26 15:40:17 +13:00
Chris Double
9b7246555a
Fix just parser in pegs
2008-03-26 15:26:54 +13:00
Chris Double
943b02ab2f
Fix performance regression in pegs
...
delay parser is improved to use a memoized quotation so the
construction and compilation of the parser at runtime only
occurs once.
Changed compile so it would use equality rather than identity
for memoization purposes.
2008-03-22 01:59:16 +13:00
Chris Double
d1e0aa6e80
Get peg subvocabs working again
2008-03-22 00:58:53 +13:00
Chris Double
a14854520d
Compile pegs down to words
2008-03-21 03:05:21 +13:00
Chris Double
1c6882b32c
Rip out packrat stuff
...
It was broken since the transition to generating compiled quotations. As far as I know, no one was using packrat-parse anyway.
Rework in progress...
2008-03-21 01:26:20 +13:00
Chris Double
d1e7ede35d
Add support for & syntax in ebnf
2008-03-20 17:25:27 +13:00
Chris Double
dbd0583044
Tidy up expr groups
2008-03-20 17:19:41 +13:00
Chris Double
8ade4f9b5b
Fix vocab name in expr tests
2008-03-20 17:16:50 +13:00
Chris Double
44954753bd
Change <EBNF .. EBNF> to [EBNF .. EBNF]
2008-03-20 17:13:27 +13:00
Chris Double
e7980ebc61
More refactoring of EBNF
...
<EBNF .. EBNF> now produces a quotation that when called does the parsing
EBNF: foo ... ;EBNF creates a 'foo' word with stack effect (string -- result)
when called it parses the string and returns the result.
2008-03-20 17:11:09 +13:00
Chris Double
7dc772db26
Refactor ebnf parser generation
2008-03-20 16:05:10 +13:00