aboutsummaryrefslogtreecommitdiffstats
path: root/Grammar.pp
diff options
context:
space:
mode:
authorIvan Enderlin <ivan.enderlin@hoa-project.net>2013-06-10 14:58:35 +0200
committerIvan Enderlin <ivan.enderlin@hoa-project.net>2013-06-10 14:58:35 +0200
commit467d39b9047547ff94a37fdcb8805623ef09d542 (patch)
tree9fbb23471e3718c35546d4b6ff0a1e959a18459d /Grammar.pp
parentd2f8208f2951691b550d912b5f725d2371af9e9a (diff)
downloadPraspel-467d39b9047547ff94a37fdcb8805623ef09d542.zip
Praspel-467d39b9047547ff94a37fdcb8805623ef09d542.tar.gz
Praspel-467d39b9047547ff94a37fdcb8805623ef09d542.tar.bz2
Add the @default clause!
The default clause represents a default/else behavior.
Diffstat (limited to 'Grammar.pp')
-rw-r--r--Grammar.pp20
1 files changed, 17 insertions, 3 deletions
diff --git a/Grammar.pp b/Grammar.pp
index 9a18dab..62cfaf7 100644
--- a/Grammar.pp
+++ b/Grammar.pp
@@ -52,6 +52,7 @@
%token at_throwable @throwable
%token at_invariant @invariant
%token at_behavior @behavior
+%token at_default @default
%token at_description @description
// Constructions.
@@ -126,7 +127,8 @@ method:
| invariant()
)
::semicolon::+
- | ( behavior() | description() ) ::semicolon::*
+ | ( behavior() ::semicolon::* )+ default()? ::semicolon::*
+ | description() ::semicolon::*
#is:
::at_is:: <pure>
@@ -156,11 +158,23 @@ behavior_content:
| throwable()
| invariant()
)
- ::semicolon::
- | behavior() ::semicolon::?
+ ::semicolon::+
+ | ( behavior() ::semicolon::* )+ default()? ::semicolon::*
)+
::_brace:: #behavior
+#default:
+ ::at_default:: ::brace_::
+ (
+ (
+ ensures()
+ | throwable()
+ | invariant()
+ )
+ ::semicolon::+
+ )+
+ ::_brace::
+
#description:
::at_description:: string()