PageRenderTime 22ms CodeModel.GetById 16ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/src/tools/semantics/code/builders/liberty_builder_tools.e

http://github.com/tybor/Liberty
Specman e | 77 lines | 64 code | 13 blank | 0 comment | 0 complexity | d01b29a70f19c994c0bdf3d8228f06ac MD5 | raw file
 1deferred class LIBERTY_BUILDER_TOOLS
 2
 3insert
 4   LIBERTY_AST_HANDLER
 5   LIBERTY_ERROR_LEVELS
 6   LOGGING
 7
 8feature {}
 9   errors: LIBERTY_ERRORS
10   torch: LIBERTY_ENLIGHTENING_THE_WORLD
11   type_lookup: LIBERTY_TYPE_LOOKUP
12
13   universe: LIBERTY_UNIVERSE is
14      deferred
15      end
16
17   effective_generic_parameters: DICTIONARY[LIBERTY_ACTUAL_TYPE, FIXED_STRING]
18
19   ast: LIBERTY_AST_NON_TERMINAL_NODE is
20      deferred
21      ensure
22         Result /= Void
23      end
24
25   file: FIXED_STRING is
26      deferred
27      ensure
28         Result /= Void
29      end
30
31feature {}
32   decoded_string (string_image: LIBERTY_AST_STRING): STRING is
33      require
34         {TYPED_EIFFEL_IMAGE[STRING]} ?:= string_image.image
35      local
36         s: TYPED_EIFFEL_IMAGE[STRING]
37      do
38         s ::= string_image.image
39         Result := s.decoded
40      end
41
42feature {}
43   semantics_position_at (a_node: EIFFEL_NODE): LIBERTY_POSITION is
44      require
45         {LIBERTY_AST_TERMINAL_NODE} ?:= a_node
46      local
47         node: LIBERTY_AST_TERMINAL_NODE
48      do
49         node ::= a_node
50         Result := image_semantics_position_at(node.image)
51      end
52
53   image_semantics_position_at (a_image: EIFFEL_IMAGE): LIBERTY_POSITION is
54      do
55         Result := errors.semantics_position(a_image.index, ast, file)
56      end
57
58   semantics_position_after (a_node: EIFFEL_NODE): LIBERTY_POSITION is
59      require
60         {LIBERTY_AST_TERMINAL_NODE} ?:= a_node
61      local
62         node: LIBERTY_AST_TERMINAL_NODE
63      do
64         node ::= a_node
65         Result := image_semantics_position_after(node.image)
66      end
67
68   image_semantics_position_after (a_image: EIFFEL_IMAGE): LIBERTY_POSITION is
69      do
70         Result := errors.semantics_position(a_image.index + a_image.image.count, ast, file)
71      end
72
73invariant
74   universe /= Void
75   effective_generic_parameters /= Void
76
77end -- class LIBERTY_BUILDER_TOOLS