summaryrefslogtreecommitdiff
path: root/examples/unix/Unix.gf
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2006-04-13 14:19:27 +0000
committeraarne <aarne@cs.chalmers.se>2006-04-13 14:19:27 +0000
commit8edb88dcabe9d5a23c6efcedcd056cd16194f4a4 (patch)
tree501f8408b8f0b76a5fd5d5f058da7b305dfbe395 /examples/unix/Unix.gf
parent47dedcf256976495f405a802920fa3012f683a52 (diff)
extended unix grammars with character-based spelling
Diffstat (limited to 'examples/unix/Unix.gf')
-rw-r--r--examples/unix/Unix.gf45
1 files changed, 32 insertions, 13 deletions
diff --git a/examples/unix/Unix.gf b/examples/unix/Unix.gf
index c1ddd742b..ea5e2c2af 100644
--- a/examples/unix/Unix.gf
+++ b/examples/unix/Unix.gf
@@ -1,24 +1,43 @@
-abstract Unix = {
+abstract Unix = Char ** {
cat
- S ;
- Line ;
- Command ;
- File ;
+ S ; -- whole command line
+ Command ; -- one command
+ File ; -- file name
+ Word ; -- string e.g. in grep
+ [Word] {1} ; --
fun
- Pipe : Command -> S -> S ;
- Comm : Command -> S ;
+
+-- 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 ;
+ 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 ;
- Name : String -> File ;
- It : File ;
+ FileSuffix : Word -> File ; -- *suff
+ FilePrefix : Word -> File ; -- pref*
}