Lines Matching +full:coexist +full:- +full:support

10 ** Copyright (c) 1997-2001 John Sadler (john_sadler@alum.mit.edu)
48 ** Ficl (Forth-inspired command language) is an ANS Forth
61 ** easier to support large blocks of code, efficient, type checking).
66 ** interpreter is re-entrant, so it can be used in multiple instances
80 ** - Standard: Implements the ANSI Forth CORE word set and part
81 ** of the CORE EXT word-set, SEARCH and SEARCH EXT, TOOLS and
83 ** - Extensible: you can export code written in Forth, C,
87 ** - Ficl and C can interact in two ways: Ficl can encapsulate
89 ** - Thread-safe, re-entrant: The shared system dictionary
94 ** - Simple encapsulation into existing systems: a basic implementation
96 ** - ROMable: Ficl is designed to work in RAM-based and ROM code / RAM data
100 ** - Written an ANSI C to be as simple as I can make it to understand,
101 ** support, debug, and port. Compiles without complaint at /Az /W4
103 ** - Does full 32 bit math (but you need to implement
105 ** - Indirect threaded interpreter is not the fastest kind of
126 ** 2. Ficl uses the PAD in some CORE words - this violates the standard,
141 ** - work on interpret speed
142 ** - turn off locals (FICL_WANT_LOCALS)
144 ** - Change inner interpreter (and everything else)
147 ** rid of vm->runningWord and a level of indirection in the
149 ** - Make the main hash table a bigger prime (HASHSIZE)
150 ** - FORGET about twiddling the hash function - my experience is
152 ** - Eliminate the need to pass the pVM parameter on the stack
174 ** of the string, ie, base+size. If the size is not known, pass -1.
181 ** Added .X to display in hex, PARSE and PARSE-WORD to supplement WORD,
184 ** 29 jun 1998 (sadler) added variable sized hash table support
191 ** Bug fixes -- passes John Ryan's ANS test suite "core.fr"
194 ** -Fixed bugs in <# # #>
195 ** -Changed FICL_WORD so that storage for the name characters
197 ** reserving 32 bytes in each word whether needed or not -
199 ** -Added words in testmain for Win32 functions system,chdir,cwd,
203 ** -Added VM_RESTART exception handling in ficlExec -- this lets words
208 ** -Changed #include order so that <assert.h> is included in sysdep.h,
211 ** -Make PC specific system dependent code conditional on _M_IX86
212 ** defined so that ports can coexist in sysdep.h/sysdep.c
290 ** Strings in FICL are stored in Pascal style - with a count
291 ** preceding the text. We'll also NULL-terminate them so that
317 ** Init a STRINGINFO from a pointer to NULL-terminated string
325 {si.cp = pfs->text; si.count = pfs->count;}
335 ** The size is stored as an end-pointer because that is what the
336 ** null-terminated string aware functions find most easy to deal
399 #define PUSHPTR(p) stackPushPtr(pVM->pStack,p)
400 #define PUSHUNS(u) stackPushUNS(pVM->pStack,u)
401 #define PUSHINT(i) stackPushINT(pVM->pStack,i)
402 #define PUSHFLOAT(f) stackPushFloat(pVM->fStack,f)
403 #define PUSH(c) stackPush(pVM->pStack,c)
404 #define POPPTR() stackPopPtr(pVM->pStack)
405 #define POPUNS() stackPopUNS(pVM->pStack)
406 #define POPINT() stackPopINT(pVM->pStack)
407 #define POPFLOAT() stackPopFloat(pVM->fStack)
408 #define POP() stackPop(pVM->pStack)
409 #define GETTOP() stackGetTop(pVM->pStack)
410 #define SETTOP(c) stackSetTop(pVM->pStack,LVALUEtoCELL(c))
411 #define GETTOPF() stackGetTop(pVM->fStack)
412 #define SETTOPF(c) stackSetTop(pVM->fStack,LVALUEtoCELL(c))
413 #define STORE(n,c) stackStore(pVM->pStack,n,LVALUEtoCELL(c))
414 #define DEPTH() stackDepth(pVM->pStack)
415 #define DROP(n) stackDrop(pVM->pStack,n)
416 #define DROPF(n) stackDrop(pVM->fStack,n)
417 #define FETCH(n) stackFetch(pVM->pStack,n)
418 #define PICK(n) stackPick(pVM->pStack,n)
419 #define PICKF(n) stackPick(pVM->fStack,n)
420 #define ROLL(n) stackRoll(pVM->pStack,n)
421 #define ROLLF(n) stackRoll(pVM->fStack,n)
438 ** Each VM has a placeholder for an output function -
446 ** Each VM operates in one of two non-error states: interpreting
472 ** OK - now we can really define the VM...
479 OUTFUNC textOut; /* Output callback - see sysdep.c */
480 … void * pExtend; /* vm extension pointer for app use - initialized from FICL_SYSTEM */
483 FICL_WORD *runningWord;/* address of currently running word (often just *(ip-1) ) */
491 CELL sourceID; /* -1 if EVALUATE, 0 if normal input */
513 #define VM_ASSERT(pVM) assert((*(pVM->ip - 1)) == pVM->runningWord)
530 UNS8 flags; /* Immediate, Smudge, Compile-only */
538 ** Worst-case size of a word header: nFICLNAME chars in name
550 #define FW_SMUDGE 4 /* definition in progress - hide me */
560 #define VM_INNEREXIT -256 /* tell ficlExecXT to exit inner loop */
561 #define VM_OUTOFTEXT -257 /* hungry - normal exit */
562 #define VM_RESTART -258 /* word needs more text to succeed - re-run it */
563 #define VM_USEREXIT -259 /* user wants to quit */
564 #define VM_ERREXIT -260 /* interp found an error */
565 #define VM_BREAK -261 /* debugger breakpoint */
566 #define VM_ABORT -1 /* like errexit -- abort */
567 #define VM_ABORTQ -2 /* like errexit -- abort" */
568 #define VM_QUIT -56 /* like errexit, but leave pStack & base alone */
594 #define vmGetRunningWord(pVM) ((pVM)->runningWord)
598 ** The inner interpreter - coded as a macro (see note for
602 FICL_WORD *tempFW = *(pVM)->ip++; \
603 (pVM)->runningWord = tempFW; \
604 tempFW->code(pVM);
639 #define vmGetInBuf(pVM) ((pVM)->tib.cp + (pVM)->tib.index)
640 #define vmGetInBufLen(pVM) ((pVM)->tib.end - (pVM)->tib.cp)
641 #define vmGetInBufEnd(pVM) ((pVM)->tib.end)
642 #define vmGetTibIndex(pVM) (pVM)->tib.index
643 #define vmSetTibIndex(pVM, i) (pVM)->tib.index = i
644 #define vmUpdateTib(pVM, str) (pVM)->tib.index = (str) - (pVM)->tib.cp
673 ** Ficl hash table - variable size.
701 ** here -- points to the next free byte in the dictionary. This
702 ** pointer is forced to be CELL-aligned before a definition is added.
703 ** Do not assume any specific alignment otherwise - Use dictAlign().
705 ** smudge -- pointer to word currently being defined (or last defined word)
709 ** Smudge prevents unintentional recursion as a side-effect: the
715 ** pForthWords -- pointer to the default wordlist (FICL_HASH).
719 ** pCompile -- compilation wordlist - initially equal to pForthWords
720 ** pSearch -- array of pointers to wordlists. Managed as a stack.
722 ** nLists -- number of lists in pSearch. nLists-1 is the highest
725 ** size -- number of cells in the dictionary (total)
726 ** dict -- start of data area. Must be at the end of the struct.
788 ** double number support to be factored cleanly.
806 ** the dictionary. Precompiled parse steps can use (PARSE-STEP) as their
807 ** CFA - see parenParseStep in words.c.
815 ** origXT - if NULL, this breakpoint is unused. Otherwise it stores the xt
818 ** address - the location of the breakpoint (address of the instruction that
820 ** origXT - The original contents of the location with the breakpoint
832 ** The top level data structure of the system - ficl_system ties a list of
834 ** support multiple Ficl systems, allowing multiple concurrent sessions
897 void *pExtend; /* Initializes VM's pExtend pointer - for application use */
903 (x)->size = sizeof(FICL_SYSTEM_INFO); }
937 ** specified interpreter. Also sets SOURCE-ID properly.
939 ** PLEASE USE THIS FUNCTION when throwing a hard-coded
949 ** terminated, you can pass -1 as nChars rather than count it.
959 ** time to delete the vm, etc -- or you can ignore this
967 ** ensure pVM->sourceID was set to a sensible value.
968 ** ficlExec() explicitly DOES NOT manage SOURCE-ID for you.
1015 ** Utility function - returns the address of the system dictionary.
1027 ** Builds a word into the system default dictionary in a thread-safe way.
1034 ** name -- the name of the word to be built
1035 ** code -- code to execute when the word is invoked - must take a single param
1037 ** flags -- 0 or more of FW_IMMEDIATE, FW_COMPILE, use bitwise OR!
1039 ** nAllot - number of extra cells to allocate in the parameter area (usually zero)
1045 ** Builds the ANS CORE wordset into the dictionary - called by
1046 ** ficlInitSystem - no need to waste dict space by doing it again.
1106 ** Dictionary on-demand resizing
1134 ** Used with File-Access wordset.