summaryrefslogtreecommitdiff
path: root/Source/Dafny/Parser.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Dafny/Parser.cs')
-rw-r--r--Source/Dafny/Parser.cs1092
1 files changed, 560 insertions, 532 deletions
diff --git a/Source/Dafny/Parser.cs b/Source/Dafny/Parser.cs
index a4e51924..9ad05d3b 100644
--- a/Source/Dafny/Parser.cs
+++ b/Source/Dafny/Parser.cs
@@ -34,7 +34,7 @@ public class Parser {
public Token/*!*/ la; // lookahead token
int errDist = minErrDist;
-static List<ModuleDecl/*!*/> theModules;
+static ModuleDecl theModule;
static BuiltIns theBuiltIns;
static Expression/*!*/ dummyExpr = new LiteralExpr(Token.NoToken);
static FrameExpression/*!*/ dummyFrameExpr = new FrameExpression(dummyExpr, null);
@@ -48,51 +48,51 @@ struct MemberModifiers {
// helper routine for parsing call statements
///<summary>
/// Parses top-level things (modules, classes, datatypes, class members) from "filename"
-/// and appends them in appropriate form to "modules".
+/// and appends them in appropriate form to "module".
/// Returns the number of parsing errors encountered.
/// Note: first initialize the Scanner.
///</summary>
-public static int Parse (string/*!*/ filename, List<ModuleDecl/*!*/>/*!*/ modules, BuiltIns builtIns) /* throws System.IO.IOException */ {
+public static int Parse (string/*!*/ filename, ModuleDecl module, BuiltIns builtIns) /* throws System.IO.IOException */ {
Contract.Requires(filename != null);
- Contract.Requires(cce.NonNullElements(modules));
+ Contract.Requires(module != null);
string s;
if (filename == "stdin.dfy") {
s = Microsoft.Boogie.ParserHelper.Fill(System.Console.In, new List<string>());
- return Parse(s, filename, modules, builtIns);
+ return Parse(s, filename, module, builtIns);
} else {
using (System.IO.StreamReader reader = new System.IO.StreamReader(filename)) {
s = Microsoft.Boogie.ParserHelper.Fill(reader, new List<string>());
- return Parse(s, filename, modules, builtIns);
+ return Parse(s, filename, module, builtIns);
}
}
}
///<summary>
/// Parses top-level things (modules, classes, datatypes, class members)
-/// and appends them in appropriate form to "modules".
+/// and appends them in appropriate form to "module".
/// Returns the number of parsing errors encountered.
/// Note: first initialize the Scanner.
///</summary>
-public static int Parse (string/*!*/ s, string/*!*/ filename, List<ModuleDecl/*!*/>/*!*/ modules, BuiltIns builtIns) {
+public static int Parse (string/*!*/ s, string/*!*/ filename, ModuleDecl module, BuiltIns builtIns) {
Contract.Requires(s != null);
Contract.Requires(filename != null);
- Contract.Requires(cce.NonNullElements(modules));
+ Contract.Requires(module != null);
Errors errors = new Errors();
- return Parse(s, filename, modules, builtIns, errors);
+ return Parse(s, filename, module, builtIns, errors);
}
///<summary>
/// Parses top-level things (modules, classes, datatypes, class members)
-/// and appends them in appropriate form to "modules".
+/// and appends them in appropriate form to "module".
/// Returns the number of parsing errors encountered.
/// Note: first initialize the Scanner with the given Errors sink.
///</summary>
-public static int Parse (string/*!*/ s, string/*!*/ filename, List<ModuleDecl/*!*/>/*!*/ modules, BuiltIns builtIns,
+public static int Parse (string/*!*/ s, string/*!*/ filename, ModuleDecl module, BuiltIns builtIns,
Errors/*!*/ errors) {
Contract.Requires(s != null);
Contract.Requires(filename != null);
- Contract.Requires(cce.NonNullElements(modules));
+ Contract.Requires(module != null);
Contract.Requires(errors != null);
- List<ModuleDecl/*!*/> oldModules = theModules;
- theModules = modules;
+ var oldModule = theModule;
+ theModule = module;
BuiltIns oldBuiltIns = builtIns;
theBuiltIns = builtIns;
byte[]/*!*/ buffer = cce.NonNull( UTF8Encoding.Default.GetBytes(s));
@@ -100,7 +100,7 @@ public static int Parse (string/*!*/ s, string/*!*/ filename, List<ModuleDecl/*!
Scanner scanner = new Scanner(ms, errors, filename);
Parser parser = new Parser(scanner, errors);
parser.Parse();
- theModules = oldModules;
+ theModule = oldModule;
theBuiltIns = oldBuiltIns;
return parser.errors.count;
}
@@ -181,22 +181,12 @@ bool IsAttribute() {
void Dafny() {
ClassDecl/*!*/ c; DatatypeDecl/*!*/ dt; ArbitraryTypeDecl at;
- Attributes attrs; IToken/*!*/ id; List<string/*!*/> theImports;
List<MemberDecl/*!*/> membersDefaultClass = new List<MemberDecl/*!*/>();
- List<MemberDecl/*!*/> namedModuleDefaultClassMembers;
- ModuleDecl module;
- // to support multiple files, create a default module only if theModules doesn't already contain one
- DefaultModuleDecl defaultModule = null;
- foreach (ModuleDecl mdecl in theModules) {
- defaultModule = mdecl as DefaultModuleDecl;
- if (defaultModule != null) { break; }
- }
- bool defaultModuleCreatedHere = false;
- if (defaultModule == null) {
- defaultModuleCreatedHere = true;
- defaultModule = new DefaultModuleDecl();
- }
- IToken idRefined;
+ ModuleDecl submodule;
+ // to support multiple files, create a default module only if theModule is null
+ DefaultModuleDecl defaultModule = (DefaultModuleDecl)((LiteralModuleDecl)theModule).ModuleDef;
+ // theModule should be a DefaultModuleDecl (actually, the singular DefaultModuleDecl)
+ Contract.Assert(defaultModule != null);
bool isGhost;
while (StartOf(1)) {
@@ -206,101 +196,105 @@ bool IsAttribute() {
isGhost = true;
}
if (la.kind == 9) {
- Get();
- attrs = null; idRefined = null; theImports = new List<string/*!*/>();
- namedModuleDefaultClassMembers = new List<MemberDecl>();
-
- while (la.kind == 6) {
- Attribute(ref attrs);
- }
- Ident(out id);
- defaultModule.ImportNames.Add(id.val);
- if (la.kind == 10) {
- Get();
- Ident(out idRefined);
- }
- if (la.kind == 11) {
- Get();
- Idents(theImports);
- }
- module = new ModuleDecl(id, id.val, isGhost, idRefined == null ? null : idRefined.val, theImports, attrs);
- Expect(6);
- module.BodyStartTok = t;
- while (StartOf(2)) {
- if (la.kind == 12) {
- ClassDecl(module, out c);
- module.TopLevelDecls.Add(c);
- } else if (la.kind == 14 || la.kind == 15) {
- DatatypeDecl(module, out dt);
- module.TopLevelDecls.Add(dt);
- } else if (la.kind == 21) {
- ArbitraryTypeDecl(module, out at);
- module.TopLevelDecls.Add(at);
- } else {
- ClassMemberDecl(namedModuleDefaultClassMembers, false, false);
- }
- }
- Expect(7);
- module.BodyEndTok = t;
- module.TopLevelDecls.Add(new DefaultClassDecl(module, namedModuleDefaultClassMembers));
- theModules.Add(module);
- } else if (la.kind == 12) {
+ SubModuleDecl(defaultModule, isGhost, out submodule);
+ defaultModule.TopLevelDecls.Add(submodule);
+ } else if (la.kind == 15) {
if (isGhost) { SemErr(t, "a class is not allowed to be declared as 'ghost'"); }
ClassDecl(defaultModule, out c);
defaultModule.TopLevelDecls.Add(c);
- } else if (la.kind == 14 || la.kind == 15) {
+ } else if (la.kind == 17 || la.kind == 18) {
if (isGhost) { SemErr(t, "a datatype/codatatype is not allowed to be declared as 'ghost'"); }
DatatypeDecl(defaultModule, out dt);
defaultModule.TopLevelDecls.Add(dt);
- } else if (la.kind == 21) {
+ } else if (la.kind == 22) {
if (isGhost) { SemErr(t, "a type is not allowed to be declared as 'ghost'"); }
ArbitraryTypeDecl(defaultModule, out at);
defaultModule.TopLevelDecls.Add(at);
- } else if (StartOf(3)) {
+ } else if (StartOf(2)) {
ClassMemberDecl(membersDefaultClass, isGhost, false);
} else SynErr(108);
}
- if (defaultModuleCreatedHere) {
- defaultModule.TopLevelDecls.Add(new DefaultClassDecl(defaultModule, membersDefaultClass));
- theModules.Add(defaultModule);
- } else {
- // find the default class in the default module, then append membersDefaultClass to its member list
- foreach (TopLevelDecl topleveldecl in defaultModule.TopLevelDecls) {
- DefaultClassDecl defaultClass = topleveldecl as DefaultClassDecl;
- if (defaultClass != null) {
- defaultClass.Members.AddRange(membersDefaultClass);
- break;
- }
+ DefaultClassDecl defaultClass = null;
+ foreach (TopLevelDecl topleveldecl in defaultModule.TopLevelDecls) {
+ defaultClass = topleveldecl as DefaultClassDecl;
+ if (defaultClass != null) {
+ defaultClass.Members.AddRange(membersDefaultClass);
+ break;
}
}
-
+ if (defaultClass == null) { // create the default class here, because it wasn't found
+ defaultClass = new DefaultClassDecl(defaultModule, membersDefaultClass);
+ defaultModule.TopLevelDecls.Add(defaultClass);
+ }
Expect(0);
}
- void Attribute(ref Attributes attrs) {
- Expect(6);
- AttributeBody(ref attrs);
- Expect(7);
- }
-
- void Ident(out IToken/*!*/ x) {
- Contract.Ensures(Contract.ValueAtReturn(out x) != null);
- Expect(1);
- x = t;
- }
-
- void Idents(List<string/*!*/>/*!*/ ids) {
- IToken/*!*/ id;
- Ident(out id);
- ids.Add(id.val);
- while (la.kind == 20) {
- Get();
- Ident(out id);
- ids.Add(id.val);
+ void SubModuleDecl(ModuleDefinition parent, bool isOverallModuleGhost, out ModuleDecl submodule) {
+ ClassDecl/*!*/ c; DatatypeDecl/*!*/ dt; ArbitraryTypeDecl at;
+ Attributes attrs = null; IToken/*!*/ id;
+ List<MemberDecl/*!*/> namedModuleDefaultClassMembers = new List<MemberDecl>();;
+ List<IToken> idRefined = null, idPath = null;
+ bool isGhost = false;
+ ModuleDefinition module;
+ ModuleDecl sm;
+ submodule = null; // appease compiler
+
+ Expect(9);
+ while (la.kind == 6) {
+ Attribute(ref attrs);
}
+ NoUSIdent(out id);
+ if (la.kind == 6 || la.kind == 10) {
+ if (la.kind == 10) {
+ Get();
+ QualifiedName(out idRefined);
+ }
+ module = new ModuleDefinition(id, id.val, isOverallModuleGhost, false, idRefined == null ? null : idRefined, attrs);
+ Expect(6);
+ module.BodyStartTok = t;
+ while (StartOf(1)) {
+ isGhost = false;
+ if (la.kind == 8) {
+ Get();
+ isGhost = true;
+ }
+ if (la.kind == 9) {
+ SubModuleDecl(module, isGhost, out sm);
+ module.TopLevelDecls.Add(sm);
+ } else if (la.kind == 15) {
+ if (isGhost) { SemErr(t, "a class is not allowed to be declared as 'ghost'"); }
+ ClassDecl(module, out c);
+ module.TopLevelDecls.Add(c);
+ } else if (la.kind == 17 || la.kind == 18) {
+ if (isGhost) { SemErr(t, "a datatype/codatatype is not allowed to be declared as 'ghost'"); }
+ DatatypeDecl(module, out dt);
+ module.TopLevelDecls.Add(dt);
+ } else if (la.kind == 22) {
+ if (isGhost) { SemErr(t, "a type is not allowed to be declared as 'ghost'"); }
+ ArbitraryTypeDecl(module, out at);
+ module.TopLevelDecls.Add(at);
+ } else if (StartOf(2)) {
+ ClassMemberDecl(namedModuleDefaultClassMembers, isGhost, false);
+ } else SynErr(109);
+ }
+ Expect(7);
+ module.BodyEndTok = t;
+ module.TopLevelDecls.Add(new DefaultClassDecl(module, namedModuleDefaultClassMembers));
+ submodule = new LiteralModuleDecl(module, parent);
+ } else if (la.kind == 11) {
+ Get();
+ QualifiedName(out idPath);
+ Expect(12);
+ submodule = new AliasModuleDecl(idPath, id, parent);
+ } else if (la.kind == 13) {
+ Get();
+ QualifiedName(out idPath);
+ Expect(12);
+ submodule = new AbstractModuleDecl(idPath, id, parent);
+ } else SynErr(110);
}
- void ClassDecl(ModuleDecl/*!*/ module, out ClassDecl/*!*/ c) {
+ void ClassDecl(ModuleDefinition/*!*/ module, out ClassDecl/*!*/ c) {
Contract.Requires(module != null);
Contract.Ensures(Contract.ValueAtReturn(out c) != null);
IToken/*!*/ id;
@@ -309,18 +303,18 @@ bool IsAttribute() {
List<MemberDecl/*!*/> members = new List<MemberDecl/*!*/>();
IToken bodyStart;
- while (!(la.kind == 0 || la.kind == 12)) {SynErr(109); Get();}
- Expect(12);
+ while (!(la.kind == 0 || la.kind == 15)) {SynErr(111); Get();}
+ Expect(15);
while (la.kind == 6) {
Attribute(ref attrs);
}
- Ident(out id);
- if (la.kind == 25) {
+ NoUSIdent(out id);
+ if (la.kind == 26) {
GenericParameters(typeArgs);
}
Expect(6);
bodyStart = t;
- while (StartOf(3)) {
+ while (StartOf(2)) {
ClassMemberDecl(members, false, true);
}
Expect(7);
@@ -330,7 +324,7 @@ bool IsAttribute() {
}
- void DatatypeDecl(ModuleDecl/*!*/ module, out DatatypeDecl/*!*/ dt) {
+ void DatatypeDecl(ModuleDefinition/*!*/ module, out DatatypeDecl/*!*/ dt) {
Contract.Requires(module != null);
Contract.Ensures(Contract.ValueAtReturn(out dt)!=null);
IToken/*!*/ id;
@@ -340,29 +334,29 @@ bool IsAttribute() {
IToken bodyStart = Token.NoToken; // dummy assignment
bool co = false;
- while (!(la.kind == 0 || la.kind == 14 || la.kind == 15)) {SynErr(110); Get();}
- if (la.kind == 14) {
+ while (!(la.kind == 0 || la.kind == 17 || la.kind == 18)) {SynErr(112); Get();}
+ if (la.kind == 17) {
Get();
- } else if (la.kind == 15) {
+ } else if (la.kind == 18) {
Get();
co = true;
- } else SynErr(111);
+ } else SynErr(113);
while (la.kind == 6) {
Attribute(ref attrs);
}
- Ident(out id);
- if (la.kind == 25) {
+ NoUSIdent(out id);
+ if (la.kind == 26) {
GenericParameters(typeArgs);
}
- Expect(16);
+ Expect(11);
bodyStart = t;
DatatypeMemberDecl(ctors);
- while (la.kind == 17) {
+ while (la.kind == 19) {
Get();
DatatypeMemberDecl(ctors);
}
- while (!(la.kind == 0 || la.kind == 18)) {SynErr(112); Get();}
- Expect(18);
+ while (!(la.kind == 0 || la.kind == 12)) {SynErr(114); Get();}
+ Expect(12);
if (co) {
dt = new CoDatatypeDecl(id, id.val, module, typeArgs, ctors, attrs);
} else {
@@ -373,25 +367,25 @@ bool IsAttribute() {
}
- void ArbitraryTypeDecl(ModuleDecl/*!*/ module, out ArbitraryTypeDecl at) {
+ void ArbitraryTypeDecl(ModuleDefinition/*!*/ module, out ArbitraryTypeDecl at) {
IToken/*!*/ id;
Attributes attrs = null;
var eqSupport = TypeParameter.EqualitySupportValue.Unspecified;
- Expect(21);
+ Expect(22);
while (la.kind == 6) {
Attribute(ref attrs);
}
- Ident(out id);
- if (la.kind == 22) {
+ NoUSIdent(out id);
+ if (la.kind == 23) {
Get();
- Expect(23);
Expect(24);
+ Expect(25);
eqSupport = TypeParameter.EqualitySupportValue.Required;
}
at = new ArbitraryTypeDecl(id, id.val, module, eqSupport, attrs);
- while (!(la.kind == 0 || la.kind == 18)) {SynErr(113); Get();}
- Expect(18);
+ while (!(la.kind == 0 || la.kind == 12)) {SynErr(115); Get();}
+ Expect(12);
}
void ClassMemberDecl(List<MemberDecl/*!*/>/*!*/ mm, bool isAlreadyGhost, bool allowConstructors) {
@@ -401,7 +395,7 @@ bool IsAttribute() {
MemberModifiers mmod = new MemberModifiers();
mmod.IsGhost = isAlreadyGhost;
- while (la.kind == 8 || la.kind == 13) {
+ while (la.kind == 8 || la.kind == 16) {
if (la.kind == 8) {
Get();
mmod.IsGhost = true;
@@ -410,15 +404,48 @@ bool IsAttribute() {
mmod.IsStatic = true;
}
}
- if (la.kind == 19) {
+ if (la.kind == 20) {
FieldDecl(mmod, mm);
} else if (la.kind == 45 || la.kind == 46) {
FunctionDecl(mmod, out f);
mm.Add(f);
- } else if (la.kind == 27 || la.kind == 28) {
+ } else if (la.kind == 28 || la.kind == 29) {
MethodDecl(mmod, allowConstructors, out m);
mm.Add(m);
- } else SynErr(114);
+ } else SynErr(116);
+ }
+
+ void Attribute(ref Attributes attrs) {
+ Expect(6);
+ AttributeBody(ref attrs);
+ Expect(7);
+ }
+
+ void NoUSIdent(out IToken/*!*/ x) {
+ Contract.Ensures(Contract.ValueAtReturn(out x) != null);
+ Expect(1);
+ x = t;
+ if (x.val.Length > 0 && x.val.StartsWith("_")) {
+ SemErr("cannot declare identifier beginning with underscore");
+ }
+
+ }
+
+ void QualifiedName(out List<IToken> ids) {
+ IToken id; ids = new List<IToken>();
+ Ident(out id);
+ ids.Add(id);
+ while (la.kind == 14) {
+ Get();
+ Ident(out id);
+ ids.Add(id);
+ }
+ }
+
+ void Ident(out IToken/*!*/ x) {
+ Contract.Ensures(Contract.ValueAtReturn(out x) != null);
+ Expect(1);
+ x = t;
}
void GenericParameters(List<TypeParameter/*!*/>/*!*/ typeArgs) {
@@ -426,29 +453,29 @@ bool IsAttribute() {
IToken/*!*/ id;
TypeParameter.EqualitySupportValue eqSupport;
- Expect(25);
- Ident(out id);
+ Expect(26);
+ NoUSIdent(out id);
eqSupport = TypeParameter.EqualitySupportValue.Unspecified;
- if (la.kind == 22) {
+ if (la.kind == 23) {
Get();
- Expect(23);
Expect(24);
+ Expect(25);
eqSupport = TypeParameter.EqualitySupportValue.Required;
}
typeArgs.Add(new TypeParameter(id, id.val, eqSupport));
- while (la.kind == 20) {
+ while (la.kind == 21) {
Get();
- Ident(out id);
+ NoUSIdent(out id);
eqSupport = TypeParameter.EqualitySupportValue.Unspecified;
- if (la.kind == 22) {
+ if (la.kind == 23) {
Get();
- Expect(23);
Expect(24);
+ Expect(25);
eqSupport = TypeParameter.EqualitySupportValue.Required;
}
typeArgs.Add(new TypeParameter(id, id.val, eqSupport));
}
- Expect(26);
+ Expect(27);
}
void FieldDecl(MemberModifiers mmod, List<MemberDecl/*!*/>/*!*/ mm) {
@@ -456,8 +483,8 @@ bool IsAttribute() {
Attributes attrs = null;
IToken/*!*/ id; Type/*!*/ ty;
- while (!(la.kind == 0 || la.kind == 19)) {SynErr(115); Get();}
- Expect(19);
+ while (!(la.kind == 0 || la.kind == 20)) {SynErr(117); Get();}
+ Expect(20);
if (mmod.IsStatic) { SemErr(t, "fields cannot be declared 'static'"); }
while (la.kind == 6) {
@@ -465,13 +492,13 @@ bool IsAttribute() {
}
IdentType(out id, out ty);
mm.Add(new Field(id, id.val, mmod.IsGhost, ty, attrs));
- while (la.kind == 20) {
+ while (la.kind == 21) {
Get();
IdentType(out id, out ty);
mm.Add(new Field(id, id.val, mmod.IsGhost, ty, attrs));
}
- while (!(la.kind == 0 || la.kind == 18)) {SynErr(116); Get();}
- Expect(18);
+ while (!(la.kind == 0 || la.kind == 12)) {SynErr(118); Get();}
+ Expect(12);
}
void FunctionDecl(MemberModifiers mmod, out Function/*!*/ f) {
@@ -495,7 +522,7 @@ bool IsAttribute() {
if (la.kind == 45) {
Get();
- if (la.kind == 27) {
+ if (la.kind == 28) {
Get();
isFunctionMethod = true;
}
@@ -504,23 +531,23 @@ bool IsAttribute() {
while (la.kind == 6) {
Attribute(ref attrs);
}
- Ident(out id);
- if (la.kind == 22 || la.kind == 25) {
- if (la.kind == 25) {
+ NoUSIdent(out id);
+ if (la.kind == 23 || la.kind == 26) {
+ if (la.kind == 26) {
GenericParameters(typeArgs);
}
Formals(true, isFunctionMethod, formals, out openParen);
Expect(5);
Type(out returnType);
- } else if (la.kind == 30) {
+ } else if (la.kind == 31) {
Get();
signatureOmitted = true;
openParen = Token.NoToken;
- } else SynErr(117);
+ } else SynErr(119);
} else if (la.kind == 46) {
Get();
isPredicate = true;
- if (la.kind == 27) {
+ if (la.kind == 28) {
Get();
isFunctionMethod = true;
}
@@ -529,25 +556,25 @@ bool IsAttribute() {
while (la.kind == 6) {
Attribute(ref attrs);
}
- Ident(out id);
- if (StartOf(4)) {
- if (la.kind == 25) {
+ NoUSIdent(out id);
+ if (StartOf(3)) {
+ if (la.kind == 26) {
GenericParameters(typeArgs);
}
- if (la.kind == 22) {
+ if (la.kind == 23) {
Formals(true, isFunctionMethod, formals, out openParen);
if (la.kind == 5) {
Get();
SemErr(t, "predicates do not have an explicitly declared return type; it is always bool");
}
}
- } else if (la.kind == 30) {
+ } else if (la.kind == 31) {
Get();
signatureOmitted = true;
openParen = Token.NoToken;
- } else SynErr(118);
- } else SynErr(119);
- while (StartOf(5)) {
+ } else SynErr(120);
+ } else SynErr(121);
+ while (StartOf(4)) {
FunctionSpec(reqs, reads, ens, decreases);
}
if (la.kind == 6) {
@@ -585,10 +612,10 @@ bool IsAttribute() {
IToken bodyStart = Token.NoToken;
IToken bodyEnd = Token.NoToken;
- while (!(la.kind == 0 || la.kind == 27 || la.kind == 28)) {SynErr(120); Get();}
- if (la.kind == 27) {
+ while (!(la.kind == 0 || la.kind == 28 || la.kind == 29)) {SynErr(122); Get();}
+ if (la.kind == 28) {
Get();
- } else if (la.kind == 28) {
+ } else if (la.kind == 29) {
Get();
if (allowConstructor) {
isConstructor = true;
@@ -596,7 +623,7 @@ bool IsAttribute() {
SemErr(t, "constructors are only allowed in classes");
}
- } else SynErr(121);
+ } else SynErr(123);
if (isConstructor) {
if (mmod.IsGhost) {
SemErr(t, "constructors cannot be declared 'ghost'");
@@ -609,22 +636,22 @@ bool IsAttribute() {
while (la.kind == 6) {
Attribute(ref attrs);
}
- Ident(out id);
- if (la.kind == 22 || la.kind == 25) {
- if (la.kind == 25) {
+ NoUSIdent(out id);
+ if (la.kind == 23 || la.kind == 26) {
+ if (la.kind == 26) {
GenericParameters(typeArgs);
}
Formals(true, !mmod.IsGhost, ins, out openParen);
- if (la.kind == 29) {
+ if (la.kind == 30) {
Get();
if (isConstructor) { SemErr(t, "constructors cannot have out-parameters"); }
Formals(false, !mmod.IsGhost, outs, out openParen);
}
- } else if (la.kind == 30) {
+ } else if (la.kind == 31) {
Get();
signatureOmitted = true; openParen = Token.NoToken;
- } else SynErr(122);
- while (StartOf(6)) {
+ } else SynErr(124);
+ while (StartOf(5)) {
MethodSpec(req, mod, ens, dec, ref decAttrs, ref modAttrs);
}
if (la.kind == 6) {
@@ -651,8 +678,8 @@ bool IsAttribute() {
while (la.kind == 6) {
Attribute(ref attrs);
}
- Ident(out id);
- if (la.kind == 22) {
+ NoUSIdent(out id);
+ if (la.kind == 23) {
FormalsOptionalIds(formals);
}
ctors.Add(new DatatypeCtor(id, id.val, formals, attrs));
@@ -660,22 +687,22 @@ bool IsAttribute() {
void FormalsOptionalIds(List<Formal/*!*/>/*!*/ formals) {
Contract.Requires(cce.NonNullElements(formals)); IToken/*!*/ id; Type/*!*/ ty; string/*!*/ name; bool isGhost;
- Expect(22);
- if (StartOf(7)) {
+ Expect(23);
+ if (StartOf(6)) {
TypeIdentOptional(out id, out name, out ty, out isGhost);
formals.Add(new Formal(id, name, ty, true, isGhost));
- while (la.kind == 20) {
+ while (la.kind == 21) {
Get();
TypeIdentOptional(out id, out name, out ty, out isGhost);
formals.Add(new Formal(id, name, ty, true, isGhost));
}
}
- Expect(24);
+ Expect(25);
}
void IdentType(out IToken/*!*/ id, out Type/*!*/ ty) {
Contract.Ensures(Contract.ValueAtReturn(out id) != null); Contract.Ensures(Contract.ValueAtReturn(out ty) != null);
- Ident(out id);
+ NoUSIdent(out id);
Expect(5);
Type(out ty);
}
@@ -699,7 +726,7 @@ bool IsAttribute() {
void LocalIdentTypeOptional(out VarDecl/*!*/ var, bool isGhost) {
IToken/*!*/ id; Type/*!*/ ty; Type optType = null;
- Ident(out id);
+ NoUSIdent(out id);
if (la.kind == 5) {
Get();
Type(out ty);
@@ -711,7 +738,7 @@ bool IsAttribute() {
void IdentTypeOptional(out BoundVar/*!*/ var) {
Contract.Ensures(Contract.ValueAtReturn(out var)!=null); IToken/*!*/ id; Type/*!*/ ty; Type optType = null;
- Ident(out id);
+ NoUSIdent(out id);
if (la.kind == 5) {
Get();
Type(out ty);
@@ -754,22 +781,22 @@ bool IsAttribute() {
List<Type/*!*/>/*!*/ gt;
switch (la.kind) {
- case 36: {
+ case 37: {
Get();
tok = t;
break;
}
- case 37: {
+ case 38: {
Get();
tok = t; ty = new NatType();
break;
}
- case 38: {
+ case 39: {
Get();
tok = t; ty = new IntType();
break;
}
- case 39: {
+ case 40: {
Get();
tok = t; gt = new List<Type/*!*/>();
GenericInstantiation(gt);
@@ -780,7 +807,7 @@ bool IsAttribute() {
break;
}
- case 40: {
+ case 41: {
Get();
tok = t; gt = new List<Type/*!*/>();
GenericInstantiation(gt);
@@ -791,7 +818,7 @@ bool IsAttribute() {
break;
}
- case 41: {
+ case 42: {
Get();
tok = t; gt = new List<Type/*!*/>();
GenericInstantiation(gt);
@@ -802,7 +829,7 @@ bool IsAttribute() {
break;
}
- case 42: {
+ case 43: {
Get();
tok = t; gt = new List<Type/*!*/>();
GenericInstantiation(gt);
@@ -813,28 +840,28 @@ bool IsAttribute() {
break;
}
- case 1: case 3: case 43: {
+ case 1: case 3: case 44: {
ReferenceType(out tok, out ty);
break;
}
- default: SynErr(123); break;
+ default: SynErr(125); break;
}
}
void Formals(bool incoming, bool allowGhostKeyword, List<Formal/*!*/>/*!*/ formals, out IToken openParen) {
Contract.Requires(cce.NonNullElements(formals)); IToken/*!*/ id; Type/*!*/ ty; bool isGhost;
- Expect(22);
+ Expect(23);
openParen = t;
if (la.kind == 1 || la.kind == 8) {
GIdentType(allowGhostKeyword, out id, out ty, out isGhost);
formals.Add(new Formal(id, id.val, ty, incoming, isGhost));
- while (la.kind == 20) {
+ while (la.kind == 21) {
Get();
GIdentType(allowGhostKeyword, out id, out ty, out isGhost);
formals.Add(new Formal(id, id.val, ty, incoming, isGhost));
}
}
- Expect(24);
+ Expect(25);
}
void MethodSpec(List<MaybeFreeExpression/*!*/>/*!*/ req, List<FrameExpression/*!*/>/*!*/ mod, List<MaybeFreeExpression/*!*/>/*!*/ ens,
@@ -842,53 +869,53 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
Contract.Requires(cce.NonNullElements(req)); Contract.Requires(cce.NonNullElements(mod)); Contract.Requires(cce.NonNullElements(ens)); Contract.Requires(cce.NonNullElements(decreases));
Expression/*!*/ e; FrameExpression/*!*/ fe; bool isFree = false; Attributes ensAttrs = null;
- while (!(StartOf(8))) {SynErr(124); Get();}
- if (la.kind == 31) {
+ while (!(StartOf(7))) {SynErr(126); Get();}
+ if (la.kind == 32) {
Get();
while (IsAttribute()) {
Attribute(ref modAttrs);
}
- if (StartOf(9)) {
+ if (StartOf(8)) {
FrameExpression(out fe);
mod.Add(fe);
- while (la.kind == 20) {
+ while (la.kind == 21) {
Get();
FrameExpression(out fe);
mod.Add(fe);
}
}
- while (!(la.kind == 0 || la.kind == 18)) {SynErr(125); Get();}
- Expect(18);
- } else if (la.kind == 32 || la.kind == 33 || la.kind == 34) {
- if (la.kind == 32) {
+ while (!(la.kind == 0 || la.kind == 12)) {SynErr(127); Get();}
+ Expect(12);
+ } else if (la.kind == 33 || la.kind == 34 || la.kind == 35) {
+ if (la.kind == 33) {
Get();
isFree = true;
}
- if (la.kind == 33) {
+ if (la.kind == 34) {
Get();
Expression(out e);
- while (!(la.kind == 0 || la.kind == 18)) {SynErr(126); Get();}
- Expect(18);
+ while (!(la.kind == 0 || la.kind == 12)) {SynErr(128); Get();}
+ Expect(12);
req.Add(new MaybeFreeExpression(e, isFree));
- } else if (la.kind == 34) {
+ } else if (la.kind == 35) {
Get();
while (IsAttribute()) {
Attribute(ref ensAttrs);
}
Expression(out e);
- while (!(la.kind == 0 || la.kind == 18)) {SynErr(127); Get();}
- Expect(18);
+ while (!(la.kind == 0 || la.kind == 12)) {SynErr(129); Get();}
+ Expect(12);
ens.Add(new MaybeFreeExpression(e, isFree, ensAttrs));
- } else SynErr(128);
- } else if (la.kind == 35) {
+ } else SynErr(130);
+ } else if (la.kind == 36) {
Get();
while (IsAttribute()) {
Attribute(ref decAttrs);
}
DecreasesList(decreases, false);
- while (!(la.kind == 0 || la.kind == 18)) {SynErr(129); Get();}
- Expect(18);
- } else SynErr(130);
+ while (!(la.kind == 0 || la.kind == 12)) {SynErr(131); Get();}
+ Expect(12);
+ } else SynErr(132);
}
void BlockStmt(out BlockStmt/*!*/ block, out IToken bodyStart, out IToken bodyEnd) {
@@ -897,7 +924,7 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
Expect(6);
bodyStart = t;
- while (StartOf(10)) {
+ while (StartOf(9)) {
Stmt(body);
}
Expect(7);
@@ -929,7 +956,7 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
decreases.Add(e);
}
- while (la.kind == 20) {
+ while (la.kind == 21) {
Get();
PossiblyWildExpression(out e);
if (!allowWildcard && e is WildcardExpr) {
@@ -943,15 +970,15 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
void GenericInstantiation(List<Type/*!*/>/*!*/ gt) {
Contract.Requires(cce.NonNullElements(gt)); Type/*!*/ ty;
- Expect(25);
+ Expect(26);
Type(out ty);
gt.Add(ty);
- while (la.kind == 20) {
+ while (la.kind == 21) {
Get();
Type(out ty);
gt.Add(ty);
}
- Expect(26);
+ Expect(27);
}
void ReferenceType(out IToken/*!*/ tok, out Type/*!*/ ty) {
@@ -960,7 +987,7 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
IToken moduleName = null;
List<Type/*!*/>/*!*/ gt;
- if (la.kind == 43) {
+ if (la.kind == 44) {
Get();
tok = t; ty = new ObjectType();
} else if (la.kind == 3) {
@@ -979,53 +1006,53 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
} else if (la.kind == 1) {
Ident(out tok);
gt = new List<Type/*!*/>();
- if (la.kind == 44) {
+ if (la.kind == 14) {
moduleName = tok;
Get();
Ident(out tok);
}
- if (la.kind == 25) {
+ if (la.kind == 26) {
GenericInstantiation(gt);
}
ty = new UserDefinedType(tok, tok.val, gt, moduleName);
- } else SynErr(131);
+ } else SynErr(133);
}
void FunctionSpec(List<Expression/*!*/>/*!*/ reqs, List<FrameExpression/*!*/>/*!*/ reads, List<Expression/*!*/>/*!*/ ens, List<Expression/*!*/>/*!*/ decreases) {
Contract.Requires(cce.NonNullElements(reqs)); Contract.Requires(cce.NonNullElements(reads)); Contract.Requires(cce.NonNullElements(decreases));
Expression/*!*/ e; FrameExpression/*!*/ fe;
- if (la.kind == 33) {
- while (!(la.kind == 0 || la.kind == 33)) {SynErr(132); Get();}
+ if (la.kind == 34) {
+ while (!(la.kind == 0 || la.kind == 34)) {SynErr(134); Get();}
Get();
Expression(out e);
- while (!(la.kind == 0 || la.kind == 18)) {SynErr(133); Get();}
- Expect(18);
+ while (!(la.kind == 0 || la.kind == 12)) {SynErr(135); Get();}
+ Expect(12);
reqs.Add(e);
} else if (la.kind == 47) {
Get();
- if (StartOf(11)) {
+ if (StartOf(10)) {
PossiblyWildFrameExpression(out fe);
reads.Add(fe);
- while (la.kind == 20) {
+ while (la.kind == 21) {
Get();
PossiblyWildFrameExpression(out fe);
reads.Add(fe);
}
}
- while (!(la.kind == 0 || la.kind == 18)) {SynErr(134); Get();}
- Expect(18);
- } else if (la.kind == 34) {
+ while (!(la.kind == 0 || la.kind == 12)) {SynErr(136); Get();}
+ Expect(12);
+ } else if (la.kind == 35) {
Get();
Expression(out e);
- while (!(la.kind == 0 || la.kind == 18)) {SynErr(135); Get();}
- Expect(18);
+ while (!(la.kind == 0 || la.kind == 12)) {SynErr(137); Get();}
+ Expect(12);
ens.Add(e);
- } else if (la.kind == 35) {
+ } else if (la.kind == 36) {
Get();
DecreasesList(decreases, false);
- while (!(la.kind == 0 || la.kind == 18)) {SynErr(136); Get();}
- Expect(18);
- } else SynErr(137);
+ while (!(la.kind == 0 || la.kind == 12)) {SynErr(138); Get();}
+ Expect(12);
+ } else SynErr(139);
}
void FunctionBody(out Expression/*!*/ e, out IToken bodyStart, out IToken bodyEnd) {
@@ -1042,9 +1069,9 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
if (la.kind == 48) {
Get();
fe = new FrameExpression(new WildcardExpr(t), null);
- } else if (StartOf(9)) {
+ } else if (StartOf(8)) {
FrameExpression(out fe);
- } else SynErr(138);
+ } else SynErr(140);
}
void PossiblyWildExpression(out Expression/*!*/ e) {
@@ -1053,9 +1080,9 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
if (la.kind == 48) {
Get();
e = new WildcardExpr(t);
- } else if (StartOf(9)) {
+ } else if (StartOf(8)) {
Expression(out e);
- } else SynErr(139);
+ } else SynErr(141);
}
void Stmt(List<Statement/*!*/>/*!*/ ss) {
@@ -1072,7 +1099,7 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
IToken bodyStart, bodyEnd;
int breakCount;
- while (!(StartOf(12))) {SynErr(140); Get();}
+ while (!(StartOf(11))) {SynErr(142); Get();}
switch (la.kind) {
case 6: {
BlockStmt(out bs, out bodyStart, out bodyEnd);
@@ -1091,11 +1118,11 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
PrintStmt(out s);
break;
}
- case 1: case 2: case 17: case 22: case 92: case 93: case 94: case 95: case 96: case 97: case 98: {
+ case 1: case 2: case 19: case 23: case 92: case 93: case 94: case 95: case 96: case 97: case 98: {
UpdateStmt(out s);
break;
}
- case 8: case 19: {
+ case 8: case 20: {
VarDeclStatement(out s);
break;
}
@@ -1118,7 +1145,7 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
case 50: {
Get();
x = t;
- Ident(out id);
+ NoUSIdent(out id);
Expect(5);
OneStmt(out s);
s.Labels = new LList<Label>(new Label(x, id.val), s.Labels);
@@ -1128,16 +1155,16 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
Get();
x = t; breakCount = 1; label = null;
if (la.kind == 1) {
- Ident(out id);
+ NoUSIdent(out id);
label = id.val;
- } else if (la.kind == 18 || la.kind == 51) {
+ } else if (la.kind == 12 || la.kind == 51) {
while (la.kind == 51) {
Get();
breakCount++;
}
- } else SynErr(141);
- while (!(la.kind == 0 || la.kind == 18)) {SynErr(142); Get();}
- Expect(18);
+ } else SynErr(143);
+ while (!(la.kind == 0 || la.kind == 12)) {SynErr(144); Get();}
+ Expect(12);
s = label != null ? new BreakStmt(x, label) : new BreakStmt(x, breakCount);
break;
}
@@ -1145,13 +1172,13 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
ReturnStmt(out s);
break;
}
- case 30: {
+ case 31: {
Get();
s = new SkeletonStatement(t);
- Expect(18);
+ Expect(12);
break;
}
- default: SynErr(143); break;
+ default: SynErr(145); break;
}
}
@@ -1164,12 +1191,12 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
while (IsAttribute()) {
Attribute(ref attrs);
}
- if (StartOf(9)) {
+ if (StartOf(8)) {
Expression(out e);
- } else if (la.kind == 30) {
+ } else if (la.kind == 31) {
Get();
- } else SynErr(144);
- Expect(18);
+ } else SynErr(146);
+ Expect(12);
if (e == null) {
s = new SkeletonStatement(new AssertStmt(x, new LiteralExpr(x, true), attrs), true, false);
} else {
@@ -1187,18 +1214,18 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
while (IsAttribute()) {
Attribute(ref attrs);
}
- if (StartOf(9)) {
+ if (StartOf(8)) {
Expression(out e);
- } else if (la.kind == 30) {
+ } else if (la.kind == 31) {
Get();
- } else SynErr(145);
+ } else SynErr(147);
if (e == null) {
s = new SkeletonStatement(new AssumeStmt(x, new LiteralExpr(x, true), attrs), true, false);
} else {
s = new AssumeStmt(x, e, attrs);
}
- Expect(18);
+ Expect(12);
}
void PrintStmt(out Statement/*!*/ s) {
@@ -1209,12 +1236,12 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
x = t;
AttributeArg(out arg);
args.Add(arg);
- while (la.kind == 20) {
+ while (la.kind == 21) {
Get();
AttributeArg(out arg);
args.Add(arg);
}
- Expect(18);
+ Expect(12);
s = new PrintStmt(x, args);
}
@@ -1230,15 +1257,15 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
Lhs(out e);
x = e.tok;
- if (la.kind == 6 || la.kind == 18) {
+ if (la.kind == 6 || la.kind == 12) {
while (la.kind == 6) {
Attribute(ref attrs);
}
- Expect(18);
+ Expect(12);
rhss.Add(new ExprRhs(e, attrs));
- } else if (la.kind == 20 || la.kind == 53 || la.kind == 54) {
+ } else if (la.kind == 21 || la.kind == 53 || la.kind == 54) {
lhss.Add(e); lhs0 = e;
- while (la.kind == 20) {
+ while (la.kind == 21) {
Get();
Lhs(out e);
lhss.Add(e);
@@ -1248,7 +1275,7 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
x = t;
Rhs(out r, lhs0);
rhss.Add(r);
- while (la.kind == 20) {
+ while (la.kind == 21) {
Get();
Rhs(out r, lhs0);
rhss.Add(r);
@@ -1261,12 +1288,12 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
suchThatAssume = t;
}
Expression(out suchThat);
- } else SynErr(146);
- Expect(18);
+ } else SynErr(148);
+ Expect(12);
} else if (la.kind == 5) {
Get();
SemErr(t, "invalid statement (did you forget the 'label' keyword?)");
- } else SynErr(147);
+ } else SynErr(149);
if (suchThat != null) {
s = new AssignSuchThatStmt(x, lhss, suchThat, suchThatAssume);
} else {
@@ -1288,11 +1315,11 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
Get();
isGhost = true; x = t;
}
- Expect(19);
+ Expect(20);
if (!isGhost) { x = t; }
LocalIdentTypeOptional(out d, isGhost);
lhss.Add(d);
- while (la.kind == 20) {
+ while (la.kind == 21) {
Get();
LocalIdentTypeOptional(out d, isGhost);
lhss.Add(d);
@@ -1306,7 +1333,7 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
Rhs(out r, lhs0);
rhss.Add(r);
- while (la.kind == 20) {
+ while (la.kind == 21) {
Get();
Rhs(out r, lhs0);
rhss.Add(r);
@@ -1321,7 +1348,7 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
Expression(out suchThat);
}
}
- Expect(18);
+ Expect(12);
ConcreteUpdateStatement update;
if (suchThat != null) {
var ies = new List<Expression>();
@@ -1355,8 +1382,8 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
Expect(60);
x = t;
- if (la.kind == 22 || la.kind == 30) {
- if (la.kind == 22) {
+ if (la.kind == 23 || la.kind == 31) {
+ if (la.kind == 23) {
Guard(out guard);
} else {
Get();
@@ -1371,7 +1398,7 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
} else if (la.kind == 6) {
BlockStmt(out bs, out bodyStart, out bodyEnd);
els = bs;
- } else SynErr(148);
+ } else SynErr(150);
}
if (guardOmitted) {
ifStmt = new SkeletonStatement(new IfStmt(x, guard, thn, els), true, false);
@@ -1382,7 +1409,7 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
} else if (la.kind == 6) {
AlternativeBlock(out alternatives);
ifStmt = new AlternativeStmt(x, alternatives);
- } else SynErr(149);
+ } else SynErr(151);
}
void WhileStmt(out Statement/*!*/ stmt) {
@@ -1400,8 +1427,8 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
Expect(64);
x = t;
- if (la.kind == 22 || la.kind == 30) {
- if (la.kind == 22) {
+ if (la.kind == 23 || la.kind == 31) {
+ if (la.kind == 23) {
Guard(out guard);
Contract.Assume(guard == null || cce.Owner.None(guard));
} else {
@@ -1411,10 +1438,10 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
LoopSpec(out invariants, out decreases, out mod, ref decAttrs, ref modAttrs);
if (la.kind == 6) {
BlockStmt(out body, out bodyStart, out bodyEnd);
- } else if (la.kind == 30) {
+ } else if (la.kind == 31) {
Get();
bodyOmitted = true;
- } else SynErr(150);
+ } else SynErr(152);
if (guardOmitted || bodyOmitted) {
if (mod != null) {
SemErr(mod[0].E.tok, "'modifies' clauses are not allowed on refining loops");
@@ -1428,11 +1455,11 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
stmt = new WhileStmt(x, guard, invariants, new Specification<Expression>(decreases, decAttrs), new Specification<FrameExpression>(mod, modAttrs), body);
}
- } else if (StartOf(13)) {
+ } else if (StartOf(12)) {
LoopSpec(out invariants, out decreases, out mod, ref decAttrs, ref modAttrs);
AlternativeBlock(out alternatives);
stmt = new AlternativeLoopStmt(x, invariants, new Specification<Expression>(decreases, decAttrs), new Specification<FrameExpression>(mod, modAttrs), alternatives);
- } else SynErr(151);
+ } else SynErr(153);
}
void MatchStmt(out Statement/*!*/ s) {
@@ -1465,7 +1492,7 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
Expect(69);
x = t;
- Expect(22);
+ Expect(23);
if (la.kind == 1) {
List<BoundVar/*!*/> bvarsX; Attributes attrsX; Expression rangeX;
QuantifierDomain(out bvarsX, out attrsX, out rangeX);
@@ -1475,16 +1502,16 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
if (bvars == null) { bvars = new List<BoundVar>(); }
if (range == null) { range = new LiteralExpr(x, true); }
- Expect(24);
- while (la.kind == 32 || la.kind == 34) {
+ Expect(25);
+ while (la.kind == 33 || la.kind == 35) {
isFree = false;
- if (la.kind == 32) {
+ if (la.kind == 33) {
Get();
isFree = true;
}
- Expect(34);
+ Expect(35);
Expression(out e);
- Expect(18);
+ Expect(12);
ens.Add(new MaybeFreeExpression(e, isFree));
}
BlockStmt(out block, out bodyStart, out bodyEnd);
@@ -1498,16 +1525,16 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
Expect(52);
returnTok = t;
- if (StartOf(14)) {
+ if (StartOf(13)) {
Rhs(out r, null);
rhss = new List<AssignmentRhs>(); rhss.Add(r);
- while (la.kind == 20) {
+ while (la.kind == 21) {
Get();
Rhs(out r, null);
rhss.Add(r);
}
}
- Expect(18);
+ Expect(12);
s = new ReturnStmt(returnTok, rhss);
}
@@ -1524,7 +1551,7 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
Get();
newToken = t;
TypeAndToken(out x, out ty);
- if (la.kind == 22 || la.kind == 44 || la.kind == 57) {
+ if (la.kind == 14 || la.kind == 23 || la.kind == 57) {
if (la.kind == 57) {
Get();
ee = new List<Expression>();
@@ -1532,15 +1559,15 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
Expect(58);
UserDefinedType tmp = theBuiltIns.ArrayType(x, ee.Count, new IntType(), true);
- } else if (la.kind == 44) {
+ } else if (la.kind == 14) {
Get();
Ident(out x);
- Expect(22);
+ Expect(23);
args = new List<Expression/*!*/>();
- if (StartOf(9)) {
+ if (StartOf(8)) {
Expressions(args);
}
- Expect(24);
+ Expect(25);
initCall = new CallStmt(x, new List<Expression>(), receiverForInitCall, x.val, args);
} else {
Get();
@@ -1555,10 +1582,10 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
x = null;
}
args = new List<Expression/*!*/>();
- if (StartOf(9)) {
+ if (StartOf(8)) {
Expressions(args);
}
- Expect(24);
+ Expect(25);
if (x != null) {
initCall = new CallStmt(x, new List<Expression>(), receiverForInitCall, x.val, args);
}
@@ -1579,10 +1606,10 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
} else if (la.kind == 48) {
Get();
r = new HavocRhs(t);
- } else if (StartOf(9)) {
+ } else if (StartOf(8)) {
Expression(out e);
r = new ExprRhs(e);
- } else SynErr(152);
+ } else SynErr(154);
while (la.kind == 6) {
Attribute(ref attrs);
}
@@ -1594,23 +1621,23 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
if (la.kind == 1) {
DottedIdentifiersAndFunction(out e);
- while (la.kind == 44 || la.kind == 57) {
+ while (la.kind == 14 || la.kind == 57) {
Suffix(ref e);
}
- } else if (StartOf(15)) {
+ } else if (StartOf(14)) {
ConstAtomExpression(out e);
Suffix(ref e);
- while (la.kind == 44 || la.kind == 57) {
+ while (la.kind == 14 || la.kind == 57) {
Suffix(ref e);
}
- } else SynErr(153);
+ } else SynErr(155);
}
void Expressions(List<Expression/*!*/>/*!*/ args) {
Contract.Requires(cce.NonNullElements(args)); Expression/*!*/ e;
Expression(out e);
args.Add(e);
- while (la.kind == 20) {
+ while (la.kind == 21) {
Get();
Expression(out e);
args.Add(e);
@@ -1619,15 +1646,15 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
void Guard(out Expression e) {
Expression/*!*/ ee; e = null;
- Expect(22);
+ Expect(23);
if (la.kind == 48) {
Get();
e = null;
- } else if (StartOf(9)) {
+ } else if (StartOf(8)) {
Expression(out ee);
e = ee;
- } else SynErr(154);
- Expect(24);
+ } else SynErr(156);
+ Expect(25);
}
void AlternativeBlock(out List<GuardedAlternative> alternatives) {
@@ -1643,7 +1670,7 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
Expression(out e);
Expect(63);
body = new List<Statement>();
- while (StartOf(10)) {
+ while (StartOf(9)) {
Stmt(body);
}
alternatives.Add(new GuardedAlternative(x, e, body));
@@ -1658,47 +1685,47 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
decreases = new List<Expression/*!*/>();
mod = null;
- while (StartOf(16)) {
- if (la.kind == 32 || la.kind == 65) {
+ while (StartOf(15)) {
+ if (la.kind == 33 || la.kind == 65) {
Invariant(out invariant);
- while (!(la.kind == 0 || la.kind == 18)) {SynErr(155); Get();}
- Expect(18);
+ while (!(la.kind == 0 || la.kind == 12)) {SynErr(157); Get();}
+ Expect(12);
invariants.Add(invariant);
- } else if (la.kind == 35) {
- while (!(la.kind == 0 || la.kind == 35)) {SynErr(156); Get();}
+ } else if (la.kind == 36) {
+ while (!(la.kind == 0 || la.kind == 36)) {SynErr(158); Get();}
Get();
while (IsAttribute()) {
Attribute(ref decAttrs);
}
DecreasesList(decreases, true);
- while (!(la.kind == 0 || la.kind == 18)) {SynErr(157); Get();}
- Expect(18);
+ while (!(la.kind == 0 || la.kind == 12)) {SynErr(159); Get();}
+ Expect(12);
} else {
- while (!(la.kind == 0 || la.kind == 31)) {SynErr(158); Get();}
+ while (!(la.kind == 0 || la.kind == 32)) {SynErr(160); Get();}
Get();
while (IsAttribute()) {
Attribute(ref modAttrs);
}
mod = mod ?? new List<FrameExpression>();
- if (StartOf(9)) {
+ if (StartOf(8)) {
FrameExpression(out fe);
mod.Add(fe);
- while (la.kind == 20) {
+ while (la.kind == 21) {
Get();
FrameExpression(out fe);
mod.Add(fe);
}
}
- while (!(la.kind == 0 || la.kind == 18)) {SynErr(159); Get();}
- Expect(18);
+ while (!(la.kind == 0 || la.kind == 12)) {SynErr(161); Get();}
+ Expect(12);
}
}
}
void Invariant(out MaybeFreeExpression/*!*/ invariant) {
bool isFree = false; Expression/*!*/ e; List<string> ids = new List<string>(); invariant = null; Attributes attrs = null;
- while (!(la.kind == 0 || la.kind == 32 || la.kind == 65)) {SynErr(160); Get();}
- if (la.kind == 32) {
+ while (!(la.kind == 0 || la.kind == 33 || la.kind == 65)) {SynErr(162); Get();}
+ if (la.kind == 33) {
Get();
isFree = true;
}
@@ -1720,19 +1747,19 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
Expect(62);
x = t;
Ident(out id);
- if (la.kind == 22) {
+ if (la.kind == 23) {
Get();
IdentTypeOptional(out bv);
arguments.Add(bv);
- while (la.kind == 20) {
+ while (la.kind == 21) {
Get();
IdentTypeOptional(out bv);
arguments.Add(bv);
}
- Expect(24);
+ Expect(25);
}
Expect(63);
- while (StartOf(10)) {
+ while (StartOf(9)) {
Stmt(body);
}
c = new MatchCaseStmt(x, id.val, arguments, body);
@@ -1743,10 +1770,10 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
if (la.kind == 4) {
Get();
arg = new Attributes.Argument(t, t.val.Substring(1, t.val.Length-2));
- } else if (StartOf(9)) {
+ } else if (StartOf(8)) {
Expression(out e);
arg = new Attributes.Argument(t, e);
- } else SynErr(161);
+ } else SynErr(163);
}
void QuantifierDomain(out List<BoundVar/*!*/> bvars, out Attributes attrs, out Expression range) {
@@ -1757,7 +1784,7 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
IdentTypeOptional(out bv);
bvars.Add(bv);
- while (la.kind == 20) {
+ while (la.kind == 21) {
Get();
IdentTypeOptional(out bv);
bvars.Add(bv);
@@ -1765,7 +1792,7 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
while (la.kind == 6) {
Attribute(ref attrs);
}
- if (la.kind == 17) {
+ if (la.kind == 19) {
Get();
Expression(out range);
}
@@ -1798,13 +1825,13 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
Get();
} else if (la.kind == 71) {
Get();
- } else SynErr(162);
+ } else SynErr(164);
}
void LogicalExpression(out Expression/*!*/ e0) {
Contract.Ensures(Contract.ValueAtReturn(out e0) != null); IToken/*!*/ x; Expression/*!*/ e1;
RelationalExpression(out e0);
- if (StartOf(17)) {
+ if (StartOf(16)) {
if (la.kind == 74 || la.kind == 75) {
AndOp();
x = t;
@@ -1836,7 +1863,7 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
Get();
} else if (la.kind == 73) {
Get();
- } else SynErr(163);
+ } else SynErr(165);
}
void RelationalExpression(out Expression/*!*/ e) {
@@ -1853,7 +1880,7 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
Term(out e0);
e = e0;
- if (StartOf(18)) {
+ if (StartOf(17)) {
RelOp(out x, out op);
firstOpTok = x;
Term(out e1);
@@ -1861,7 +1888,7 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
if (op == BinaryExpr.Opcode.Disjoint)
acc = new BinaryExpr(x, BinaryExpr.Opcode.Add, e0, e1); // accumulate first two operands.
- while (StartOf(18)) {
+ while (StartOf(17)) {
if (chain == null) {
chain = new List<Expression>();
ops = new List<BinaryExpr.Opcode>();
@@ -1934,7 +1961,7 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
Get();
} else if (la.kind == 75) {
Get();
- } else SynErr(164);
+ } else SynErr(166);
}
void OrOp() {
@@ -1942,7 +1969,7 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
Get();
} else if (la.kind == 77) {
Get();
- } else SynErr(165);
+ } else SynErr(167);
}
void Term(out Expression/*!*/ e0) {
@@ -1961,17 +1988,17 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
IToken y;
switch (la.kind) {
- case 23: {
+ case 24: {
Get();
x = t; op = BinaryExpr.Opcode.Eq;
break;
}
- case 25: {
+ case 26: {
Get();
x = t; op = BinaryExpr.Opcode.Lt;
break;
}
- case 26: {
+ case 27: {
Get();
x = t; op = BinaryExpr.Opcode.Gt;
break;
@@ -2034,7 +2061,7 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
x = t; op = BinaryExpr.Opcode.Ge;
break;
}
- default: SynErr(166); break;
+ default: SynErr(168); break;
}
}
@@ -2056,7 +2083,7 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
} else if (la.kind == 88) {
Get();
x = t; op = BinaryExpr.Opcode.Sub;
- } else SynErr(167);
+ } else SynErr(169);
}
void UnaryExpression(out Expression/*!*/ e) {
@@ -2076,13 +2103,13 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
e = new UnaryExpr(x, UnaryExpr.Opcode.Not, e);
break;
}
- case 19: case 39: case 55: case 60: case 66: case 67: case 101: case 102: case 103: case 104: {
+ case 20: case 40: case 55: case 60: case 66: case 67: case 101: case 102: case 103: case 104: {
EndlessExpression(out e);
break;
}
case 1: {
DottedIdentifiersAndFunction(out e);
- while (la.kind == 44 || la.kind == 57) {
+ while (la.kind == 14 || la.kind == 57) {
Suffix(ref e);
}
break;
@@ -2091,22 +2118,22 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
DisplayExpr(out e);
break;
}
- case 40: {
+ case 41: {
MultiSetExpr(out e);
break;
}
- case 42: {
+ case 43: {
MapExpr(out e);
break;
}
- case 2: case 17: case 22: case 92: case 93: case 94: case 95: case 96: case 97: case 98: {
+ case 2: case 19: case 23: case 92: case 93: case 94: case 95: case 96: case 97: case 98: {
ConstAtomExpression(out e);
- while (la.kind == 44 || la.kind == 57) {
+ while (la.kind == 14 || la.kind == 57) {
Suffix(ref e);
}
break;
}
- default: SynErr(168); break;
+ default: SynErr(170); break;
}
}
@@ -2121,7 +2148,7 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
} else if (la.kind == 90) {
Get();
x = t; op = BinaryExpr.Opcode.Mod;
- } else SynErr(169);
+ } else SynErr(171);
}
void NegOp() {
@@ -2129,7 +2156,7 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
Get();
} else if (la.kind == 91) {
Get();
- } else SynErr(170);
+ } else SynErr(172);
}
void EndlessExpression(out Expression e) {
@@ -2159,7 +2186,7 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
QuantifierGuts(out e);
break;
}
- case 39: {
+ case 40: {
ComprehensionExpr(out e);
break;
}
@@ -2167,7 +2194,7 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
Get();
x = t;
Expression(out e0);
- Expect(18);
+ Expect(12);
Expression(out e1);
e = new AssertExpr(x, e0, e1);
break;
@@ -2176,19 +2203,19 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
Get();
x = t;
Expression(out e0);
- Expect(18);
+ Expect(12);
Expression(out e1);
e = new AssumeExpr(x, e0, e1);
break;
}
- case 19: {
+ case 20: {
Get();
x = t;
letVars = new List<BoundVar>();
letRHSs = new List<Expression>();
IdentTypeOptional(out d);
letVars.Add(d);
- while (la.kind == 20) {
+ while (la.kind == 21) {
Get();
IdentTypeOptional(out d);
letVars.Add(d);
@@ -2196,17 +2223,17 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
Expect(53);
Expression(out e);
letRHSs.Add(e);
- while (la.kind == 20) {
+ while (la.kind == 21) {
Get();
Expression(out e);
letRHSs.Add(e);
}
- Expect(18);
+ Expect(12);
Expression(out e);
e = new LetExpr(x, letVars, letRHSs, e);
break;
}
- default: SynErr(171); break;
+ default: SynErr(173); break;
}
}
@@ -2217,18 +2244,18 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
Ident(out id);
idents.Add(id);
- while (la.kind == 44) {
+ while (la.kind == 14) {
Get();
Ident(out id);
idents.Add(id);
}
- if (la.kind == 22) {
+ if (la.kind == 23) {
Get();
openParen = t; args = new List<Expression>();
- if (StartOf(9)) {
+ if (StartOf(8)) {
Expressions(args);
}
- Expect(24);
+ Expect(25);
}
e = new IdentifierSequence(idents, openParen, args);
}
@@ -2239,29 +2266,29 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
List<Expression> multipleIndices = null;
bool func = false;
- if (la.kind == 44) {
+ if (la.kind == 14) {
Get();
Ident(out id);
- if (la.kind == 22) {
+ if (la.kind == 23) {
Get();
IToken openParen = t; args = new List<Expression/*!*/>(); func = true;
- if (StartOf(9)) {
+ if (StartOf(8)) {
Expressions(args);
}
- Expect(24);
+ Expect(25);
e = new FunctionCallExpr(id, id.val, e, openParen, args);
}
if (!func) { e = new ExprDotName(id, e, id.val); }
} else if (la.kind == 57) {
Get();
x = t;
- if (StartOf(9)) {
+ if (StartOf(8)) {
Expression(out ee);
e0 = ee;
if (la.kind == 100) {
Get();
anyDots = true;
- if (StartOf(9)) {
+ if (StartOf(8)) {
Expression(out ee);
e1 = ee;
}
@@ -2269,8 +2296,8 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
Get();
Expression(out ee);
e1 = ee;
- } else if (la.kind == 20 || la.kind == 58) {
- while (la.kind == 20) {
+ } else if (la.kind == 21 || la.kind == 58) {
+ while (la.kind == 21) {
Get();
Expression(out ee);
if (multipleIndices == null) {
@@ -2280,15 +2307,15 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
multipleIndices.Add(ee);
}
- } else SynErr(172);
+ } else SynErr(174);
} else if (la.kind == 100) {
Get();
anyDots = true;
- if (StartOf(9)) {
+ if (StartOf(8)) {
Expression(out ee);
e1 = ee;
}
- } else SynErr(173);
+ } else SynErr(175);
if (multipleIndices != null) {
e = new MultiSelectExpr(x, e, multipleIndices);
// make sure an array class with this dimensionality exists
@@ -2312,7 +2339,7 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
}
Expect(58);
- } else SynErr(174);
+ } else SynErr(176);
}
void DisplayExpr(out Expression e) {
@@ -2323,7 +2350,7 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
if (la.kind == 6) {
Get();
x = t; elements = new List<Expression/*!*/>();
- if (StartOf(9)) {
+ if (StartOf(8)) {
Expressions(elements);
}
e = new SetDisplayExpr(x, elements);
@@ -2331,12 +2358,12 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
} else if (la.kind == 57) {
Get();
x = t; elements = new List<Expression/*!*/>();
- if (StartOf(9)) {
+ if (StartOf(8)) {
Expressions(elements);
}
e = new SeqDisplayExpr(x, elements);
Expect(58);
- } else SynErr(175);
+ } else SynErr(177);
}
void MultiSetExpr(out Expression e) {
@@ -2344,25 +2371,25 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
IToken/*!*/ x = null; List<Expression/*!*/>/*!*/ elements;
e = dummyExpr;
- Expect(40);
+ Expect(41);
x = t;
if (la.kind == 6) {
Get();
elements = new List<Expression/*!*/>();
- if (StartOf(9)) {
+ if (StartOf(8)) {
Expressions(elements);
}
e = new MultiSetDisplayExpr(x, elements);
Expect(7);
- } else if (la.kind == 22) {
+ } else if (la.kind == 23) {
Get();
x = t; elements = new List<Expression/*!*/>();
Expression(out e);
e = new MultiSetFormingExpr(x, e);
- Expect(24);
- } else if (StartOf(19)) {
+ Expect(25);
+ } else if (StartOf(18)) {
SemErr("multiset must be followed by multiset literal or expression to coerce in parentheses.");
- } else SynErr(176);
+ } else SynErr(178);
}
void MapExpr(out Expression e) {
@@ -2371,12 +2398,12 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
List<ExpressionPair/*!*/>/*!*/ elements;
e = dummyExpr;
- Expect(42);
+ Expect(43);
x = t;
if (la.kind == 57) {
Get();
elements = new List<ExpressionPair/*!*/>();
- if (StartOf(9)) {
+ if (StartOf(8)) {
MapLiteralExpressions(out elements);
}
e = new MapDisplayExpr(x, elements);
@@ -2389,14 +2416,14 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
IdentTypeOptional(out bv);
bvars.Add(bv);
- Expect(17);
+ Expect(19);
Expression(out range);
QSep();
Expression(out body);
e = new MapComprehension(x, bvars, range, body);
- } else if (StartOf(19)) {
+ } else if (StartOf(18)) {
SemErr("map must be followed by literal in brackets or comprehension.");
- } else SynErr(177);
+ } else SynErr(179);
}
void ConstAtomExpression(out Expression/*!*/ e) {
@@ -2433,47 +2460,47 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
case 96: {
Get();
x = t;
- Expect(22);
+ Expect(23);
Expression(out e);
- Expect(24);
+ Expect(25);
e = new FreshExpr(x, e);
break;
}
case 97: {
Get();
x = t;
- Expect(22);
+ Expect(23);
Expression(out e);
- Expect(24);
+ Expect(25);
e = new AllocatedExpr(x, e);
break;
}
case 98: {
Get();
x = t;
- Expect(22);
+ Expect(23);
Expression(out e);
- Expect(24);
+ Expect(25);
e = new OldExpr(x, e);
break;
}
- case 17: {
+ case 19: {
Get();
x = t;
Expression(out e);
e = new UnaryExpr(x, UnaryExpr.Opcode.SeqLength, e);
- Expect(17);
+ Expect(19);
break;
}
- case 22: {
+ case 23: {
Get();
x = t;
Expression(out e);
e = new ParensExpression(x, e);
- Expect(24);
+ Expect(25);
break;
}
- default: SynErr(178); break;
+ default: SynErr(180); break;
}
}
@@ -2495,7 +2522,7 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
Expect(53);
Expression(out r);
elements.Add(new ExpressionPair(d,r));
- while (la.kind == 20) {
+ while (la.kind == 21) {
Get();
Expression(out d);
Expect(53);
@@ -2509,7 +2536,7 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
Get();
} else if (la.kind == 106) {
Get();
- } else SynErr(179);
+ } else SynErr(181);
}
void MatchExpression(out Expression/*!*/ e) {
@@ -2540,7 +2567,7 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
} else if (la.kind == 103 || la.kind == 104) {
Exists();
x = t;
- } else SynErr(180);
+ } else SynErr(182);
QuantifierDomain(out bvars, out attrs, out range);
QSep();
Expression(out body);
@@ -2560,16 +2587,16 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
Expression/*!*/ range;
Expression body = null;
- Expect(39);
+ Expect(40);
x = t;
IdentTypeOptional(out bv);
bvars.Add(bv);
- while (la.kind == 20) {
+ while (la.kind == 21) {
Get();
IdentTypeOptional(out bv);
bvars.Add(bv);
}
- Expect(17);
+ Expect(19);
Expression(out range);
if (la.kind == 105 || la.kind == 106) {
QSep();
@@ -2589,16 +2616,16 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
Expect(62);
x = t;
Ident(out id);
- if (la.kind == 22) {
+ if (la.kind == 23) {
Get();
IdentTypeOptional(out bv);
arguments.Add(bv);
- while (la.kind == 20) {
+ while (la.kind == 21) {
Get();
IdentTypeOptional(out bv);
arguments.Add(bv);
}
- Expect(24);
+ Expect(25);
}
Expect(63);
Expression(out body);
@@ -2610,7 +2637,7 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
Get();
} else if (la.kind == 102) {
Get();
- } else SynErr(181);
+ } else SynErr(183);
}
void Exists() {
@@ -2618,7 +2645,7 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
Get();
} else if (la.kind == 104) {
Get();
- } else SynErr(182);
+ } else SynErr(184);
}
void AttributeBody(ref Attributes attrs) {
@@ -2629,10 +2656,10 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
Expect(5);
Expect(1);
aName = t.val;
- if (StartOf(20)) {
+ if (StartOf(19)) {
AttributeArg(out aArg);
aArgs.Add(aArg);
- while (la.kind == 20) {
+ while (la.kind == 21) {
Get();
AttributeArg(out aArg);
aArgs.Add(aArg);
@@ -2654,27 +2681,26 @@ List<Expression/*!*/>/*!*/ decreases, ref Attributes decAttrs, ref Attributes mo
}
static readonly bool[,]/*!*/ set = {
- {T,T,T,x, x,x,T,x, T,x,x,x, T,x,T,T, x,T,T,T, x,x,T,x, x,x,x,T, T,x,T,T, T,T,T,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,T, T,x,x,T, x,x,x,x, T,x,x,x, T,T,T,T, T,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,T,T,T, T,T,T,x, x,x,x,x, x,x,x,x, x},
- {x,x,x,x, x,x,x,x, T,T,x,x, T,T,T,T, x,x,x,T, x,T,x,x, x,x,x,T, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x},
- {x,x,x,x, x,x,x,x, T,x,x,x, T,T,T,T, x,x,x,T, x,T,x,x, x,x,x,T, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x},
- {x,x,x,x, x,x,x,x, T,x,x,x, x,T,x,x, x,x,x,T, x,x,x,x, x,x,x,T, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x},
- {T,x,x,x, x,x,T,T, T,T,x,x, T,T,T,T, x,x,x,T, x,T,T,x, x,T,x,T, T,x,x,x, x,T,T,T, x,x,x,x, x,x,x,x, x,T,T,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x},
- {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,T,T, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x},
- {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, T,T,T,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x},
- {x,T,x,T, x,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,T,T,T, T,T,T,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x},
- {T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, T,T,T,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x},
- {x,T,T,x, x,x,T,x, x,x,x,x, x,x,x,x, x,T,x,T, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, T,x,T,x, x,x,x,x, x,x,x,x, x,x,x,T, x,T,x,x, T,x,x,x, x,x,T,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,x, T,x,x,T, T,T,T,T, T,T,T,x, x,T,T,T, T,x,x,x, x},
- {x,T,T,x, x,x,T,x, T,x,x,x, x,x,x,x, x,T,x,T, x,x,T,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,T, T,x,x,T, x,x,x,x, T,x,x,x, T,x,T,T, T,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,T,T,T, T,T,T,x, x,x,x,x, x,x,x,x, x},
- {x,T,T,x, x,x,T,x, x,x,x,x, x,x,x,x, x,T,x,T, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, T,x,T,x, x,x,x,x, T,x,x,x, x,x,x,T, x,T,x,x, T,x,x,x, x,x,T,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,x, T,x,x,T, T,T,T,T, T,T,T,x, x,T,T,T, T,x,x,x, x},
- {T,T,T,x, x,x,T,x, T,x,x,x, x,x,x,x, x,T,x,T, x,x,T,x, x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,T, T,x,x,T, x,x,x,x, T,x,x,x, T,x,T,T, T,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,T,T,T, T,T,T,x, x,x,x,x, x,x,x,x, x},
- {x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, T,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x},
- {x,T,T,x, x,x,T,x, x,x,x,x, x,x,x,x, x,T,x,T, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, T,x,T,x, x,x,x,x, T,x,x,x, x,x,x,T, T,T,x,T, T,x,x,x, x,x,T,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,x, T,x,x,T, T,T,T,T, T,T,T,x, x,T,T,T, T,x,x,x, x},
- {x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,T,T,T, T,T,T,x, x,x,x,x, x,x,x,x, x},
- {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, T,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x},
+ {T,T,T,x, x,x,T,x, T,x,x,x, T,x,x,T, x,T,T,T, T,x,x,T, x,x,x,x, T,T,x,T, T,T,T,T, T,x,x,x, x,x,x,x, x,x,x,x, x,x,T,T, T,x,x,T, x,x,x,x, T,x,x,x, T,T,T,T, T,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,T,T,T, T,T,T,x, x,x,x,x, x,x,x,x, x},
+ {x,x,x,x, x,x,x,x, T,T,x,x, x,x,x,T, T,T,T,x, T,x,T,x, x,x,x,x, T,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x},
+ {x,x,x,x, x,x,x,x, T,x,x,x, x,x,x,x, T,x,x,x, T,x,x,x, x,x,x,x, T,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x},
+ {T,x,x,x, x,x,T,T, T,T,x,x, x,x,x,T, T,T,T,x, T,x,T,T, x,x,T,x, T,T,x,x, x,x,T,T, T,x,x,x, x,x,x,x, x,T,T,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x},
+ {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,T, T,x,x,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x},
+ {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,T,T,T, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x},
+ {x,T,x,T, x,x,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,T,T, T,T,T,T, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x},
+ {T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,T,T,T, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x},
+ {x,T,T,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,T, T,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,T,x,T, x,x,x,x, x,x,x,x, x,x,x,T, x,T,x,x, T,x,x,x, x,x,T,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,x, T,x,x,T, T,T,T,T, T,T,T,x, x,T,T,T, T,x,x,x, x},
+ {x,T,T,x, x,x,T,x, T,x,x,x, x,x,x,x, x,x,x,T, T,x,x,T, x,x,x,x, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,T, T,x,x,T, x,x,x,x, T,x,x,x, T,x,T,T, T,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,T,T,T, T,T,T,x, x,x,x,x, x,x,x,x, x},
+ {x,T,T,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,T, T,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,T,x,T, x,x,x,x, T,x,x,x, x,x,x,T, x,T,x,x, T,x,x,x, x,x,T,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,x, T,x,x,T, T,T,T,T, T,T,T,x, x,T,T,T, T,x,x,x, x},
+ {T,T,T,x, x,x,T,x, T,x,x,x, x,x,x,x, x,x,x,T, T,x,x,T, x,x,x,x, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,T, T,x,x,T, x,x,x,x, T,x,x,x, T,x,T,T, T,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,T,T,T, T,T,T,x, x,x,x,x, x,x,x,x, x},
+ {x,x,x,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,T,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x},
+ {x,T,T,x, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,T, T,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,T,x,T, x,x,x,x, T,x,x,x, x,x,x,T, T,T,x,T, T,x,x,x, x,x,T,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,x, T,x,x,T, T,T,T,T, T,T,T,x, x,T,T,T, T,x,x,x, x},
+ {x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,T,T,T, T,T,T,x, x,x,x,x, x,x,x,x, x},
+ {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,T,x,x, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x},
{x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,T, T,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x},
- {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,T,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,T, T,T,T,T, T,T,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x},
- {x,x,x,x, x,x,T,T, x,x,x,x, x,x,x,x, x,T,T,x, T,x,x,T, T,T,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,T,x,x, x,T,x,x, x,x,T,x, x,T,T,T, x,x,x,x, x,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,x, x,x,x,x, x,x,x,T, T,x,x,x, x,T,T,x, x},
- {x,T,T,x, T,x,T,x, x,x,x,x, x,x,x,x, x,T,x,T, x,x,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, T,x,T,x, x,x,x,x, x,x,x,x, x,x,x,T, x,T,x,x, T,x,x,x, x,x,T,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,x, T,x,x,T, T,T,T,T, T,T,T,x, x,T,T,T, T,x,x,x, x}
+ {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,x,T,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,T, T,T,T,T, T,T,T,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x},
+ {x,x,x,x, x,x,T,T, x,x,x,x, T,x,x,x, x,x,x,T, x,T,x,x, T,T,T,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,T,x,x, x,T,x,x, x,x,T,x, x,T,T,T, x,x,x,x, x,x,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,T, T,T,T,x, x,x,x,x, x,x,x,T, T,x,x,x, x,T,T,x, x},
+ {x,T,T,x, T,x,T,x, x,x,x,x, x,x,x,x, x,x,x,T, T,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, T,T,x,T, x,x,x,x, x,x,x,x, x,x,x,T, x,T,x,x, T,x,x,x, x,x,T,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,x, T,x,x,T, T,T,T,T, T,T,T,x, x,T,T,T, T,x,x,x, x}
};
} // end Parser
@@ -2710,40 +2736,40 @@ public class Errors {
case 8: s = "\"ghost\" expected"; break;
case 9: s = "\"module\" expected"; break;
case 10: s = "\"refines\" expected"; break;
- case 11: s = "\"imports\" expected"; break;
- case 12: s = "\"class\" expected"; break;
- case 13: s = "\"static\" expected"; break;
- case 14: s = "\"datatype\" expected"; break;
- case 15: s = "\"codatatype\" expected"; break;
- case 16: s = "\"=\" expected"; break;
- case 17: s = "\"|\" expected"; break;
- case 18: s = "\";\" expected"; break;
- case 19: s = "\"var\" expected"; break;
- case 20: s = "\",\" expected"; break;
- case 21: s = "\"type\" expected"; break;
- case 22: s = "\"(\" expected"; break;
- case 23: s = "\"==\" expected"; break;
- case 24: s = "\")\" expected"; break;
- case 25: s = "\"<\" expected"; break;
- case 26: s = "\">\" expected"; break;
- case 27: s = "\"method\" expected"; break;
- case 28: s = "\"constructor\" expected"; break;
- case 29: s = "\"returns\" expected"; break;
- case 30: s = "\"...\" expected"; break;
- case 31: s = "\"modifies\" expected"; break;
- case 32: s = "\"free\" expected"; break;
- case 33: s = "\"requires\" expected"; break;
- case 34: s = "\"ensures\" expected"; break;
- case 35: s = "\"decreases\" expected"; break;
- case 36: s = "\"bool\" expected"; break;
- case 37: s = "\"nat\" expected"; break;
- case 38: s = "\"int\" expected"; break;
- case 39: s = "\"set\" expected"; break;
- case 40: s = "\"multiset\" expected"; break;
- case 41: s = "\"seq\" expected"; break;
- case 42: s = "\"map\" expected"; break;
- case 43: s = "\"object\" expected"; break;
- case 44: s = "\".\" expected"; break;
+ case 11: s = "\"=\" expected"; break;
+ case 12: s = "\";\" expected"; break;
+ case 13: s = "\"as\" expected"; break;
+ case 14: s = "\".\" expected"; break;
+ case 15: s = "\"class\" expected"; break;
+ case 16: s = "\"static\" expected"; break;
+ case 17: s = "\"datatype\" expected"; break;
+ case 18: s = "\"codatatype\" expected"; break;
+ case 19: s = "\"|\" expected"; break;
+ case 20: s = "\"var\" expected"; break;
+ case 21: s = "\",\" expected"; break;
+ case 22: s = "\"type\" expected"; break;
+ case 23: s = "\"(\" expected"; break;
+ case 24: s = "\"==\" expected"; break;
+ case 25: s = "\")\" expected"; break;
+ case 26: s = "\"<\" expected"; break;
+ case 27: s = "\">\" expected"; break;
+ case 28: s = "\"method\" expected"; break;
+ case 29: s = "\"constructor\" expected"; break;
+ case 30: s = "\"returns\" expected"; break;
+ case 31: s = "\"...\" expected"; break;
+ case 32: s = "\"modifies\" expected"; break;
+ case 33: s = "\"free\" expected"; break;
+ case 34: s = "\"requires\" expected"; break;
+ case 35: s = "\"ensures\" expected"; break;
+ case 36: s = "\"decreases\" expected"; break;
+ case 37: s = "\"bool\" expected"; break;
+ case 38: s = "\"nat\" expected"; break;
+ case 39: s = "\"int\" expected"; break;
+ case 40: s = "\"set\" expected"; break;
+ case 41: s = "\"multiset\" expected"; break;
+ case 42: s = "\"seq\" expected"; break;
+ case 43: s = "\"map\" expected"; break;
+ case 44: s = "\"object\" expected"; break;
case 45: s = "\"function\" expected"; break;
case 46: s = "\"predicate\" expected"; break;
case 47: s = "\"reads\" expected"; break;
@@ -2808,80 +2834,82 @@ public class Errors {
case 106: s = "\"\\u2022\" expected"; break;
case 107: s = "??? expected"; break;
case 108: s = "invalid Dafny"; break;
- case 109: s = "this symbol not expected in ClassDecl"; break;
- case 110: s = "this symbol not expected in DatatypeDecl"; break;
- case 111: s = "invalid DatatypeDecl"; break;
+ case 109: s = "invalid SubModuleDecl"; break;
+ case 110: s = "invalid SubModuleDecl"; break;
+ case 111: s = "this symbol not expected in ClassDecl"; break;
case 112: s = "this symbol not expected in DatatypeDecl"; break;
- case 113: s = "this symbol not expected in ArbitraryTypeDecl"; break;
- case 114: s = "invalid ClassMemberDecl"; break;
- case 115: s = "this symbol not expected in FieldDecl"; break;
- case 116: s = "this symbol not expected in FieldDecl"; break;
- case 117: s = "invalid FunctionDecl"; break;
- case 118: s = "invalid FunctionDecl"; break;
+ case 113: s = "invalid DatatypeDecl"; break;
+ case 114: s = "this symbol not expected in DatatypeDecl"; break;
+ case 115: s = "this symbol not expected in ArbitraryTypeDecl"; break;
+ case 116: s = "invalid ClassMemberDecl"; break;
+ case 117: s = "this symbol not expected in FieldDecl"; break;
+ case 118: s = "this symbol not expected in FieldDecl"; break;
case 119: s = "invalid FunctionDecl"; break;
- case 120: s = "this symbol not expected in MethodDecl"; break;
- case 121: s = "invalid MethodDecl"; break;
- case 122: s = "invalid MethodDecl"; break;
- case 123: s = "invalid TypeAndToken"; break;
- case 124: s = "this symbol not expected in MethodSpec"; break;
- case 125: s = "this symbol not expected in MethodSpec"; break;
+ case 120: s = "invalid FunctionDecl"; break;
+ case 121: s = "invalid FunctionDecl"; break;
+ case 122: s = "this symbol not expected in MethodDecl"; break;
+ case 123: s = "invalid MethodDecl"; break;
+ case 124: s = "invalid MethodDecl"; break;
+ case 125: s = "invalid TypeAndToken"; break;
case 126: s = "this symbol not expected in MethodSpec"; break;
case 127: s = "this symbol not expected in MethodSpec"; break;
- case 128: s = "invalid MethodSpec"; break;
+ case 128: s = "this symbol not expected in MethodSpec"; break;
case 129: s = "this symbol not expected in MethodSpec"; break;
case 130: s = "invalid MethodSpec"; break;
- case 131: s = "invalid ReferenceType"; break;
- case 132: s = "this symbol not expected in FunctionSpec"; break;
- case 133: s = "this symbol not expected in FunctionSpec"; break;
+ case 131: s = "this symbol not expected in MethodSpec"; break;
+ case 132: s = "invalid MethodSpec"; break;
+ case 133: s = "invalid ReferenceType"; break;
case 134: s = "this symbol not expected in FunctionSpec"; break;
case 135: s = "this symbol not expected in FunctionSpec"; break;
case 136: s = "this symbol not expected in FunctionSpec"; break;
- case 137: s = "invalid FunctionSpec"; break;
- case 138: s = "invalid PossiblyWildFrameExpression"; break;
- case 139: s = "invalid PossiblyWildExpression"; break;
- case 140: s = "this symbol not expected in OneStmt"; break;
- case 141: s = "invalid OneStmt"; break;
+ case 137: s = "this symbol not expected in FunctionSpec"; break;
+ case 138: s = "this symbol not expected in FunctionSpec"; break;
+ case 139: s = "invalid FunctionSpec"; break;
+ case 140: s = "invalid PossiblyWildFrameExpression"; break;
+ case 141: s = "invalid PossiblyWildExpression"; break;
case 142: s = "this symbol not expected in OneStmt"; break;
case 143: s = "invalid OneStmt"; break;
- case 144: s = "invalid AssertStmt"; break;
- case 145: s = "invalid AssumeStmt"; break;
- case 146: s = "invalid UpdateStmt"; break;
- case 147: s = "invalid UpdateStmt"; break;
- case 148: s = "invalid IfStmt"; break;
- case 149: s = "invalid IfStmt"; break;
- case 150: s = "invalid WhileStmt"; break;
- case 151: s = "invalid WhileStmt"; break;
- case 152: s = "invalid Rhs"; break;
- case 153: s = "invalid Lhs"; break;
- case 154: s = "invalid Guard"; break;
- case 155: s = "this symbol not expected in LoopSpec"; break;
- case 156: s = "this symbol not expected in LoopSpec"; break;
+ case 144: s = "this symbol not expected in OneStmt"; break;
+ case 145: s = "invalid OneStmt"; break;
+ case 146: s = "invalid AssertStmt"; break;
+ case 147: s = "invalid AssumeStmt"; break;
+ case 148: s = "invalid UpdateStmt"; break;
+ case 149: s = "invalid UpdateStmt"; break;
+ case 150: s = "invalid IfStmt"; break;
+ case 151: s = "invalid IfStmt"; break;
+ case 152: s = "invalid WhileStmt"; break;
+ case 153: s = "invalid WhileStmt"; break;
+ case 154: s = "invalid Rhs"; break;
+ case 155: s = "invalid Lhs"; break;
+ case 156: s = "invalid Guard"; break;
case 157: s = "this symbol not expected in LoopSpec"; break;
case 158: s = "this symbol not expected in LoopSpec"; break;
case 159: s = "this symbol not expected in LoopSpec"; break;
- case 160: s = "this symbol not expected in Invariant"; break;
- case 161: s = "invalid AttributeArg"; break;
- case 162: s = "invalid EquivOp"; break;
- case 163: s = "invalid ImpliesOp"; break;
- case 164: s = "invalid AndOp"; break;
- case 165: s = "invalid OrOp"; break;
- case 166: s = "invalid RelOp"; break;
- case 167: s = "invalid AddOp"; break;
- case 168: s = "invalid UnaryExpression"; break;
- case 169: s = "invalid MulOp"; break;
- case 170: s = "invalid NegOp"; break;
- case 171: s = "invalid EndlessExpression"; break;
- case 172: s = "invalid Suffix"; break;
- case 173: s = "invalid Suffix"; break;
+ case 160: s = "this symbol not expected in LoopSpec"; break;
+ case 161: s = "this symbol not expected in LoopSpec"; break;
+ case 162: s = "this symbol not expected in Invariant"; break;
+ case 163: s = "invalid AttributeArg"; break;
+ case 164: s = "invalid EquivOp"; break;
+ case 165: s = "invalid ImpliesOp"; break;
+ case 166: s = "invalid AndOp"; break;
+ case 167: s = "invalid OrOp"; break;
+ case 168: s = "invalid RelOp"; break;
+ case 169: s = "invalid AddOp"; break;
+ case 170: s = "invalid UnaryExpression"; break;
+ case 171: s = "invalid MulOp"; break;
+ case 172: s = "invalid NegOp"; break;
+ case 173: s = "invalid EndlessExpression"; break;
case 174: s = "invalid Suffix"; break;
- case 175: s = "invalid DisplayExpr"; break;
- case 176: s = "invalid MultiSetExpr"; break;
- case 177: s = "invalid MapExpr"; break;
- case 178: s = "invalid ConstAtomExpression"; break;
- case 179: s = "invalid QSep"; break;
- case 180: s = "invalid QuantifierGuts"; break;
- case 181: s = "invalid Forall"; break;
- case 182: s = "invalid Exists"; break;
+ case 175: s = "invalid Suffix"; break;
+ case 176: s = "invalid Suffix"; break;
+ case 177: s = "invalid DisplayExpr"; break;
+ case 178: s = "invalid MultiSetExpr"; break;
+ case 179: s = "invalid MapExpr"; break;
+ case 180: s = "invalid ConstAtomExpression"; break;
+ case 181: s = "invalid QSep"; break;
+ case 182: s = "invalid QuantifierGuts"; break;
+ case 183: s = "invalid Forall"; break;
+ case 184: s = "invalid Exists"; break;
default: s = "error " + n; break;
}