PageRenderTime 57ms CodeModel.GetById 51ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 1ms

/src/lib/parse/eiffel/eiffel_image.e

http://github.com/tybor/Liberty
Specman e | 74 lines | 36 code | 11 blank | 27 comment | 0 complexity | 2fef00c76d4e81f195eb0fdcaceb5030 MD5 | raw file
 1-- This file is part of a Liberty Eiffel library.
 2-- See the full copyright at the end.
 3--
 4deferred class EIFFEL_IMAGE
 5
 6inherit
 7   PARSER_IMAGE
 8      redefine
 9         out_in_tagged_out_memory, is_equal
10      end
11
12feature {ANY}
13   is_equal (other: like Current): BOOLEAN is
14         -- Redefined because SmartEiffel's default is_equal generates bad code in some strange situations
15      do
16         Result := position = other.position
17            and then image.is_equal(other.image)
18      end
19
20feature {ANY}
21   image: STRING
22         -- the real image of the token
23
24   blanks: STRING
25         -- the leading blanks and comments (before the `image' itself)
26
27   line: INTEGER is
28      do
29         Result := position.line
30      end
31
32   column: INTEGER is
33      do
34         Result := position.column
35      end
36
37   index: INTEGER is
38      do
39         Result := position.index
40      end
41
42   out_in_tagged_out_memory is
43      do
44         tagged_out_memory.append(image)
45      end
46
47feature {EIFFEL_IMAGE}
48   position: EIFFEL_POSITION
49         -- the position of the `image' (discarding the leading `blanks')
50
51invariant
52   image /= Void
53
54end -- class EIFFEL_IMAGE
55--
56-- Copyright (c) 2009 by all the people cited in the AUTHORS file.
57--
58-- Permission is hereby granted, free of charge, to any person obtaining a copy
59-- of this software and associated documentation files (the "Software"), to deal
60-- in the Software without restriction, including without limitation the rights
61-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
62-- copies of the Software, and to permit persons to whom the Software is
63-- furnished to do so, subject to the following conditions:
64--
65-- The above copyright notice and this permission notice shall be included in
66-- all copies or substantial portions of the Software.
67--
68-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
69-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
70-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
71-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
72-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
73-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
74-- THE SOFTWARE.