aboutsummaryrefslogtreecommitdiffstats
path: root/Grammar.pp
diff options
context:
space:
mode:
authorIvan Enderlin <ivan.enderlin@hoa-project.net>2013-04-09 18:08:51 +0200
committerIvan Enderlin <ivan.enderlin@hoa-project.net>2013-04-09 18:08:51 +0200
commitaf13e47350ad298432aef013e590e8ad1292b543 (patch)
tree401b16fba26a54e46fd2f14a8c672e03987d188f /Grammar.pp
parentf9b766ceefeb3c996df7e7758ae878b9bf5b22f7 (diff)
downloadPraspel-af13e47350ad298432aef013e590e8ad1292b543.zip
Praspel-af13e47350ad298432aef013e590e8ad1292b543.tar.gz
Praspel-af13e47350ad298432aef013e590e8ad1292b543.tar.bz2
Add local variable with the “let” keyword.
A local variable is a contract variable, it does not represent a data of the program (class attribute or method argument). In Praspel: @requires let size: 1..5 and arr: array([…], size); In PHP $requires = $specification->getClause('requires'); $requires->let['size']->in = realdom()->boundinteger(1, 5); $requires['arr']->in = realdom()->array(…, $requires['size']);
Diffstat (limited to 'Grammar.pp')
-rw-r--r--Grammar.pp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Grammar.pp b/Grammar.pp
index 1fe9dd0..3617f51 100644
--- a/Grammar.pp
+++ b/Grammar.pp
@@ -96,6 +96,7 @@
%token default …|default
%token contains contains
%token is is
+%token let let
// Constants.
%token null null|void
@@ -178,6 +179,7 @@ exception:
// NO
#declaration:
+ ( ::let:: #local_declaration )?
extended_identifier() ::colon:: representation()
representation: