diff options
author | Rustan Leino <leino@microsoft.com> | 2011-12-07 16:49:25 -0800 |
---|---|---|
committer | Rustan Leino <leino@microsoft.com> | 2011-12-07 16:49:25 -0800 |
commit | b983b07b26bf9698706e62d50560a9339a341183 (patch) | |
tree | 262dceeae448beea782287120c1bdd9991914003 /Source/Dafny/Dafny.atg | |
parent | 27c1f51bf703cf1c1ebedec761219761e035b5c0 (diff) | |
parent | 9a4fb1d4124ea77f7a11e2c1b033f12567a3663b (diff) |
Merge
Diffstat (limited to 'Source/Dafny/Dafny.atg')
-rw-r--r-- | Source/Dafny/Dafny.atg | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/Source/Dafny/Dafny.atg b/Source/Dafny/Dafny.atg index 7019a22b..6b12a288 100644 --- a/Source/Dafny/Dafny.atg +++ b/Source/Dafny/Dafny.atg @@ -134,7 +134,7 @@ IGNORE cr + lf + tab /*------------------------------------------------------------------------*/
PRODUCTIONS
Dafny
-= (. ClassDecl/*!*/ c; DatatypeDecl/*!*/ dt;
+= (. ClassDecl/*!*/ c; DatatypeDecl/*!*/ dt; ArbitraryTypeDecl at;
Attributes attrs; IToken/*!*/ id; List<string/*!*/> theImports;
List<MemberDecl/*!*/> membersDefaultClass = new List<MemberDecl/*!*/>();
ModuleDecl module;
@@ -157,11 +157,13 @@ Dafny "{" (. module.BodyStartTok = t; .)
{ ClassDecl<module, out c> (. module.TopLevelDecls.Add(c); .)
| DatatypeDecl<module, out dt> (. module.TopLevelDecls.Add(dt); .)
+ | ArbitraryTypeDecl<module, out at>(. module.TopLevelDecls.Add(at); .)
}
"}" (. module.BodyEndTok = t;
theModules.Add(module); .)
- | ClassDecl<defaultModule, out c> (. defaultModule.TopLevelDecls.Add(c); .)
- | DatatypeDecl<defaultModule, out dt> (. defaultModule.TopLevelDecls.Add(dt); .)
+ | ClassDecl<defaultModule, out c> (. defaultModule.TopLevelDecls.Add(c); .)
+ | DatatypeDecl<defaultModule, out dt> (. defaultModule.TopLevelDecls.Add(dt); .)
+ | ArbitraryTypeDecl<defaultModule, out at> (. defaultModule.TopLevelDecls.Add(at); .)
| ClassMemberDecl<membersDefaultClass, false>
}
(. if (defaultModuleCreatedHere) {
@@ -276,6 +278,14 @@ FieldDecl<.MemberModifiers mmod, List<MemberDecl/*!*/>/*!*/ mm.> }
SYNC ";"
.
+ArbitraryTypeDecl<ModuleDecl/*!*/ module, out ArbitraryTypeDecl at>
+= (. IToken/*!*/ id;
+ Attributes attrs = null;
+ .)
+ "type"
+ { Attribute<ref attrs> }
+ Ident<out id> (. at = new ArbitraryTypeDecl(id, id.val, module, attrs); .)
+ .
CouplingInvDecl<.MemberModifiers mmod, List<MemberDecl/*!*/>/*!*/ mm.>
= (. Contract.Requires(cce.NonNullElements(mm));
Attributes attrs = null;
|