Skip to content
Browse files

Changed modeling of constraints (represented by CONSTRAINT_LIST) to a…

…void CATCalls. The appropriate changes have been made in the parser spec as well.
  • Loading branch information...
1 parent 67316fc commit e39fb9a36c905f3b228c1b65a5a4a6f09c76cae3 @tdidriksen committed Mar 27, 2012
Showing with 1,582 additions and 1,570 deletions.
  1. +11 −11 library/mog/lists/constraint_list.e
  2. +1,554 −1,555 src/parser/bon_parser.e
  3. +17 −4 src/parser/bon_parser.y
View
22 library/mog/lists/constraint_list.e
@@ -5,21 +5,21 @@ class
CONSTRAINT_LIST
inherit
- STRING_LIST
- redefine
- to_set
- end
+ MOG_LIST [STRING]
-creation
- make, make_optional_rest, make_optional_first, make_from_list,
- make_from_string_list
+create
+ make_list, make_optional_rest, make_optional_first,
+ make_from_list, make_from_set, make_from_string_list,
+ make_from_linear
-feature -- Conversion
+feature -- Initialization
- to_set: CONSTRAINT_SET is
- -- Convert `Current' into a constraint set.
+ make_from_string_list (a_list: CONSTRAINT_LIST)
+ -- Initialize `Current' to the contents of 'a_list'.
do
- check false end
+ make_from_list (a_list)
+ ensure
+ is_equal (a_list)
end
end -- class CONSTRAINT_LIST
View
3,109 src/parser/bon_parser.e
1,554 additions, 1,555 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
21 src/parser/bon_parser.y
@@ -297,7 +297,8 @@ create
%type <COMMAND_LIST> Command_list Optional_Command_list At_least_one_Command Optional_Commands
%type <STRING> Command
-%type <CONSTRAINT_LIST> Constraint_list Optional_Constraint_list
+%type <CONSTRAINT_LIST> Constraint_list Optional_Constraint_list At_least_one_Constraint Optional_Constraints
+%type <STRING> Constraint
%type <STRING_LIST> At_least_one_Manifest_string Optional_Manifest_strings
@@ -746,20 +747,32 @@ Command_list : At_least_one_Command
-- @type like Command_list
At_least_one_Command : Command Optional_Commands
- { create $$.make_optional_rest($1, $2) } ;
+ { create $$.make_optional_rest ($1, $2) } ;
-- @type like Command_list
Optional_Commands: -- Empty
| Optional_Commands ',' Command
- { create $$.make_optional_first($1, $3) } ;
+ { create $$.make_optional_first ($1, $3) } ;
-- @type STRING
Command : Manifest_string { $$ := $1 } ;
-- @type CONSTRAINT_LIST
-Constraint_list : At_least_one_Manifest_string
+Constraint_list : At_least_one_Constraint
{ create $$.make_from_string_list ($1) } ;
+-- @type like Constraint_list
+At_least_one_Constraint : Constraint Optional_Constraints
+ { create $$.make_optional_rest ($1, $2) } ;
+
+-- @type like Constraint_list
+Optional_Constraints : -- Empty
+ | Optional_Constraints ',' Constraint
+ { create $$.make_optional_first ($1, $3) } ;
+
+-- @type STRING
+Constraint : Manifest_string { $$ := $1 } ;
+
-- @type STRING_LIST
At_least_one_Manifest_string : Manifest_string Optional_Manifest_strings
{ create $$.make_optional_rest ($1, $2) } ;

0 comments on commit e39fb9a

Please sign in to comment.
Something went wrong with that request. Please try again.