X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=tests%2Ffleet.g;h=4677496cfa39e7adec1208ba4ff991110db26fe8;hp=4d66b4dca16ac8b22dab9bfefe8689695aeef506;hb=86e7e1298601b60df964e3c0a71f3fe3cca230b8;hpb=5964a1161340a16d7dea471372737f2474576ceb diff --git a/tests/fleet.g b/tests/fleet.g index 4d66b4d..4677496 100644 --- a/tests/fleet.g +++ b/tests/fleet.g @@ -8,36 +8,36 @@ // the grammar. An equivalent lex+yacc grammar and support code would // be several times as long. -Comment !::= "//" ~[\n]* "\n" +Comment ! = "//" ~[\n]* "\n" | "/*" ~[\n]* "*/" -ws ::= w** -w ::= [\r\n ] +ws = w** +w = [\r\n ] | Comment -Program ::= Statement+ /ws +Program = Statement+ /ws -Statement ::= Move ";"? /ws +Statement = Move ";"? /ws | "{" Statement* "}" | Port "RENAMES" Port "ENDRENAME" ";" /ws // | "#define" Port Port /ws -Move ::= Source ^"->" Destination /ws +Move = Source ^"->" Destination /ws | Source ^"=>" Destination /ws | Destination ^":=" Source /ws -Destination ::= Port +/ (ws "," ws) -Source ::= Port +Destination = Port +/ (ws "," ws) +Source = Port | CodeBag -CodeBag ::= CodeBagName? "{" Statement* "}" ";"? /ws +CodeBag = CodeBagName? "{" Statement* "}" ";"? /ws // Note: this deviates from ies06 -Port ::= shipname ("." portname)* -shipname ::= name index? -portname ::= name index? -name ::= [A-Za-z] [A-Za-z0-9\[\]\.]* -index ::= "[" [0-9]+ "]" +Port = shipname ("." portname)* +shipname = name index? +portname = name index? +name = [A-Za-z] [A-Za-z0-9\[\]\.]* +index = "[" [0-9]+ "]" | [0-9]+