X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=tests%2Ffleet.g;h=4677496cfa39e7adec1208ba4ff991110db26fe8;hb=61446887e40e11e0a7374e591e6d6c25c922093f;hp=bf136c6b0caa27e473fb3c169a025ffc6f5cfbb4;hpb=030b03c9ed2473205fe5a9b42f2aaa3021fa2c25;p=sbp.git diff --git a/tests/fleet.g b/tests/fleet.g index bf136c6..4677496 100644 --- a/tests/fleet.g +++ b/tests/fleet.g @@ -1,43 +1,43 @@ -// // 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" +Comment ! = "//" ~[\n]* "\n" | "/*" ~[\n]* "*/" -ws ::= w** -w ::= [\r\n ] +ws = w** +w = [\r\n ] | Comment -Statement ::= Move ";"? /ws +Program = Statement+ /ws + +Statement = Move ";"? /ws | "{" Statement* "}" | Port "RENAMES" Port "ENDRENAME" ";" /ws +// | "#define" Port Port /ws -Move ::= Source ^"->" Destination /ws - | Destination ^":=" Source /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 -location ::= 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]+