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.
Last active
July 18, 2023 14:44
-
-
Save Bruno-366/417234ca0d44dde37103616364ebf528 to your computer and use it in GitHub Desktop.
Context-sensitive grammars in Shen-lisp
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
(1-) (defmacro infix [X + Y] -> [+ X Y]) | |
infix | |
(2-) (+ 4 2) | |
6 | |
(3-) (4 + 2) | |
6 | |
\\ something different: | |
(0-) (defmacro myfunction ["explode(" X ")"] -> [explode X]) | |
myfunction | |
(1-) ("explode(" "hello world" ")") | |
["h" "e" "l" "l" "o" " " "w" "o" "r" "l" "d"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://gravicappa.github.io/shen-js/shen.html