Shen has its own in built version of YACC.
The irony is that YACC is less powerful in theory than the above.
Since it is based on BNF which is used to describe context-free grammars.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BNF = { } | |
-- create definition | |
BNF["::="] = function (stack) | |
local non_terminal = pop(stack) ; | |
push(BNF,non_terminal) ; end | |
-- add words to definition | |
BNF[";"] = function (stack) | |
local non_terminal = pop(BNF) |
Demo on how to produce the Fibonacci Sequence in Javascript - Concatenative-style.
Drawing inspiration from Concatenative Programming Languages, such as Forth and Factor,
this demonstration relies on recursion or iteration only for ease-of-use rather than functionality.