From 8d0726b3a4cb2a7d3d8d1cd64985df0e3c48ca0b Mon Sep 17 00:00:00 2001 From: John Doty Date: Fri, 9 Dec 2016 06:45:44 -0800 Subject: [PATCH] Ok, one more bit of documentation. --- parser.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/parser.py b/parser.py index 8f50572..84ce8e4 100644 --- a/parser.py +++ b/parser.py @@ -372,7 +372,13 @@ class GenerateSLR1(GenerateLR0): return result def gen_follow(self, symbol): - """Generate the follow set for the given nonterminal.""" + """Generate the follow set for the given nonterminal. + + The follow set for a nonterminal is the set of terminals that can + follow the nonterminal in a valid sentence. The resulting set never + contains epsilon and is never empty, since we should always at least + ground out at '$', which is the end-of-stream marker. + """ if symbol == '__start': return tuple('$')