Skip to content
Snippets Groups Projects
Commit 620fd6fd authored by dgelessus's avatar dgelessus
Browse files

Use more precise types for some node maps

parent de00b343
Branches
Tags
No related merge requests found
Pipeline #135835 passed
...@@ -19,9 +19,9 @@ public class ConstructParserGenerationDatas extends DepthFirstAdapter ...@@ -19,9 +19,9 @@ public class ConstructParserGenerationDatas extends DepthFirstAdapter
private boolean processingAst; private boolean processingAst;
private String currentProd; private String currentProd;
private Map<String, Node> alts; private Map<String, AAlt> alts;
public ConstructParserGenerationDatas(ResolveIds ids, Map<String, Node> alts) public ConstructParserGenerationDatas(ResolveIds ids, Map<String, AAlt> alts)
{ {
this.ids = ids; this.ids = ids;
this.alts = alts; this.alts = alts;
......
...@@ -81,7 +81,7 @@ public class GenParser extends DepthFirstAdapter ...@@ -81,7 +81,7 @@ public class GenParser extends DepthFirstAdapter
//Those transformations was specified by the grammar-writer. //Those transformations was specified by the grammar-writer.
private final Map<String, List<PElem>> mapProductionTransformations = new HashMap<>(); private final Map<String, List<PElem>> mapProductionTransformations = new HashMap<>();
private Map<String, Node> alts; private Map<String, AAlt> alts;
public GenParser(ResolveIds ids, ResolveAltIds altIds, ResolveTransformIds transformIds, public GenParser(ResolveIds ids, ResolveAltIds altIds, ResolveTransformIds transformIds,
String firstProductionName, boolean processInlining, boolean prettyPrinting) String firstProductionName, boolean processInlining, boolean prettyPrinting)
...@@ -382,7 +382,7 @@ public class GenParser extends DepthFirstAdapter ...@@ -382,7 +382,7 @@ public class GenParser extends DepthFirstAdapter
"" + productions[i].index, "" + productions[i].index,
productions[i].name}); productions[i].name});
final Node node = alts.get(productions[i].name); final AAlt node = alts.get(productions[i].name);
final BufferedWriter finalFile = file; final BufferedWriter finalFile = file;
final Deque<Element> stack = new LinkedList<>(); final Deque<Element> stack = new LinkedList<>();
......
...@@ -231,7 +231,7 @@ public class ResolveAstIds extends DepthFirstAdapter ...@@ -231,7 +231,7 @@ public class ResolveAstIds extends DepthFirstAdapter
else else
{ {
ATokenDef token = astIds.tokens.get("T" + name); ATokenDef token = astIds.tokens.get("T" + name);
Node ignToken = astIds.ignTokens.get("T" + name); TId ignToken = astIds.ignTokens.get("T" + name);
//Object production = astIds.prods.get("P" + name); //Object production = astIds.prods.get("P" + name);
AAstProd ast_production = ast_prods.get("P" + name); AAstProd ast_production = ast_prods.get("P" + name);
//if() //if()
......
...@@ -20,9 +20,9 @@ import org.sablecc.sablecc.node.*; ...@@ -20,9 +20,9 @@ import org.sablecc.sablecc.node.*;
public class ResolveIds extends DepthFirstAdapter public class ResolveIds extends DepthFirstAdapter
{ {
public final Map<String, AHelperDef> helpers = new TreeMap<>(); public final Map<String, AHelperDef> helpers = new TreeMap<>();
public final Map<String, Node> states = new TreeMap<>(); public final Map<String, TId> states = new TreeMap<>();
public final Map<String, ATokenDef> tokens = new TreeMap<>(); public final Map<String, ATokenDef> tokens = new TreeMap<>();
public final Map<String, Node> ignTokens = new TreeMap<>(); public final Map<String, TId> ignTokens = new TreeMap<>();
public final Map<String, AProd> prods = new TreeMap<>(); public final Map<String, AProd> prods = new TreeMap<>();
public final Map<String, AAlt> alts = new HashMap<>(); public final Map<String, AAlt> alts = new HashMap<>();
...@@ -31,8 +31,8 @@ public class ResolveIds extends DepthFirstAdapter ...@@ -31,8 +31,8 @@ public class ResolveIds extends DepthFirstAdapter
public final Map<Node, String> names = new HashMap<>(); public final Map<Node, String> names = new HashMap<>();
public final Map<Node, String> errorNames = new HashMap<>(); public final Map<ATokenDef, String> errorNames = new HashMap<>();
public final Map<Node, String> elemTypes = new HashMap<>(); public final Map<AElem, String> elemTypes = new HashMap<>();
public final Map<String, String> altsElemNameTypes = new HashMap<>(); public final Map<String, String> altsElemNameTypes = new HashMap<>();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment