13
votes
Accepted
Why does Forth's flexibility make a grammar inappropriate for it?
A "normal" word is pretty much just a subroutine.
...but you can write a user-defined defining word, which change how the compiler works. For example, a definition normally starts with a colon (":") ...
7
votes
Why does Forth's flexibility make a grammar inappropriate for it?
In Forth, you can run code at compile time.
In particular, you can run code that consumes words from the input. For example, you could write a C compiler in Forth, and then call it at compile-time, ...
3
votes
Why does Forth's flexibility make a grammar inappropriate for it?
A typical approach involving use of a BNF style grammar implies creation of some sort of tokenizer → parser → generator chain where grammar will be used by parser to form Abstract Syntax Tree from ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
stack-oriented × 7forth × 2
design-patterns × 1
c++ × 1
programming-languages × 1
c × 1
compiler × 1
operating-systems × 1
syntax × 1
virtual-machine × 1
garbage-collection × 1
paradigms × 1
semantics × 1
grammar × 1
idioms × 1
kernel × 1
method-chaining × 1
tail-call × 1
continuation × 1
factor × 1