From 44a8d9d2d56a311293ec86ea40df7126748300a1 Mon Sep 17 00:00:00 2001 From: "Benjamin J. Culkin" Date: Thu, 7 Jun 2018 20:37:51 -0300 Subject: Refactoring The main refactoring here is removing the type field from the various classes, but there are a few other smaller ones. This also contains the grounds for a refactoring on variable use --- .../bjc/rgens/parser/templates/TemplateElement.java | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'src/main/java/bjc/rgens/parser/templates/TemplateElement.java') diff --git a/src/main/java/bjc/rgens/parser/templates/TemplateElement.java b/src/main/java/bjc/rgens/parser/templates/TemplateElement.java index dc123f3..2d0724b 100644 --- a/src/main/java/bjc/rgens/parser/templates/TemplateElement.java +++ b/src/main/java/bjc/rgens/parser/templates/TemplateElement.java @@ -3,24 +3,12 @@ package bjc.rgens.parser.templates; import bjc.rgens.parser.GenerationState; public abstract class TemplateElement { - public static enum ElementType { - LITERAL(true), - TEMPLATE(true), - PRAGMA(false); - - public final boolean spacing; - - private ElementType(boolean spacing) { - this.spacing = spacing; - } - } - - public final ElementType type; + public boolean spacing; public GrammarTemplate belongsTo; - protected TemplateElement(ElementType type) { - this.type = type; + protected TemplateElement(boolean spacing) { + this.spacing = spacing; } public abstract void generate(GenerationState state); -- cgit v1.2.3