Re: Symbol table
Re: Symbol table
- Subject: Re: Symbol table
- From: email@hidden
- Date: Fri, 27 Jul 2001 18:54:05 -0400
On Fri, 27 Jul 2001 09:23:16 +0000, "Jason W. Bruce" <email@hidden>
asked,
>
Scott Norton wrote:
>
> When "whatever of aaa" is begin compiled, the symbol table has an entry for
>
> "aaa" as a top-level script object. [...]
>
>
What's a symbol table?
Its a data structure that the AppleScript compiler maintains, to keep track of
what each symbol you've used and what it means. Its the dictionary of your
variables and handler names.
Its internal to the AppleScript language, and not something you need to worry
about.
(And just in case you then ask, "what is the AppleScript compiler?"...)
An AppleScript is converted from the form you typed in, into a more efficient
internal representation, by a "compiler." It breaks your script up into the
operators and operands, and arranges them in a form that is fast for AppleScript
to execute. So the simple command,
set a to 6 * 7
compiles into something that might be like this:
set some register to 6
multiply by 7
store the result in the space at address 000217
The symbol table is what was used when the compiler came across "a", and
translated that into "the space at address 000217". Further occurrences to the
variable "a" in the script will all be pointed to that same address.
--
Scott Norton Phone: +1-703-299-1656
DTI Associates, Inc. Fax: +1-703-706-0476
2920 South Glebe Road Internet: email@hidden
Arlington, VA 22206-2768 or email@hidden