From 5bd165a3b66d6638d6616df9984b8227ccd6f9d7 Mon Sep 17 00:00:00 2001 From: dgelessus <dgelessus@users.noreply.github.com> Date: Tue, 2 May 2023 17:37:44 +0200 Subject: [PATCH] Remove previously deprecated methods --- .../sablecc/sablecc/analysis/Analysis.java | 32 ------ .../sablecc/analysis/AnalysisAdapter.java | 75 ------------ .../org/sablecc/sablecc/parser/Parser.java | 10 -- .../org/sablecc/sablecc/analyses.txt | 107 ------------------ .../resources/org/sablecc/sablecc/parser.txt | 10 -- 5 files changed, 234 deletions(-) diff --git a/src/main/java/org/sablecc/sablecc/analysis/Analysis.java b/src/main/java/org/sablecc/sablecc/analysis/Analysis.java index 999e37a..85fdad1 100644 --- a/src/main/java/org/sablecc/sablecc/analysis/Analysis.java +++ b/src/main/java/org/sablecc/sablecc/analysis/Analysis.java @@ -6,38 +6,6 @@ import org.sablecc.sablecc.node.*; public interface Analysis extends Switch { - /** - * @param node the node for which to look up the associated object - * @return the corresponding object previously associated using {@link #setIn(Node, Object)}, or {@code null} if there is none - * @deprecated If you need a map field, declare it yourself. - */ - @Deprecated - Object getIn(Node node); - - /** - * @param node the node with which to associate the given object - * @param o the object to associate with the node - * @deprecated If you need a map field, declare it yourself. - */ - @Deprecated - void setIn(Node node, Object o); - - /** - * @param node the node for which to look up the associated object - * @return the corresponding object previously associated using {@link #setOut(Node, Object)}, or {@code null} if there is none - * @deprecated If you need a map field, declare it yourself. - */ - @Deprecated - Object getOut(Node node); - - /** - * @param node the node with which to associate the given object - * @param o the object to associate with the node - * @deprecated If you need a map field, declare it yourself. - */ - @Deprecated - void setOut(Node node, Object o); - void caseStart(Start node); void caseAGrammar(AGrammar node); void caseAHelpers(AHelpers node); diff --git a/src/main/java/org/sablecc/sablecc/analysis/AnalysisAdapter.java b/src/main/java/org/sablecc/sablecc/analysis/AnalysisAdapter.java index c07b260..5dfa2ce 100644 --- a/src/main/java/org/sablecc/sablecc/analysis/AnalysisAdapter.java +++ b/src/main/java/org/sablecc/sablecc/analysis/AnalysisAdapter.java @@ -2,85 +2,10 @@ package org.sablecc.sablecc.analysis; -import java.util.*; import org.sablecc.sablecc.node.*; public class AnalysisAdapter implements Analysis { - /** - * @deprecated If you need a map field, declare it yourself. - */ - @Deprecated - private Hashtable<Node,Object> in; - - /** - * @deprecated If you need a map field, declare it yourself. - */ - @Deprecated - private Hashtable<Node,Object> out; - - @Deprecated - @Override - public Object getIn(Node node) - { - if(this.in == null) - { - return null; - } - - return this.in.get(node); - } - - @Deprecated - @Override - public void setIn(Node node, Object o) - { - if(this.in == null) - { - this.in = new Hashtable<Node,Object>(1); - } - - if(o != null) - { - this.in.put(node, o); - } - else - { - this.in.remove(node); - } - } - - @Deprecated - @Override - public Object getOut(Node node) - { - if(this.out == null) - { - return null; - } - - return this.out.get(node); - } - - @Deprecated - @Override - public void setOut(Node node, Object o) - { - if(this.out == null) - { - this.out = new Hashtable<Node,Object>(1); - } - - if(o != null) - { - this.out.put(node, o); - } - else - { - this.out.remove(node); - } - } - @Override public void caseStart(Start node) { diff --git a/src/main/java/org/sablecc/sablecc/parser/Parser.java b/src/main/java/org/sablecc/sablecc/parser/Parser.java index c9535df..b8df0f0 100644 --- a/src/main/java/org/sablecc/sablecc/parser/Parser.java +++ b/src/main/java/org/sablecc/sablecc/parser/Parser.java @@ -145,16 +145,6 @@ public class Parser implements IParser return -1; } - /** - * @param productionRuleAsString internal name of the production rule in question - * @return {@code false} if creation of a new list should be skipped, {@code true} for default behavior - * @deprecated Overriding this method no longer has any effect. This optimization is now applied automatically iff it is safe. - */ - @Deprecated - protected boolean addElementsFromListToNewList(String productionRuleAsString) { - return true; - } - private void push(int numstate, List<Object> listNode) throws ParserException, LexerException, IOException { this.nodeList = listNode; diff --git a/src/main/resources/org/sablecc/sablecc/analyses.txt b/src/main/resources/org/sablecc/sablecc/analyses.txt index 4a31607..4abcb08 100644 --- a/src/main/resources/org/sablecc/sablecc/analyses.txt +++ b/src/main/resources/org/sablecc/sablecc/analyses.txt @@ -14,38 +14,6 @@ import $1$.*; public interface Analysis extends Switch { - /** - * @param node the node for which to look up the associated object - * @return the corresponding object previously associated using {@link #setIn(Node, Object)}, or {@code null} if there is none - * @deprecated If you need a map field, declare it yourself. - */ - @Deprecated - Object getIn(Node node); - - /** - * @param node the node with which to associate the given object - * @param o the object to associate with the node - * @deprecated If you need a map field, declare it yourself. - */ - @Deprecated - void setIn(Node node, Object o); - - /** - * @param node the node for which to look up the associated object - * @return the corresponding object previously associated using {@link #setOut(Node, Object)}, or {@code null} if there is none - * @deprecated If you need a map field, declare it yourself. - */ - @Deprecated - Object getOut(Node node); - - /** - * @param node the node with which to associate the given object - * @param o the object to associate with the node - * @deprecated If you need a map field, declare it yourself. - */ - @Deprecated - void setOut(Node node, Object o); - $ Macro:AnalysisStart @@ -69,85 +37,10 @@ Macro:AnalysisAdapterHeader package $0$; -import java.util.*; import $1$.*; public class AnalysisAdapter implements Analysis { - /** - * @deprecated If you need a map field, declare it yourself. - */ - @Deprecated - private Hashtable<Node,Object> in; - - /** - * @deprecated If you need a map field, declare it yourself. - */ - @Deprecated - private Hashtable<Node,Object> out; - - @Deprecated - @Override - public Object getIn(Node node) - { - if(this.in == null) - { - return null; - } - - return this.in.get(node); - } - - @Deprecated - @Override - public void setIn(Node node, Object o) - { - if(this.in == null) - { - this.in = new Hashtable<Node,Object>(1); - } - - if(o != null) - { - this.in.put(node, o); - } - else - { - this.in.remove(node); - } - } - - @Deprecated - @Override - public Object getOut(Node node) - { - if(this.out == null) - { - return null; - } - - return this.out.get(node); - } - - @Deprecated - @Override - public void setOut(Node node, Object o) - { - if(this.out == null) - { - this.out = new Hashtable<Node,Object>(1); - } - - if(o != null) - { - this.out.put(node, o); - } - else - { - this.out.remove(node); - } - } - $ Macro:AnalysisAdapterStart diff --git a/src/main/resources/org/sablecc/sablecc/parser.txt b/src/main/resources/org/sablecc/sablecc/parser.txt index e24642d..9a416e2 100644 --- a/src/main/resources/org/sablecc/sablecc/parser.txt +++ b/src/main/resources/org/sablecc/sablecc/parser.txt @@ -153,16 +153,6 @@ public class Parser implements IParser return -1; } - /** - * @param productionRuleAsString internal name of the production rule in question - * @return {@code false} if creation of a new list should be skipped, {@code true} for default behavior - * @deprecated Overriding this method no longer has any effect. This optimization is now applied automatically iff it is safe. - */ - @Deprecated - protected boolean addElementsFromListToNewList(String productionRuleAsString) { - return true; - } - $ Macro:ParserInliningPushHeader -- GitLab