lout-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Writing a @Bnf enviroment


From: Jeff Kingston
Subject: Re: Writing a @Bnf enviroment
Date: Fri, 25 Jul 2003 08:58:34 +1100

I'm not quite sure what you are doing wrong.  @DoRowa is a macro
so it is not going to work properly where you have it.  I tried
replacing it with @FirstRowa but no improvement.  Anyway it
seems clear that Lout is not finding the aformat you would
expect it to.

In any case @Tbl seems like overkill for this application.
Why not build your own table.  Define two operators, ":="
with low precedence more or less as you have it now, and
"||" with higher precedence, so that

    a := b || c || d

is parsed as

   a := { b || c || d }

and just use Lout primitives in the definitions of := and ||:

   def ":="
      left name
      right bodies
   {
      named ":=" |1s bodies
   }

   def "||"
      left x
      right y
   {
      x //1v "||" y
   }

Something like this should work, the associativity might be a
bit of a problem, but the structure should work out.  I don't
think @Tbl is a good thing to use as the basis of something
else, it is already big and clunky with macros etc.

Jeff Kingston


reply via email to

[Prev in Thread] Current Thread [Next in Thread]