/src/tools/syntax/tree/liberty_ast_routine_execution.e

http://github.com/tybor/Liberty · Specman e · 73 lines · 48 code · 11 blank · 14 comment · 0 complexity · d66f7b0c7942b3d431e8c29ebc3fa1cb 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. --
  15. class LIBERTY_AST_ROUTINE_EXECUTION
  16. inherit
  17. LIBERTY_AST_NON_TERMINAL_NODE
  18. create {LIBERTY_NODE_FACTORY}
  19. make
  20. feature {LIBERTY_AST_HANDLER}
  21. is_external: BOOLEAN is
  22. do
  23. Result := count = 1
  24. ensure
  25. Result = not is_regular
  26. end
  27. is_regular: BOOLEAN is
  28. do
  29. Result := count = 2
  30. ensure
  31. Result = not is_external
  32. end
  33. local_block: LIBERTY_AST_LOCAL_BLOCK is
  34. require
  35. is_regular
  36. do
  37. Result ::= nodes.item(0)
  38. end
  39. do_block: LIBERTY_AST_DO_BLOCK is
  40. require
  41. is_regular
  42. do
  43. Result ::= nodes.item(1)
  44. end
  45. external_clause: LIBERTY_AST_EXTERNAL is
  46. require
  47. is_external
  48. do
  49. Result ::= nodes.item(0)
  50. end
  51. feature {ANY}
  52. count: INTEGER is
  53. do
  54. Result := nodes.count
  55. end
  56. name: STRING is "Routine_Execution"
  57. feature {}
  58. possible_counts: SET[INTEGER] is
  59. once
  60. Result := {AVL_SET[INTEGER] << 1, 2 >> }
  61. end
  62. end