command language and gfcc term parser in bnfc

This commit is contained in:
aarne
2007-11-03 22:00:08 +00:00
parent ed4b43961d
commit 5956ba6b38
9 changed files with 1424 additions and 3 deletions

27
src/GF/Command/GFShell.cf Normal file
View File

@@ -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 "," ;