/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. --
  15. class LIBERTY_AST_WHEN_VALUE
  16. inherit
  17. LIBERTY_AST_NON_TERMINAL_NODE
  18. create {LIBERTY_NODE_FACTORY}
  19. make
  20. feature {LIBERTY_AST_HANDLER}
  21. is_number: BOOLEAN is
  22. do
  23. Result := nodes.first.name.is_equal(once "KW number")
  24. end
  25. number: LIBERTY_AST_NUMBER is
  26. require
  27. is_number
  28. do
  29. Result ::= nodes.first
  30. end
  31. is_character: BOOLEAN is
  32. do
  33. Result := nodes.first.name.is_equal(once "KW character")
  34. end
  35. character: LIBERTY_AST_CHARACTER is
  36. require
  37. is_character
  38. do
  39. Result ::= nodes.first
  40. end
  41. is_string: BOOLEAN is
  42. do
  43. Result := nodes.first.name.is_equal(once "KW string")
  44. end
  45. string: LIBERTY_AST_STRING is
  46. require
  47. is_string
  48. do
  49. Result ::= nodes.first
  50. end
  51. is_entity_name: BOOLEAN is
  52. do
  53. Result := nodes.first.name.is_equal(once "KW entity name")
  54. end
  55. entity_name: LIBERTY_AST_ENTITY_NAME is
  56. require
  57. is_entity_name
  58. do
  59. Result ::= nodes.first
  60. end
  61. feature {ANY}
  62. count: INTEGER is 1
  63. name: STRING is "When_Value"
  64. feature {}
  65. possible_counts: SET[INTEGER] is
  66. once
  67. Result := {AVL_SET[INTEGER] << 1 >> }
  68. end
  69. end