From 4a96d9cad446ea405b51dfeebb01a1b6d7f6fb2b Mon Sep 17 00:00:00 2001 From: Ben Culkin Date: Tue, 27 Sep 2022 19:21:16 -0400 Subject: Add some interesting new things Adds a number of things based off of some of the notes I've made over time, plus a few papers I've read. More details to come later, whenever I decide to actually get serious about documentation and examples and the like --- .../main/java/bjc/utils/graph/ASGraphGrammar.java | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 base/src/main/java/bjc/utils/graph/ASGraphGrammar.java (limited to 'base/src/main/java/bjc/utils/graph/ASGraphGrammar.java') diff --git a/base/src/main/java/bjc/utils/graph/ASGraphGrammar.java b/base/src/main/java/bjc/utils/graph/ASGraphGrammar.java new file mode 100644 index 0000000..847107d --- /dev/null +++ b/base/src/main/java/bjc/utils/graph/ASGraphGrammar.java @@ -0,0 +1,30 @@ +package bjc.utils.graph; + +import java.util.Set; + +import bjc.data.Either; + +// See https://web.archive.org/web/20190414072011/https://core.ac.uk/download/pdf/82129679.pdf +public class ASGraphGrammar { + public class Rule { + private ASGraph starting; + + // Must contain at least one node + private ASGraph, Label> production; + + // Start node and end node must be in production + private Either startNode; + private Either endNode; + + public void derive(ASGraph, Label> graph) { + // The derivation of H from G according to the rule A -> K(I/O) consists simply of replacing + // a node N' in G whose value is A by the graph K. Arcs leading into N' are replaced by + // arcs leading to I, arcs exiting from B' are replaced by arcs exiting from O, and any + // loop arcs on N' are replaced by arcs from O to I. + + } + } + + // int is perhaps not the best node type, but it works + private Set> rules; +} -- cgit v1.2.3