diff options
| author | aarne <aarne@cs.chalmers.se> | 2006-04-12 21:14:32 +0000 |
|---|---|---|
| committer | aarne <aarne@cs.chalmers.se> | 2006-04-12 21:14:32 +0000 |
| commit | e07d9dea344e79bfa90def98d965d422b288f600 (patch) | |
| tree | 61a8b0c4304bca3dc82157197b660b347f3e8953 /examples/unix/UnixUni.gf | |
| parent | a42a232c5756593e0681598f940c84f555af09d8 (diff) | |
unix command grammar started
Diffstat (limited to 'examples/unix/UnixUni.gf')
| -rw-r--r-- | examples/unix/UnixUni.gf | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/examples/unix/UnixUni.gf b/examples/unix/UnixUni.gf new file mode 100644 index 000000000..e0898853f --- /dev/null +++ b/examples/unix/UnixUni.gf @@ -0,0 +1,30 @@ +--# -path=.:prelude + +concrete UnixUni of Unix = open Prelude in { + + flags unlexer=codelit ; lexer=codelit ; + +{- + lincat + Line ; + [Command] {1} ; + Command ; + File ; +-} + + lin + Pipe = infixSS "|" ; + Comm c = c ; + + WhatTime = ss ["date +%D"] ; + WhatDate = ss ["date +%T"] ; + WhereNow = ss ["pwd"] ; + Remove = prefixSS "rm" ; + Copy x y = ss ("cp" ++ x.s ++ y.s) ; + Linecount = prefixSS ["wc -l"] ; + Wordcount = prefixSS ["wc -w"] ; + + Name x = x ; + It = ss [] ; + +} |
