From bdbd4b4dc21af09711c97d3f903877443199af06 Mon Sep 17 00:00:00 2001 From: JSDurand Date: Tue, 3 Jan 2023 23:44:02 +0800 Subject: structural change: separate crates out I put functionalities that are not strictly core to separate crates, so that the whole package becomes more modular, and makes it easier to try other parsing algorithms in the future. Also I have to figure the forests out before finishing the core chain-rule algorithm, as the part about forests affects the labels of the grammars directly. From my experiences in writing the previous version, it is asking for trouble to change the labels type dramatically at a later point: too many places need to be changed. Thus I decide to figure the rough part of forests out. Actually I only have to figure out how to attach forests fragments to edges of the underlying atomic languages, and the more complex parts of putting forests together can be left to the recorders, which is my vision of assembling semi-ring values during the chain-rule machine. It should be relatively easy to produce forests fragments from grammars since we are just trying to extract some information from the grammar, not to manipulate those information in some complicated way. We have to do some manipulations in the process, though, in order to make sure that the nulling and epsilon-removal processes do not invalidate these fragments. --- grammar/Cargo.toml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 grammar/Cargo.toml (limited to 'grammar/Cargo.toml') diff --git a/grammar/Cargo.toml b/grammar/Cargo.toml new file mode 100644 index 0000000..20c4b48 --- /dev/null +++ b/grammar/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "grammar" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[features] +default = [] + +# This flag exposes the module "test_grammar_helper" which provides +# some grammars for testing. +test-helper = [] + +[dependencies] +nfa = { path = "../nfa" } +graph = { path = "../graph" } + +[dev-dependencies] +grammar = { path = ".", features = ["test-helper"] } -- cgit v1.2.3-18-g5258