From 8edb88dcabe9d5a23c6efcedcd056cd16194f4a4 Mon Sep 17 00:00:00 2001 From: aarne Date: Thu, 13 Apr 2006 14:19:27 +0000 Subject: extended unix grammars with character-based spelling --- examples/unix/UnixEng.gf | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'examples/unix/UnixEng.gf') 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" ; + } -- cgit v1.2.3