/src/lib/parse/parse_error.e
Specman e | 76 lines | 47 code | 6 blank | 23 comment | 3 complexity | f72feef2aaa33cc35fe9dce4219420fb MD5 | raw file
1-- This file is part of a Liberty Eiffel library. 2-- See the full copyright at the end. 3-- 4class PARSE_ERROR 5 6create {ANY} 7 make 8 9feature {ANY} 10 index: INTEGER 11 message: STRING 12 next: PARSE_ERROR 13 14feature {PARSE_ERROR} 15 set_next (a_next: like next) 16 require 17 a_next /= Void 18 a_next /= Current 19 do 20 if next = Void then 21 next := a_next 22 else 23 next.set_next(a_next) 24 end 25 ensure 26 last = a_next 27 end 28 29 last: PARSE_ERROR 30 do 31 if next = Void then 32 Result := Current 33 else 34 Result := next.last 35 end 36 ensure 37 Result /= Void 38 end 39 40feature {} 41 make (a_index: like index; a_message: like message; a_previous: PARSE_ERROR) 42 require 43 a_message /= Void 44 do 45 index := a_index 46 message := a_message 47 if a_previous /= Void then 48 a_previous.set_next(Current) 49 end 50 ensure 51 index = a_index 52 message = a_message 53 a_previous /= Void implies a_previous.last = Current 54 end 55 56end -- class PARSE_ERROR 57-- 58-- Copyright (C) 2009-2017: by all the people cited in the AUTHORS file. 59-- 60-- Permission is hereby granted, free of charge, to any person obtaining a copy 61-- of this software and associated documentation files (the "Software"), to deal 62-- in the Software without restriction, including without limitation the rights 63-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 64-- copies of the Software, and to permit persons to whom the Software is 65-- furnished to do so, subject to the following conditions: 66-- 67-- The above copyright notice and this permission notice shall be included in 68-- all copies or substantial portions of the Software. 69-- 70-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 71-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 72-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 73-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 74-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 75-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 76-- THE SOFTWARE.