Commit Graph

3388 Commits (d823c4a287bf5879b27fc1438fd8abea45c36f87)

Author SHA1 Message Date
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
Daniel Ehrenberg 21ad2dace2 Merge branch 'master' of git://double.co.nz/git/factor 2008-03-19 23:08:23 -04:00
Chris Double 7dc772db26 Refactor ebnf parser generation 2008-03-20 16:05:10 +13:00
Slava Pestov e9d7e2523c Clean up random and fix circular 2008-03-19 21:48:29 -05:00
Slava Pestov 0d9947198c Bootstrap fixes 2008-03-19 21:41:39 -05:00
Slava Pestov 4675811d68 Merge branch 'master' of git://factorcode.org/git/factor 2008-03-19 21:26:13 -05:00
Slava Pestov 27e87292f0 Add [let* syntax 2008-03-19 21:16:09 -05:00
Doug Coleman 6f2369b16e add code to bootstrap.syntax 2008-03-19 21:15:38 -05:00
Chris Double c1f69f01be Change ordering of [[ ... ]] 2008-03-20 14:57:12 +13:00
Chris Double 39c228db6d Update peg.pl0 to use range pattern syntax
This allows removing the words for ident and number, replacing them
with EBNF expressions.
2008-03-20 14:22:14 +13:00
Chris Double 68388fbed9 Updated peg.expr to use range-pattern for digits 2008-03-20 14:15:06 +13:00
Chris Double ec4f964e4f Fix pl0 for EBNF syntax changes 2008-03-20 14:06:21 +13:00
Chris Double 795ef0ae3b Add ranges to EBNF syntax
This works:
  <EBNF letter = [a-zA-Z] EBNF>
and
  <EBNF not-digit = [^0-9] EBNF>
2008-03-20 13:55:19 +13:00
Chris Double 264284d0c4 Add range-pattern parser 2008-03-20 13:40:22 +13:00
Doug Coleman f5e678c380 work on gmt-offset on windows 2008-03-19 19:37:04 -05:00
Doug Coleman d0b348591a path+, prepend 2008-03-19 19:15:43 -05:00
Doug Coleman 3e7940216e swap append to swap append
refactoring path+ to append-path
swap path+ to prepend-path
calendar gmt-offset to duration
2008-03-19 19:15:32 -05:00
Doug Coleman 1802e7c443 add random bootstrap 2008-03-19 16:22:06 -05:00
Doug Coleman 3e14b0fac0 Merge branch 'master' of git://factorcode.org/git/factor 2008-03-19 16:21:17 -05:00
Doug Coleman 077df62492 add 2bi* 2008-03-19 16:20:14 -05:00
Doug Coleman 274c7d8cad 256 random-bits 2008-03-19 16:19:54 -05:00
Doug Coleman cd4f2028cd random-256 -> 256 random-bits 2008-03-19 16:19:37 -05:00
Doug Coleman 9c74ba2f2f remove extra crypto file 2008-03-19 16:19:15 -05:00
Doug Coleman 5296c907d9 remove random-bits 2008-03-19 16:19:00 -05:00
Doug Coleman b3527a17df redo random/ 2008-03-19 16:18:03 -05:00
Doug Coleman 40aab45282 add do-while and use it in generate 2008-03-19 16:16:35 -05:00
Slava Pestov 5904d3fffa Fix set-timeout with dan's new encoding stuff 2008-03-19 15:24:49 -05:00
Slava Pestov 30171f41df Merge branch 'master' of git://factorcode.org/git/factor 2008-03-19 14:53:41 -05:00
Slava Pestov f78b626b58 Merge branch 'master' of git://factorcode.org/git/factor 2008-03-19 14:40:09 -05:00
Slava Pestov 3591ed402d Simplify vocab.loader even further 2008-03-19 14:39:08 -05:00
Slava Pestov 005de25156 Cocoa UI cleanup 2008-03-19 14:25:53 -05:00
Slava Pestov ea7301062d Merge git://double.co.nz/git/factor 2008-03-19 14:18:26 -05:00
Slava Pestov 3d43c0350e Fix USING: in alien.factor 2008-03-19 13:26:39 -05:00
Slava Pestov e826f1fe4a Merge branch 'master' of git://factorcode.org/git/littledan 2008-03-19 13:23:55 -05:00
Slava Pestov 8f521b07f2 Merge branch 'master' of git://pgdn.org/factor 2008-03-19 13:20:36 -05:00
Chris Double 97b58580a7 Add expression evaluator example for EBNF 2008-03-20 03:30:53 +13:00
Chris Double 92d8140d87 Change ebnf-action to properly nest with attached parser
This allows removal of last-parser hack. Syntax of EBNF changes though.
Now an action must attach to a group:

  <EBNF foo = (a b c) [[ ...act on group... ]] EBNF>
2008-03-20 03:05:40 +13:00
Chris Double 65fabeec11 remove => action and replace it with [[ code ]] in EBNF
Previously the action had to be a factor word and could only appear at the end of a rule:

  : aword ( ast -- ast ) drop V{ 1 2 } ;
  <EBNF foo = "a" "b" => aword EBNF>

Now actions can appear anywhere after an element, and can be any factor code between [[ ... ]] delimiters:

  <EBNF foo = "a" "b" [[ drop V{ 1 2 } ]] EBNF>
  <EBNF foo = "a" [[ drop 1 ]] "b" [[ drop 2 ]] EBNF>

Unfortunately since this means the ebnf>quot code uses the equivalent of eval, it no longer compiles nicely since it can't be inferred. The generated parsers however do compile.
2008-03-20 02:16:30 +13:00
Chris Double c0b7bdf823 Add *, + and ? to list of non-allowed ebnf identifier characteres 2008-03-20 01:25:57 +13:00
Chris Double 82d54d3776 EBNF syntax change
[ ... ] is now ( ... )?
{ ... } is now ( ... )*
Added ( ... )+
2008-03-20 01:18:09 +13:00
Slava Pestov 36c94f357c Fix shaker's libc stripping 2008-03-19 02:43:36 -05:00
Slava Pestov de4b699d98 Documentation update 2008-03-19 02:43:23 -05:00
Chris Double 64135b73e1 Add support for ensure-not and parsing any single character to EBNF
This allows, for example:
  foo = {!("_" | "-") .}

This will match zero or more of any character, except for _ or -
2008-03-19 19:15:52 +13:00
Joe Groff 11d28109cf Merge branch 'master' of git://factorcode.org/git/factor 2008-03-18 23:02:44 -07:00
Joe Groff 46c21e2580 Correct perms on windows/ tree 2008-03-18 23:02:21 -07:00
Joe Groff ede3e068a0 Get COM interface working. Add IShellFolder interface to shell32.dll to play around with 2008-03-18 22:56:54 -07:00
Chris Double 208c88c449 Update pl0 for ebnf changes, and add more tests 2008-03-19 18:35:45 +13:00
Chris Double eef6ae7827 Remove need for '.' to terminate rule lines in EBNF 2008-03-19 18:07:31 +13:00
Chris Double 9403d97e22 Add syntax-pack and grouped to ebnf refactoring 2008-03-19 17:52:22 +13:00
Chris Double 708d55fb8e Add syntax word for ebnf 2008-03-19 17:37:08 +13:00