Lines Matching refs:word
11 * dictionary. A word is a named chunk of data with its
69 * NOTE: this function is not smart enough to unlink a word that
77 ficlWord *word;
79 word = dictionary->smudge;
81 if (word->flags & FICL_WORD_SMUDGED)
82 dictionary->here = (ficlCell *)word->name;
207 ficlWord *word = ficlDictionaryAppendWord(dictionary, name,
210 if (word != NULL)
212 return (word);
219 ficlWord *word = ficlDictionaryAppendWord(dictionary, name,
222 if (word != NULL) {
228 return (word);
255 ficlWord *word = ficlDictionaryLookup(dictionary, name);
258 if (word == NULL) {
259 word = ficlDictionaryAppendConstantInstruction(dictionary,
262 word->code = (ficlPrimitive)instruction;
264 word->param[0] = c;
266 return (word);
283 ficlWord *word;
284 word = ficlDictionaryLookup(dictionary, s);
287 * only reuse the existing word if we're sure it has space for a
291 if ((word != NULL) &&
292 ((((ficlInstruction)word->code) == ficlInstruction2ConstantParen) ||
293 (((ficlInstruction)word->code) == ficlInstructionF2ConstantParen)))
295 if ((word != NULL) &&
296 ((((ficlInstruction)word->code) == ficlInstruction2ConstantParen)))
299 word->code = (ficlPrimitive)instruction;
300 word->param[0].u = FICL_2UNSIGNED_GET_HIGH(value);
301 word->param[1].u = FICL_2UNSIGNED_GET_LOW(value);
303 word = ficlDictionaryAppend2ConstantInstruction(dictionary, s,
307 return (word);
336 * Create a new word in the dictionary with the specified
346 ficlWord *word;
352 * It must execute before word is initialized.
355 word = (ficlWord *)dictionary->here;
356 dictionary->smudge = word;
357 word->hash = ficlHashCode(name);
358 word->code = code;
359 word->semiParen = ficlInstructionSemiParen;
360 word->flags = (ficlUnsigned8)(flags | FICL_WORD_SMUDGED);
361 word->length = length;
362 word->name = nameCopy;
365 * Point "here" to first ficlCell of new word's param area...
367 dictionary->here = word->param;
373 return (word);
378 * Create a new word in the dictionary with the specified
396 ficlWord *word;
399 word = ficlDictionaryLookup(dictionary, s);
401 if (word == NULL) {
402 word = ficlDictionaryAppendPrimitive(dictionary, name,
405 word->code = (ficlPrimitive)code;
406 word->flags = flags;
408 return (word);
542 ficlDictionaryIsAWord(ficlDictionary *dictionary, ficlWord *word)
544 if ((((ficlInstruction)word) > ficlInstructionInvalid) &&
545 (((ficlInstruction)word) < ficlInstructionLast))
548 if (!ficlDictionaryIncludes(dictionary, word))
551 if (!ficlDictionaryIncludes(dictionary, word->name))
554 if ((word->link != NULL) &&
555 !ficlDictionaryIncludes(dictionary, word->link))
558 if ((word->length <= 0) || (word->name[word->length] != '\0'))
561 if (strlen(word->name) != word->length)
580 ficlWord *word;
587 word = (ficlWord *)
589 if (ficlDictionaryIsAWord(dictionary, word))
590 return (word);
611 * If found, returns the word's address. Otherwise returns NULL.
617 ficlWord *word = NULL;
626 for (i = (int)dictionary->wordlistCount - 1; (i >= 0) && (!word); --i) {
628 word = ficlHashLookup(hash, name, hashCode);
632 return (word);
638 * Display a human-readable representation of the named word's definition.
658 ficlDictionarySee(ficlDictionary *dictionary, ficlWord *word,
662 ficlCell *cell = word->param;
667 ficlWord *word = (ficlWord *)(cell->p);
676 if (ficlDictionaryIsAWord(dictionary, word)) {
677 ficlWordKind kind = ficlWordClassify(word);
683 ficlDictionaryInstructionNames[(long)word],
684 (long)word);
690 ficlDictionaryInstructionNames[(long)word],
691 (long)word, (long)c.i, (unsigned long)c.u);
695 "%s :: executes %s (instruction word %ld)",
696 word->name,
698 (long)word->code], (long)word->code);
704 ficlWord *word = (ficlWord *)c.p;
706 word->length, word->name,
784 sprintf(trace, "%.*s", word->length,
785 word->name);
789 /* probably not a word - punt and print value */
816 * Changes the flags field of the most recently defined word:
829 * Changes the flags field of the most recently defined word:
841 * Set the most recently defined word as IMMEDIATE
852 * Completes the definition of a word by linking it
858 ficlWord *word = dictionary->smudge;
862 FICL_DICTIONARY_ASSERT(dictionary, word);
867 if (word->length > 0)
868 ficlHashInsertWord(hash, word);
869 word->flags &= ~(FICL_WORD_SMUDGED);