README 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  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. SELSL is object oriented but not class based. In stead it is prototype
  26. based much like the SELF language. In SELSL, everything is an object.
  27. Objects have slots that can contain other values. There are basic objects
  28. which evaluate to themselves, and excutable objects which perform
  29. some computation to produce their result.
  30. An object also has an effect on computation. Normal objects have no effect,
  31. but a Return causes the block to end execution early. A Throw
  32. will keep on unless if it is stopped with a Catch.
  33. Variables, and also arguments are simply slots of the current activation
  34. record of an executable object. There are no stand alone variables.
  35. Eveything exists in something else, except for the top level "world".
  36. There is also a "me" object which represents the the current actor
  37. that is operating on the state of the world.
  38. A SELSL script consists of commands. Commands operate on the state of the
  39. world and may cause output to be produced as well.
  40. A command begins with a verb and is optionally followed by the objects the
  41. command perates on. If a command has no objects it will operate on the
  42. "me" object. Commands are separated from each other by one of
  43. the English prepositions or conjunctions that SELSL accepts. See below for
  44. the lists. Commands are also separated by the particles "a", "an", "the",
  45. or the demonstratives "this", "that", "those".
  46. A command is ended by a period. A column in a command announces the start of a
  47. block. The command end ends a block.
  48. Teach an actor to open a door do
  49. Check if door's open then
  50. Set door's open to false.
  51. Tell an actor to: Format "You close the %s" with door's name;
  52. else do
  53. Tell an actor to: Format "The %s is already closed" with door's name;
  54. end of check.
  55. End of teach.
  56. Set hp of me as add 1 with divide hp of me by 2 end end
  57. Create a red door as a door.
  58. open red door with green key
  59. cast cure light at smart bob
  60. (This is
  61. multi line comment)
  62. # This is single line comment for compatibility with shell scripts.
  63. end of command with `.` or newline
  64. start of block with `:`, do.
  65. end of block with 'end', ';', ''
  66. Syntactic sugar: `as` and `with` are translated to `to do`
  67. SCRIPT -> COMMAND eoc EOC SCRIPT | .
  68. EOC -> eoc EOC | .
  69. COMMAND -> word EXPRESSIONS .
  70. EXPRESSIONS -> EXPRESSION separator EXPRESSIONS | .
  71. EXPRESSION -> OBJECT | number | BLOCK.
  72. OBJECT-> word ATTRIBUTES .
  73. ATTRIBUTES -> OFS EXPRESSION | .
  74. OFS -> of | s .
  75. BLOCK -> ob SCRIPT END .
  76. END -> end COMMAND .
  77. Conjunction List
  78. After
  79. Although
  80. As
  81. Because
  82. Before
  83. Even
  84. If
  85. Inasmuch
  86. Lest
  87. Now
  88. Once
  89. Provided
  90. Rather
  91. Since
  92. So
  93. Supposing
  94. Than
  95. That
  96. Though
  97. Till
  98. Unless
  99. Until
  100. When
  101. Whenever
  102. Where
  103. Whereas
  104. Wherever
  105. Whether
  106. Which
  107. While
  108. Who
  109. Whoever
  110. Why
  111. Preposition List.
  112. about
  113. aboard
  114. above
  115. across
  116. after
  117. against
  118. along
  119. amid
  120. among
  121. around
  122. as
  123. at
  124. before
  125. behind
  126. below
  127. beneath
  128. beside
  129. between
  130. beyond
  131. but
  132. by
  133. concerning
  134. considering
  135. despite
  136. down
  137. during
  138. except
  139. following
  140. for
  141. from
  142. in
  143. inside
  144. into
  145. like
  146. minus
  147. near
  148. next
  149. of
  150. off
  151. on
  152. onto
  153. opposite
  154. out
  155. outside
  156. over
  157. past
  158. per
  159. plus
  160. regarding
  161. round
  162. save
  163. since
  164. than
  165. through
  166. till
  167. to
  168. toward
  169. under
  170. underneath
  171. unlike
  172. until
  173. up
  174. upon
  175. versus
  176. via
  177. with
  178. within
  179. without