From: adam Date: Sun, 4 Mar 2007 11:52:08 +0000 (+0100) Subject: fix grammar ambiguity X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=9b69470074d4b8ac102c78572855ea072cae08ed;p=fleet.git fix grammar ambiguity --- diff --git a/src/edu/berkeley/fleet/assembler/fleet.g b/src/edu/berkeley/fleet/assembler/fleet.g index 8262356..1d0041b 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\r]* [\r\n]! - | "/*" ~[\n\r]* "*/" +Comment = "//" (~[\n\r])* [\r\n]! + | "/*" (~[\n\r])* "*/" ws = ([\r\n ] | Comment)* -> ~[\r\n ] s = ws! Program ws! @@ -56,7 +56,7 @@ portname = Name:: [a-z] [A-Za-z0-9\[\]_]** name = Name:: [A-Za-z] [A-Za-z0-9\[\]_]** index = "[" [0-9]+ "]" | [0-9]+ int = [\-0-9]++ -ShipSpecific = ShipSpecific:: "\"" ~[\"]++ "\"" +ShipSpecific = ShipSpecific:: "\"" (~[\"])++ "\"" // the following are not part of the official FLEET syntax and are // specific to Adam's interpreter.