X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=tests%2Ffleet.g;fp=tests%2Ffleet.g;h=0000000000000000000000000000000000000000;hp=965a71279e4e8b7126195551616d0b361978d9ba;hb=3094f58635dc32e4f0ba3922a0ce2f13267ea06e;hpb=5eea0a7ad35fb17a5b7203fa40119ad5cab01ec0 diff --git a/tests/fleet.g b/tests/fleet.g deleted file mode 100644 index 965a712..0000000 --- a/tests/fleet.g +++ /dev/null @@ -1,55 +0,0 @@ -// The FLEET Assembly Language Grammar -// As specified in document 2005-ucies06 - -// comments are included where the grammar had to go beyond the strict -// "letter of the law" in ies06 - -// Note that this is the *entire, complete* formal specification of -// the grammar. An equivalent lex+yacc grammar and support code would -// be several times as long. - -Comment = "//" ~[\n]* "\n" - | "/*" ~[\n]* "*/" - -w = [\r\n ]* -ws = (w | Comment)* -> ~[\r\n ] - -s = ws! Program ws! -Program = Program:: - (Directive ws!)* - CodeBagBody - -Directive = Memory:: "#memory" "{" (int +/ (ws! "," ws!)) "}" /ws - | Import:: "#import" [A-Za-z_.]++ /ws - | Ship:: "#ship" shipname ":" [A-Za-z_\.]++ /ws - - -Statement = Move ((ws ";")?)! - | CodeBag -// | ^"#define" Port Port /ws - -Move = Source ^"->" Destination /ws - | Source ^"->*" Destination /ws - | Port ^":=" Source /ws - -Destination = Port +/ (ws! "," ws!) -Source = Port - | CodeBag -CodeBagBody = CodeBag:: (Statement +/ ws) -CodeBag = NamedCodeBag:: - name:(name ws! ":" ws!)? - "{" - ws! statements:(Statement +/ ws) ws! - "}" - (ws! ";")?! - -//Port = Port:: shipname ("." portname)* -Port = Port:: shipname "." portname - | Port:: shipname -shipname = ShipName:: name (index?) -portname = PortName:: name (index?) -name = [A-Za-z0-9\[\]]** -index = "[" [0-9]+ "]" - | [0-9]+ -int = [0-9]++ -