Simple English Like Scripting Language

Beoran 0e2b09d158 Add List type. Add go.mod file. 2 years ago
selsl 0e2b09d158 Add List type. Add go.mod file. 2 years ago
README 778e0fb456 Ideas in readme. 2 years ago
go.mod 0e2b09d158 Add List type. Add go.mod file. 2 years ago
prepositions_sorted.txt 778e0fb456 Ideas in readme. 2 years ago

README

SELSL is a Simple English Like Scripting Language

It is implemented in Go language for use with Go muds, such as my Woe
MUD engine. It is indended to be usable both as an interective command
interpreter for the users of the MUD as well as a scripting language
for the builders.

While the goal is to be english like, a second goal is to be simple,
so it does not use any advanced AI like techniques to parse the
input. Rarther it uses a few simple rules to reduce the user input to
commands, and blocks of commands.


he
him
his
she
her
hers
they
them
their
theirs
it
its

me
myself
i


In SELSL, everything is an object, and there are no stand alone variables.
Eveything exists in something else, except for the top level "world".
There is also a "me" object which represents the the current actor
that is operating on the state of the world.

A SELSL script consists of commands. Commands operate on the state of the
world and may cause output to be produced as well.

A command begins with a verb and is optionally followed by the objects the
command perates on. If a command has no objects it will operate on the
"me" object. Commands are separated from each other by one of
the English prepositions or conjunctions that SELSL accepts. See below for
the lists. Commands are also separated by the particles "a", "an", "the",
or the demonstratives "this", "that", "those".

A command is ended by a period. A column in a command announces the start of a
block. The command end ends a block.


Teach an actor to open a door do
Check if door's open then
Set door's open to false.
Tell an actor to: Format "You close the %s" with door's name;
else do
Tell an actor to: Format "The %s is already closed" with door's name;
end of check.
End of teach.


Set hp of me as add 1 with divide hp of me by 2 end end


Create a red door as a door.

open red door



(This is
multi line comment)
# This is single line comment for compatibility with shell scripts.

end of command with `.` or newline
start of block with `:`, do.
end of block with 'end', ';', ''
Syntactic sugar: `as` and `with` are translated to `to do`





SCRIPT -> COMMAND eoc EOC SCRIPT | .
EOC -> eoc EOC | .
COMMAND -> word EXPRESSIONS .
EXPRESSIONS -> EXPRESSION separator EXPRESSIONS | .
EXPRESSION -> OBJECT | number | BLOCK.
OBJECT-> word ATTRIBUTES .
ATTRIBUTES -> OFS EXPRESSION | .
OFS -> of | s .
BLOCK -> ob SCRIPT END .
END -> end COMMAND .

Conjunction List

After
Although
As
Because
Before
Even
If
Inasmuch
Lest
Now
Once
Provided
Rather
Since
So
Supposing
Than
That
Though
Till
Unless
Until
When
Whenever
Where
Whereas
Wherever
Whether
Which
While
Who
Whoever
Why



Preposition List.

about
aboard
above
across
after
against
along
amid
among
around
as
at
before
behind
below
beneath
beside
between
beyond
but
by
concerning
considering
despite
down
during
except
following
for
from
in
inside
into
like
minus
near
next
of
off
on
onto
opposite
out
outside
over
past
per
plus
regarding
round
save
since
than
through
till
to
toward
under
underneath
unlike
until
up
upon
versus
via
with
within
without