From: adam Date: Sat, 3 Feb 2007 06:59:10 +0000 (+0100) Subject: fixes to grammar file X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=9ebd649e188071fc4202b4f25782f58e63890dc0;p=fleet.git fixes to grammar file --- diff --git a/src/edu/berkeley/fleet/assembler/fleet.g b/src/edu/berkeley/fleet/assembler/fleet.g index cf1f9ef..dc36134 100644 --- a/src/edu/berkeley/fleet/assembler/fleet.g +++ b/src/edu/berkeley/fleet/assembler/fleet.g @@ -5,8 +5,8 @@ // the grammar. An equivalent lex+yacc grammar and support code would // be several times as long. -Comment = "//" ~[\n]* "\n" - | "/*" ~[\n]* "*/" +Comment = "//" ~[\n\r]* [\r\n]! + | "/*" ~[\n\r]* "*/" ws = ([\r\n ] | Comment)* -> ~[\r\n ] s = ws! Program ws! @@ -17,7 +17,9 @@ Statement = Fiber:: Source ":" (Instruction +/ ws) /ws | Literal:: int ":" "sendto" Port ";" /ws | NamedCodeBag:: name ":" "{" CodeBagBody "}" /ws -Instruction = Instruction:: (Brack:: "[" (int|(Star::"*"))? ("r")? "]" ws!)? (Command +/ (ws! "," ws!) ws! ";"!) +Instruction = Instruction:: + (Brack:: "[" (int|(Star::"*"))? ("r")? "]" ws!)? + (Command +/ (ws! "," ws!) ws! ";"!) Command = Nop:: "nop" | Kill:: "kill" | Wait:: "wait"