PageRenderTime 14ms CodeModel.GetById 12ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 1ms

/src/tools/syntax/tree/liberty_ast_when_value.e

http://github.com/tybor/Liberty
Specman e | 83 lines | 55 code | 14 blank | 14 comment | 0 complexity | 5a7afd28a88e0d0afbbddc3f30ed149c MD5 | raw file
 1-- This file is part of Liberty Eiffel.
 2--
 3-- Liberty Eiffel is free software: you can redistribute it and/or modify
 4-- it under the terms of the GNU General Public License as published by
 5-- the Free Software Foundation, version 3 of the License.
 6--
 7-- Liberty Eiffel is distributed in the hope that it will be useful,
 8-- but WITHOUT ANY WARRANTY; without even the implied warranty of
 9-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10-- GNU General Public License for more details.
11--
12-- You should have received a copy of the GNU General Public License
13-- along with Liberty Eiffel.  If not, see <http://www.gnu.org/licenses/>.
14--
15class LIBERTY_AST_WHEN_VALUE
16
17inherit
18   LIBERTY_AST_NON_TERMINAL_NODE
19
20create {LIBERTY_NODE_FACTORY}
21   make
22
23feature {LIBERTY_AST_HANDLER}
24   is_number: BOOLEAN is
25      do
26         Result := nodes.first.name.is_equal(once "KW number")
27      end
28
29   number: LIBERTY_AST_NUMBER is
30      require
31         is_number
32      do
33         Result ::= nodes.first
34      end
35
36   is_character: BOOLEAN is
37      do
38         Result := nodes.first.name.is_equal(once "KW character")
39      end
40
41   character: LIBERTY_AST_CHARACTER is
42      require
43         is_character
44      do
45         Result ::= nodes.first
46      end
47
48   is_string: BOOLEAN is
49      do
50         Result := nodes.first.name.is_equal(once "KW string")
51      end
52
53   string: LIBERTY_AST_STRING is
54      require
55         is_string
56      do
57         Result ::= nodes.first
58      end
59
60   is_entity_name: BOOLEAN is
61      do
62         Result := nodes.first.name.is_equal(once "KW entity name")
63      end
64
65   entity_name: LIBERTY_AST_ENTITY_NAME is
66      require
67         is_entity_name
68      do
69         Result ::= nodes.first
70      end
71
72feature {ANY}
73   count: INTEGER is 1
74
75   name: STRING is "When_Value"
76
77feature {}
78   possible_counts: SET[INTEGER] is
79      once
80         Result := {AVL_SET[INTEGER] << 1 >> }
81      end
82
83end