Exploring how to define a Grammar in APL using BNF-like syntax
Last active
July 18, 2023 14:43
-
-
Save Bruno-366/4ba65477bd31cccb5f28148d1a76e4a5 to your computer and use it in GitHub Desktop.
Exploring how to define a Grammar in APL using BNF-like syntax
This file contains hidden or 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
⍝ Example Grammar: | |
HELLO ← 'hello world' | |
BYE ← 'bye world' | |
CONVERSATION ← HELLO , ' and then ' , BYE | |
⍝ CAPITALIZED words are the non-terminals | |
⍝ 'Strings' are the terminals | |
⍝ Concatenation is done with , |
This file contains hidden or 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
⍝ Output: | |
HELLO | |
hello world | |
BYE | |
bye world | |
CONVERSATION | |
hello world and then bye world |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.