]> gitweb.factorcode.org Git - factor.git/blob - unmaintained/modules/using/using.factor
tools.test: Make the flag public. Finish porting tester changes to fuzzer.
[factor.git] / unmaintained / modules / using / using.factor
1 ! Copyright (C) 2009 Sam Anklesaria.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: kernel modules.rpc peg peg-lexer peg.ebnf sequences
4 strings vocabs.parser ;
5 IN: modules.using
6
7 EBNF: modulize
8 tokenpart = (!(':').)+ => [[ >string ]]
9 s = ':' => [[ drop ignore ]]
10 rpc = tokenpart s s tokenpart => [[ first2 remote-vocab ]]
11 remote = tokenpart s tokenpart => [[ first2 remote-load ]]
12 module = rpc | remote | tokenpart
13 ;EBNF
14
15 ON-BNF: USING*:
16 tokenizer = <foreign factor>
17 sym = !(";"|"}"|"=>"|"EXCEPT").
18 modspec = sym => [[ modulize ]]
19 qualified-with = modspec sym => [[ first2 add-qualified ignore ]]
20 qualified = modspec => [[ dup add-qualified ignore ]]
21 from = modspec "=>" sym+ => [[ first3 nip add-words-from ignore ]]
22 exclude = modspec "EXCEPT" sym+ => [[ first3 nip add-words-excluding ignore ]]
23 rename = modspec sym "=>" sym => [[ first4 nip swapd add-renamed-word ignore ]]
24 long = "{" ( from | exclude | rename | qualified-with | qualified ) "}" => [[ drop ignore ]]
25 short = modspec => [[ use-vocab ignore ]]
26 wordSpec = long | short
27 using = wordSpec+ ";" => [[ drop ignore ]]
28 ;ON-BNF