mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-22 03:09:33 -06:00
command language and gfcc term parser in bnfc
This commit is contained in:
27
src/GF/Command/GFShell.cf
Normal file
27
src/GF/Command/GFShell.cf
Normal 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 "," ;
|
||||
Reference in New Issue
Block a user