From 9688aae88d1f658ed3d37cccc7e79c7b8f99a5b5 Mon Sep 17 00:00:00 2001 From: v-jkegler Date: Fri, 20 Sep 2024 16:16:12 -0400 Subject: [PATCH] Add comments to parser.rs (#13) * Add comments to parser.rs Describe "Row" and "Item" * Update parser.rs --- parser/src/earley/parser.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/parser/src/earley/parser.rs b/parser/src/earley/parser.rs index 91bb3213..cc2d87cb 100644 --- a/parser/src/earley/parser.rs +++ b/parser/src/earley/parser.rs @@ -102,6 +102,9 @@ impl ParserStats { } } +// In this, code a "Row" is what is usually called an Earley set in the literature. +// The term "row" comes from Kallemeyer 2018, which uses a chart parsing algorithm +// in which the rows are Earley sets. #[derive(Clone)] struct Row { first_item: usize, @@ -115,6 +118,8 @@ impl Row { } } +// In this code, an "Item" is what is called in the literature, an +// "Earley item". impl Item { #[allow(dead_code)] const NULL: Self = Item { data: 0 };