/[eiffelstudio]/branches/eth/eve/Src/Eiffel/API/evaluated_type/character_a.e
ViewVC logotype

Contents of /branches/eth/eve/Src/Eiffel/API/evaluated_type/character_a.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 89347 - (show annotations)
Fri Aug 10 15:09:25 2012 UTC (7 years, 4 months ago) by jasonw
File size: 3311 byte(s)
<<Merged from trunk#89346.>>
1 note
2 description: "Actual type for character type."
3 legal: "See notice at end of class."
4 status: "See notice at end of class."
5 date: "$Date$"
6 revision: "$Revision $"
7
8 class CHARACTER_A
9
10 inherit
11 BASIC_A
12 rename
13 make as cl_make
14 redefine
15 is_character, is_character_32, base_class, same_as, process,
16 minimum_interval_value,
17 maximum_interval_value
18 end
19
20 create
21 make
22
23 feature -- Initialization
24
25 make (w: BOOLEAN)
26 -- Create instance of CHARACTER_A. If `w' a normal character.
27 -- Otherwise a wide character.
28 do
29 is_character_32 := w
30 cl_make (base_class.class_id)
31 ensure
32 is_character_32_set: is_character_32 = w
33 end
34
35 feature -- Visitor
36
37 process (v: TYPE_A_VISITOR)
38 -- Process current element.
39 do
40 v.process_character_a (Current)
41 end
42
43 feature -- Property
44
45 is_character: BOOLEAN = True
46 -- Is the current type a character type ?
47
48 is_character_32: BOOLEAN
49 -- Is the type a character 32 bits type?
50
51 feature -- Access
52
53 same_as (other: TYPE_A): BOOLEAN
54 -- Is the current type the same as `other' ?
55 do
56 Result := attached {CHARACTER_A} other as c and then is_character_32 = c.is_character_32
57 end
58
59 base_class: CLASS_C
60 -- Class CHARACTER
61 do
62 if is_character_32 then
63 Result := System.character_32_class.compiled_class
64 else
65 Result := System.character_8_class.compiled_class
66 end
67 end
68
69 feature -- IL code generation
70
71 minimum_interval_value: CHAR_VAL_B
72 -- Minimum value in inspect interval for current type
73 do
74 create Result.make ('%/0/')
75 end
76
77 maximum_interval_value: CHAR_VAL_B
78 -- Maximum value in inspect interval for current type
79 do
80 if is_character_32 then
81 create Result.make ({CHARACTER_32}.max_value.to_character_32)
82 else
83 create Result.make ({CHARACTER_8}.Max_value.to_character_8)
84 end
85 end
86
87 feature -- Access
88
89 c_type: CHAR_I
90 -- C type
91 do
92 if is_character_32 then
93 Result := Wide_char_c_type
94 else
95 Result := Char_c_type
96 end
97 end
98
99 note
100 copyright: "Copyright (c) 1984-2007, Eiffel Software"
101 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
102 licensing_options: "http://www.eiffel.com/licensing"
103 copying: "[
104 This file is part of Eiffel Software's Eiffel Development Environment.
105
106 Eiffel Software's Eiffel Development Environment is free
107 software; you can redistribute it and/or modify it under
108 the terms of the GNU General Public License as published
109 by the Free Software Foundation, version 2 of the License
110 (available at the URL listed under "license" above).
111
112 Eiffel Software's Eiffel Development Environment is
113 distributed in the hope that it will be useful, but
114 WITHOUT ANY WARRANTY; without even the implied warranty
115 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
116 See the GNU General Public License for more details.
117
118 You should have received a copy of the GNU General Public
119 License along with Eiffel Software's Eiffel Development
120 Environment; if not, write to the Free Software Foundation,
121 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
122 ]"
123 source: "[
124 Eiffel Software
125 356 Storke Road, Goleta, CA 93117 USA
126 Telephone 805-685-1006, Fax 805-685-6869
127 Website http://www.eiffel.com
128 Customer support http://support.eiffel.com
129 ]"
130
131 end -- class CHARACTER_A

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.23