From e07d9dea344e79bfa90def98d965d422b288f600 Mon Sep 17 00:00:00 2001 From: aarne Date: Wed, 12 Apr 2006 21:14:32 +0000 Subject: unix command grammar started --- examples/unix/UnixEng.gf | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 examples/unix/UnixEng.gf (limited to 'examples/unix/UnixEng.gf') diff --git a/examples/unix/UnixEng.gf b/examples/unix/UnixEng.gf new file mode 100644 index 000000000..3bed08bc5 --- /dev/null +++ b/examples/unix/UnixEng.gf @@ -0,0 +1,30 @@ +--# -path=.:prelude + +concrete UnixEng of Unix = open Prelude in { + + flags unlexer=textlit ; lexer=textlit ; + +{- + lincat + Line ; + [Command] {1} ; + Command ; + File ; +-} + + lin + Pipe = infixSS "then" ; + Comm c = c ; + + WhatTime = ss ["what time is it"] ; + WhatDate = ss ["what date is it"] ; + WhereNow = ss ["where am I now"] ; + Remove = prefixSS "remove" ; + Copy x y = ss ("copy" ++ x.s ++ "to" ++ y.s) ; + Linecount = prefixSS ["how many lines has"] ; + Wordcount = prefixSS ["how many words has"] ; + + Name x = x ; + It = ss "it" ; + +} -- cgit v1.2.3