summaryrefslogtreecommitdiff
path: root/src/GF/Command/GFShell.cf
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2007-11-03 22:00:08 +0000
committeraarne <aarne@cs.chalmers.se>2007-11-03 22:00:08 +0000
commit5956ba6b38f56c4aa41f7216f7dabade368bb2f2 (patch)
tree991102baba1f7b26e258c7b0965362a0e99ad980 /src/GF/Command/GFShell.cf
parented4b43961deb37ee2592e60db0c182c7efa5528f (diff)
command language and gfcc term parser in bnfc
Diffstat (limited to 'src/GF/Command/GFShell.cf')
-rw-r--r--src/GF/Command/GFShell.cf27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/GF/Command/GFShell.cf b/src/GF/Command/GFShell.cf
new file mode 100644
index 000000000..1f5a9fa6d
--- /dev/null
+++ b/src/GF/Command/GFShell.cf
@@ -0,0 +1,27 @@
+--entrypoints CommandLine, Tree ;
+
+CLine. CommandLine ::= [Pipe] ;
+CEmpty. CommandLine ::= ;
+PComm. Pipe ::= [Command] ;
+Comm. Command ::= Ident [Option] Argument ;
+CNoarg. Command ::= Ident [Option] ;
+OOpt. Option ::= "-" Ident ;
+OFlag. Option ::= "-" Ident "=" Value ;
+VId. Value ::= Ident ;
+VInt. Value ::= Integer ;
+ATree. Argument ::= Tree ;
+
+TApp. Tree1 ::= Ident [Tree2] ;
+TAbs. Tree ::= "\\" [Ident] "->" Tree ;
+TId. Tree2 ::= Ident ;
+TInt. Tree2 ::= Integer ;
+TStr. Tree2 ::= String ;
+TFloat. Tree2 ::= Double ;
+
+coercions Tree 2 ;
+
+separator nonempty Pipe ";" ;
+separator nonempty Command "|" ;
+terminator Option "" ;
+terminator nonempty Tree2 "" ;
+terminator nonempty Ident "," ;