/src/lib/parse/default_mini_parser_memory.e
Specman e | 48 lines | 17 code | 5 blank | 26 comment | 0 complexity | 43450bc447c222692ce608e568b516e1 MD5 | raw file
1-- This file is part of a Liberty Eiffel library. 2-- See the full copyright at the end. 3-- 4class DEFAULT_MINI_PARSER_MEMORY 5 -- 6 -- Default MINI_PARSER_BUFFER representation: the index itself. 7 -- 8 9inherit 10 MINI_PARSER_MEMORY 11 12feature {ANY} 13 memo (buffer: MINI_PARSER_BUFFER): INTEGER is 14 do 15 Result := buffer.current_index 16 end 17 18 restore (a_memo: like memo; buffer: MINI_PARSER_BUFFER) is 19 do 20 buffer.set_current_index(a_memo) 21 end 22 23 valid_memo (a_memo: like memo; buffer: MINI_PARSER_BUFFER): BOOLEAN is 24 do 25 Result := a_memo.in_range(buffer.lower, buffer.upper + 1) 26 end 27 28end -- class DEFAULT_MINI_PARSER_MEMORY 29-- 30-- Copyright (c) 2009 by all the people cited in the AUTHORS file. 31-- 32-- Permission is hereby granted, free of charge, to any person obtaining a copy 33-- of this software and associated documentation files (the "Software"), to deal 34-- in the Software without restriction, including without limitation the rights 35-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 36-- copies of the Software, and to permit persons to whom the Software is 37-- furnished to do so, subject to the following conditions: 38-- 39-- The above copyright notice and this permission notice shall be included in 40-- all copies or substantial portions of the Software. 41-- 42-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 43-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 44-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 45-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 46-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 47-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 48-- THE SOFTWARE.