PREV INDEX NEXT

Author: Jau
Subject: Reading the grammar rules
Date: Thursday, 24 Sep 2020, 23:18:36

Hi,

I've been seeing a lot questions on this newsgroup about how to interpret the grammar rules, e.g. `[suffix] = TEXT / [redirect] / [suffix] TEXT / [suffix] [redirect]`, and a lot of misunderstandings about what these rules mean.

In case it isn't clear, the grammar rules as provided in the spec are in the format called a Context-Free Grammar (CFG), and these should be a good refresher from CS201:

- https://zoo.cs.yale.edu/classes/cs201/Fall_2019/lectures/strings.html#part6
- https://zoo.cs.yale.edu/classes/cs201/topics/topic-cfls.pdf

Other resources can be found with a quick Google as well (e.g. http://matt.might.net/articles/grammars-bnf-ebnf/).

Note also that the string that you will receive as input to parse() will always be a [command].
PREV INDEX NEXT