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/UnixUni.gf | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'examples/unix/UnixUni.gf') diff --git a/examples/unix/UnixUni.gf b/examples/unix/UnixUni.gf index e0898853f..b1b220824 100644 --- a/examples/unix/UnixUni.gf +++ b/examples/unix/UnixUni.gf @@ -1,8 +1,8 @@ --# -path=.:prelude -concrete UnixUni of Unix = open Prelude in { +concrete UnixUni of Unix = CharUni ** open Prelude in { - flags unlexer=codelit ; lexer=codelit ; + flags unlexer=bind ; {- lincat @@ -13,6 +13,9 @@ concrete UnixUni of Unix = open Prelude in { -} lin + CommWords w = w ; + + Redirect = infixSS ">" ; Pipe = infixSS "|" ; Comm c = c ; @@ -23,8 +26,18 @@ concrete UnixUni of Unix = open Prelude in { Copy x y = ss ("cp" ++ x.s ++ y.s) ; Linecount = prefixSS ["wc -l"] ; Wordcount = prefixSS ["wc -w"] ; + Grep x y = ss ("grep" ++ x.s ++ y.s) ; + Cat = prefixSS "cat" ; - Name x = x ; It = ss [] ; + FileChars c = c ; + WordChars c = c ; + + FileSuffix = prefixSS ["* &+"] ; + FilePrefix = postfixSS ["&+ *"] ; + + BaseWord w = w ; + ConsWord = cc2 ; + } -- cgit v1.2.3