PageRenderTime 4ms CodeModel.GetById 1ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/src/lib/regular_expression/internal/regular_expression_items/regular_expression_item_end_group.e

http://github.com/tybor/Liberty
Specman e | 55 lines | 22 code | 6 blank | 27 comment | 0 complexity | bb20dc6d8d2c224dee167100849bf318 MD5 | raw file
 1-- This file is part of a Liberty Eiffel library.
 2-- See the full copyright at the end.
 3--
 4class REGULAR_EXPRESSION_ITEM_END_GROUP
 5   --
 6   -- record the end position of a group
 7   --
 8
 9inherit
10   REGULAR_EXPRESSION_ITEM
11
12create {ANY}
13   make
14
15feature {ANY}
16   number: INTEGER
17         -- the number of the group
18
19   make (num: INTEGER)
20      require
21         natural_number: num >= 0
22      do
23         number := num
24      ensure
25         definition: number = num
26         natural_number: number >= 0
27      end
28
29   explore (matcher: BACKTRACKING_REGULAR_EXPRESSION)
30      do
31         matcher.set_group_last_index(number)
32         matcher.continue
33      end
34
35end -- class REGULAR_EXPRESSION_ITEM_END_GROUP
36--
37-- Copyright (C) 2009-2017: by all the people cited in the AUTHORS file.
38--
39-- Permission is hereby granted, free of charge, to any person obtaining a copy
40-- of this software and associated documentation files (the "Software"), to deal
41-- in the Software without restriction, including without limitation the rights
42-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
43-- copies of the Software, and to permit persons to whom the Software is
44-- furnished to do so, subject to the following conditions:
45--
46-- The above copyright notice and this permission notice shall be included in
47-- all copies or substantial portions of the Software.
48--
49-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
50-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
51-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
52-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
53-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
54-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
55-- THE SOFTWARE.