On Thu, 07 Feb 2019 12:25:00 -0800 Steve Graham <
solitary....@gmail.com> wrote:
>
>
> On Thursday, February 7, 2019 at 12:06:26 AM UTC-8, Bakul wrote:
> >
> >
> >
> > > On Feb 6, 2019, at 11:00 PM, Steve Graham <
solitary....@gmail.com
k/kona are similar in that (roughly speaking) *evaluation* is
from right to left. But note that *parsing* is from left to
right. Another way of saying is that verbs are right
associative.
The rules are BNF (Backus-Naur Form) syntax rules that define
the structure of a program. You should best read some text on
parsing as it is a vast subject.
In standard parsing texts the above rules may be specified
more verbosely. For instance instead of
E:E;e|e
e:nve|te|
v:V|tA
t:n|v
n:N|(E)|t[E]|{<[E]>E}
can be written as
expr-list: expr-list ";" expr | expr ;
expr: noun verb expr | term expr | /* empty */ ;
verb: VERB | term ADVERB ;
term: noun | verb ;
noun: NOUN | "(" expr-list ")" | term "[" expr-list "]" |
"{" parameters expr-list "}" ;
parameters: "[" expr-list "]" | /* empty */ ;
Where capitalized words are language tokens. NOUN is
an int, float, string, symbol or name.
ADVERB is ' / \ etc.
VERB is +-*%&|<>=$~#_,^!?@.;:
Note that this is simplified & not complete but should give
you an idea.