PageRenderTime 23ms CodeModel.GetById 18ms app.highlight 1ms RepoModel.GetById 2ms app.codeStats 0ms

/src/tools/syntax/tree/liberty_ast_do_block.e

http://github.com/tybor/Liberty
Specman e | 70 lines | 46 code | 10 blank | 14 comment | 0 complexity | 91333a5b925a720d908e09734bbc36f8 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_DO_BLOCK
16
17inherit
18   LIBERTY_AST_LIST[LIBERTY_AST_INSTRUCTION]
19      redefine
20         possible_counts
21      end
22
23create {LIBERTY_NODE_FACTORY}
24   make
25
26feature {LIBERTY_AST_HANDLER}
27   is_do: BOOLEAN is
28      do
29         Result := keyword.name.is_equal(once "KW do")
30      ensure
31         Result implies count = 3
32      end
33
34   is_once: BOOLEAN is
35      do
36         Result := keyword.name.is_equal(once "KW once")
37      ensure
38         Result implies count = 3
39      end
40
41   is_deferred: BOOLEAN is
42      do
43         Result := keyword.name.is_equal(once "KW deferred")
44      ensure
45         Result implies count = 1
46      end
47
48   is_attribute: BOOLEAN is
49      do
50         Result := keyword.name.is_equal(once "KW attribute")
51      ensure
52         Result implies count = 1
53      end
54
55feature {}
56   keyword: EIFFEL_TERMINAL_NODE is
57      do
58         Result ::= nodes.item(0)
59      end
60
61feature {ANY}
62   name: STRING is "Do_Block"
63
64feature {}
65   possible_counts: SET[INTEGER] is
66      once
67         Result := {AVL_SET[INTEGER] << 1, 3 >> }
68      end
69
70end