Charles Turner <vze26m98@[EMAIL PROTECTED]
> wrote:
> I'll take a look at this today. I assume that STRUCTS and MACHOFUNCS
> would have to be declared/defined in a separate file? If so, do they
> end up in a similar 'Actel vocabulary' area or do they end up in
> CODE/DATA space?
No need for a separate file. Only constants defined with the C-style
format are added to MacEnums.
All our vocabs are Actels. And all "normal" vocabs we use all have the
same actions for vocab-related functions, like adding/removing an entry,
searching, looking up a token, etc, and the action that INTERPRET should
take when it finds a token in a given vocab.
There are two ways to add words to the MacEnums vocabulary.
One would be to explicitly do it:
ALSO MacEnums DEFINITIONS
but this should NEVER be done, because MacEnums is not a "normal" vocab
and you should not add words to it with normal Forth defining words. In
fact, think of MacEnums as a special name-value association list that
behaves a lot like a standard Forth wordlist, but not entirely so.
INTERPRET with a normal Forth wordlist/vocab would compile or execute an
execution token. INTERPRET with MacEnums takes the word's token and
does what LITERAL would do with it (compiles the token as a constant or
puts the token on the stack)
ParseOneEnum is the primitive that decodes the line of C and adds the
named constant to MacEnums. It is the ONLY word that modifes the
contents of MacEnums.
MacEnums *can* be added to the search order so its words are found and
compiled/executed by INTERPRET as described above.


|