>Alain: It should be noted that AppleScript allows a
>scripter to create english-like syntax comparable to
>the native syntax. AppleScript is not limited to the
>generic syntax illustrated above.

Alain, Anthony,

 although AppleScript's aete resources are reasonably complex, we might be
able to add something similar to implement additional commands and
functions. At least for commands it should work fairly well, as long as the
first word is unique. We'd just have to specify each command's syntax as
direct and indirect objects, e.g.

COMMAND: laugh
INDIRECT OBJ:
    PREPOSITION: about
    VALUE:       valueType
INDIRECT OBJ:
    PREPOSITION: when
    VALUE:       expressionType

which would then be converted by the parser to

 laugh <value>,<expression>

We'd only have to enter the above description for every command into a
hashed map and probably replace "laugh", "about", "when" etc. by their
token IDs and it'd work. But I wouldn't want to let users add these
English-like commands to FreeCard using FreeScript. We'd get in hell's
kitchen every time we add a new command.

>Alain: Is it possible to dramatically simplify the
>process of adding new NATIVE FreeScript syntax to
>FreeCard? A user-friendly interface to mask all but
>the really necessary details, crafted with HyperCard
>or MetaCard say?

 There's a problem with that: we'd need to have one central place to store
these syntax descriptions since the parser has to know about them before
parsing a single script. It'd get messy as they'd be invisible objects that
need to be created and deleted etc... I'd say it's a 2.0 feature. It'd
definitely be possible to add "syntax" blocks to each file and to have the
parser register them when a file is opened. But I don't like such
behaviour, just remember how surprised many users already are about XCMDs
where you "call handlers that don't exist, and only work in one stack"...

 What's definitely impossible the way things are done at the moment is
defining new syntax in a handler description, e.g

on laugh "about" value "when" expression
  ...
end laugh

since the parser hasn't even seen some of the scripts when their handlers
might already have been called.

Cheers,
-- M. Uli Kusterer

------------------------------------------------------------
             http://www.weblayout.com/witness
       'The Witnesses of TeachText are everywhere...'

--- HELP SAVE HYPERCARD: ---
Details at: http://www.hyperactivesw.com/SaveHC.html
Sign: http://www.giguere.uqam.ca/petition/hcpetition.html

Reply via email to