summaryrefslogtreecommitdiff
path: root/examples/unix/UnixEng.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/UnixEng.gf
parent47dedcf256976495f405a802920fa3012f683a52 (diff)
extended unix grammars with character-based spelling
Diffstat (limited to 'examples/unix/UnixEng.gf')
-rw-r--r--examples/unix/UnixEng.gf19
1 files changed, 16 insertions, 3 deletions
diff --git a/examples/unix/UnixEng.gf b/examples/unix/UnixEng.gf
index 3bed08bc5..5b0ca944f 100644
--- a/examples/unix/UnixEng.gf
+++ b/examples/unix/UnixEng.gf
@@ -1,8 +1,8 @@
--# -path=.:prelude
-concrete UnixEng of Unix = open Prelude in {
+concrete UnixEng of Unix = CharEng ** open Prelude in {
- flags unlexer=textlit ; lexer=textlit ;
+ flags lexer=text ;
{-
lincat
@@ -13,6 +13,9 @@ concrete UnixEng of Unix = open Prelude in {
-}
lin
+ CommWords w = w ;
+
+ Redirect = infixSS (optStr "and" ++ ["write the result to"]) ;
Pipe = infixSS "then" ;
Comm c = c ;
@@ -23,8 +26,18 @@ concrete UnixEng of Unix = open Prelude in {
Copy x y = ss ("copy" ++ x.s ++ "to" ++ y.s) ;
Linecount = prefixSS ["how many lines has"] ;
Wordcount = prefixSS ["how many words has"] ;
+ Grep x y = ss (["show the lines containing"] ++ x.s ++ "in" ++ y.s) ;
+ Cat = prefixSS ["show the contents of"] ;
- Name x = x ;
It = ss "it" ;
+ FileChars = prefixSS (optStr ["the file"]) ;
+ WordChars = prefixSS (optStr ["the word"]) ;
+
+ FileSuffix = prefixSS ["all files ending with"] ;
+ FilePrefix = prefixSS ["all files beginning with"] ;
+
+ BaseWord w = w ;
+ ConsWord = infixSS "space" ;
+
}