README 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. SELSL is a Simple English Like Scripting Language
  2. It is implemented in Go language for use with Go muds, such as my Woe
  3. MUD engine. It is indended to be usable both as an interective command
  4. interpreter for the users of the MUD as well as a scripting language
  5. for the builders.
  6. While the goal is to be english like, a second goal is to be simple,
  7. so it does not use any advanced AI like techniques to parse the
  8. input. Rarther it uses a few simple rules to reduce the user input to
  9. commands, and blocks of commands.
  10. he
  11. him
  12. his
  13. she
  14. her
  15. hers
  16. they
  17. them
  18. their
  19. theirs
  20. it
  21. its
  22. me
  23. myself
  24. i
  25. In SELSL, everything is an object, and there are no stand alone variables.
  26. Eveything exists in something else, except for the top level "world".
  27. There is also a "me" object which represents the the current actor
  28. that is operating on the state of the world.
  29. A SELSL script consists of commands. Commands operate on the state of the
  30. world and may cause output to be produced as well.
  31. A command begins with a verb and is optionally followed by the objects the
  32. command perates on. If a command has no objects it will operate on the
  33. "me" object. Commands are separated from each other by one of
  34. the English prepositions or conjunctions that SELSL accepts. See below for
  35. the lists. Commands are also separated by the particles "a", "an", "the",
  36. or the demonstratives "this", "that", "those".
  37. A command is ended by a period. A column in a command announces the start of a
  38. block. The command end ends a block.
  39. Teach an actor to open a door do
  40. Check if door's open then
  41. Set door's open to false.
  42. Tell an actor to: Format "You close the %s" with door's name;
  43. else do
  44. Tell an actor to: Format "The %s is already closed" with door's name;
  45. end of check.
  46. End of teach.
  47. Set hp of me as add 1 with divide hp of me by 2 end end
  48. Create a red door as a door.
  49. open red door
  50. (This is
  51. multi line comment)
  52. # This is single line comment for compatibility with shell scripts.
  53. end of command with `.` or newline
  54. start of block with `:`, do.
  55. end of block with 'end', ';', ''
  56. Syntactic sugar: `as` and `with` are translated to `to do`
  57. SCRIPT -> COMMAND eoc EOC SCRIPT | .
  58. EOC -> eoc EOC | .
  59. COMMAND -> word EXPRESSIONS .
  60. EXPRESSIONS -> EXPRESSION separator EXPRESSIONS | .
  61. EXPRESSION -> OBJECT | number | BLOCK.
  62. OBJECT-> word ATTRIBUTES .
  63. ATTRIBUTES -> OFS EXPRESSION | .
  64. OFS -> of | s .
  65. BLOCK -> ob SCRIPT END .
  66. END -> end COMMAND .
  67. Conjunction List
  68. After
  69. Although
  70. As
  71. Because
  72. Before
  73. Even
  74. If
  75. Inasmuch
  76. Lest
  77. Now
  78. Once
  79. Provided
  80. Rather
  81. Since
  82. So
  83. Supposing
  84. Than
  85. That
  86. Though
  87. Till
  88. Unless
  89. Until
  90. When
  91. Whenever
  92. Where
  93. Whereas
  94. Wherever
  95. Whether
  96. Which
  97. While
  98. Who
  99. Whoever
  100. Why
  101. Preposition List.
  102. about
  103. aboard
  104. above
  105. across
  106. after
  107. against
  108. along
  109. amid
  110. among
  111. around
  112. as
  113. at
  114. before
  115. behind
  116. below
  117. beneath
  118. beside
  119. between
  120. beyond
  121. but
  122. by
  123. concerning
  124. considering
  125. despite
  126. down
  127. during
  128. except
  129. following
  130. for
  131. from
  132. in
  133. inside
  134. into
  135. like
  136. minus
  137. near
  138. next
  139. of
  140. off
  141. on
  142. onto
  143. opposite
  144. out
  145. outside
  146. over
  147. past
  148. per
  149. plus
  150. regarding
  151. round
  152. save
  153. since
  154. than
  155. through
  156. till
  157. to
  158. toward
  159. under
  160. underneath
  161. unlike
  162. until
  163. up
  164. upon
  165. versus
  166. via
  167. with
  168. within
  169. without