summaryrefslogtreecommitdiff
path: root/examples/unix/Unix.gf
blob: ea5e2c2af52fdeeff22eb683ba2ef3cfc6127eea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
abstract Unix = Char ** {

  cat
    S ;           -- whole command line
    Command ;     -- one command
    File ;        -- file name
    Word ;        -- string e.g. in grep
    [Word] {1} ;  -- 

  fun

-- Catch-all: command dictated letter by letter.

    CommWords : [Word] -> Command ;

-- General command-line structure.

    Redirect : S -> File -> S ;     -- cs >f
    Pipe     : S -> Command -> S ;  -- cs | c
    Comm     : Command -> S ;       -- c

--- This would be cool, but is it supported by speech recognition?
---    CommOpt  : (c : Command) -> [Option c] -> S ;       -- c -o -k

    WhatTime   : Command ;
    WhatDate   : Command ;
    WhereNow   : Command ;
    Remove     : File -> Command ;
    Copy       : File -> File -> Command ;
    Linecount  : File -> Command ;
    Wordcount  : File -> Command ;
    Grep       : Word -> File -> Command ;
    Cat        : File -> Command ;

    It : File ;                  -- no file name - contents received from pipe

    FileChars : [Chr] -> File ;
    WordChars : [Chr] -> Word ;

    FileSuffix : Word -> File ;  -- *suff
    FilePrefix : Word -> File ;  -- pref*

}