PageRenderTime 6ms CodeModel.GetById 2ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/tutorial/backtracking/expand_expression/abstract/expand_sequence.e

http://github.com/tybor/Liberty
Specman e | 46 lines | 23 code | 5 blank | 18 comment | 1 complexity | a14c58f93da0e463ba75162dd935c847 MD5 | raw file
 1-- See the Copyright notice at the end of this file.
 2--
 3class EXPAND_SEQUENCE
 4
 5inherit
 6	ABSTRACT_BACKTRACKING_SEQUENCE
 7	EXPRESSION_ITEM_GLOBALS
 8
 9feature {ABSTRACT_BACKTRACKING}
10	next_sequence (explorer: EXPAND_EXPRESSION) is
11		do
12			if Iterate and then item.type = And_item then
13				explorer.goto_item(item.first)
14				item := item.second
15			else
16				explorer.goto_item(item)
17				explorer.pop_sequence
18			end
19		end
20
21feature {}
22	item: EXPRESSION_ITEM
23
24feature {EXPAND_EXPRESSION}
25	make (itm: EXPRESSION_ITEM) is
26		do
27			item := itm
28		end
29
30end -- class EXPAND_SEQUENCE
31--
32-- ------------------------------------------------------------------------------------------------------------------------------
33-- Copyright notice below. Please read.
34--
35-- This file is free software, which comes along with SmartEiffel. This software is distributed in the hope that it will be
36-- useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
37-- You can modify it as you want, provided this footer is kept unaltered, and a notification of the changes is added.
38-- You are allowed to redistribute it and sell it, alone or as a part of another product.
39--
40-- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P.       - University of Nancy 1 - FRANCE
41-- Copyright(C) 2003-2005: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
42--
43-- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
44--
45-- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
46-- ------------------------------------------------------------------------------------------------------------------------------