From 5f63092edce2a7eb1db00b8712691a3f18b2095d Mon Sep 17 00:00:00 2001 From: Jonathan Shook Date: Fri, 15 May 2020 10:45:54 -0500 Subject: [PATCH] misc AST cleanups --- .../java/io/nosqlbench/virtdata/lang/ast/Assignment.java | 3 ++- .../java/io/nosqlbench/virtdata/lang/ast/BooleanArg.java | 1 + .../java/io/nosqlbench/virtdata/lang/ast/FunctionCall.java | 2 +- .../java/io/nosqlbench/virtdata/lang/ast/IntegerArg.java | 1 + .../main/java/io/nosqlbench/virtdata/lang/ast/LongArg.java | 1 + .../main/java/io/nosqlbench/virtdata/lang/ast/RefArg.java | 1 + .../main/java/io/nosqlbench/virtdata/lang/ast/StringArg.java | 1 + .../java/io/nosqlbench/virtdata/lang/ast/VariableRef.java | 5 +++++ .../java/io/nosqlbench/virtdata/lang/ast/VirtDataAST.java | 3 ++- .../java/io/nosqlbench/virtdata/lang/ast/VirtDataFlow.java | 3 ++- 10 files changed, 17 insertions(+), 4 deletions(-) diff --git a/virtdata-lang/src/main/java/io/nosqlbench/virtdata/lang/ast/Assignment.java b/virtdata-lang/src/main/java/io/nosqlbench/virtdata/lang/ast/Assignment.java index fb2b27c2c..2157f68cf 100644 --- a/virtdata-lang/src/main/java/io/nosqlbench/virtdata/lang/ast/Assignment.java +++ b/virtdata-lang/src/main/java/io/nosqlbench/virtdata/lang/ast/Assignment.java @@ -1,7 +1,8 @@ package io.nosqlbench.virtdata.lang.ast; public class Assignment { - private String variableName; + + private final String variableName; public Assignment(String variableName) { this.variableName = variableName; diff --git a/virtdata-lang/src/main/java/io/nosqlbench/virtdata/lang/ast/BooleanArg.java b/virtdata-lang/src/main/java/io/nosqlbench/virtdata/lang/ast/BooleanArg.java index 6be1b3618..d3ae267d5 100644 --- a/virtdata-lang/src/main/java/io/nosqlbench/virtdata/lang/ast/BooleanArg.java +++ b/virtdata-lang/src/main/java/io/nosqlbench/virtdata/lang/ast/BooleanArg.java @@ -1,6 +1,7 @@ package io.nosqlbench.virtdata.lang.ast; public class BooleanArg implements ArgType { + private final boolean boolValue; public BooleanArg(boolean boolValue) { diff --git a/virtdata-lang/src/main/java/io/nosqlbench/virtdata/lang/ast/FunctionCall.java b/virtdata-lang/src/main/java/io/nosqlbench/virtdata/lang/ast/FunctionCall.java index 4ea2b597b..4cf103b5e 100644 --- a/virtdata-lang/src/main/java/io/nosqlbench/virtdata/lang/ast/FunctionCall.java +++ b/virtdata-lang/src/main/java/io/nosqlbench/virtdata/lang/ast/FunctionCall.java @@ -5,7 +5,7 @@ import java.util.List; public class FunctionCall implements ArgType { private String funcName; - private List args = new ArrayList<>(); + private final List args = new ArrayList<>(); private String inputType; private String outputType; private String inputClass; diff --git a/virtdata-lang/src/main/java/io/nosqlbench/virtdata/lang/ast/IntegerArg.java b/virtdata-lang/src/main/java/io/nosqlbench/virtdata/lang/ast/IntegerArg.java index f7b4b273f..57697bc52 100644 --- a/virtdata-lang/src/main/java/io/nosqlbench/virtdata/lang/ast/IntegerArg.java +++ b/virtdata-lang/src/main/java/io/nosqlbench/virtdata/lang/ast/IntegerArg.java @@ -1,6 +1,7 @@ package io.nosqlbench.virtdata.lang.ast; public class IntegerArg implements ArgType { + private final int intValue; public IntegerArg(Integer integer) { diff --git a/virtdata-lang/src/main/java/io/nosqlbench/virtdata/lang/ast/LongArg.java b/virtdata-lang/src/main/java/io/nosqlbench/virtdata/lang/ast/LongArg.java index 53feff376..0af21615c 100644 --- a/virtdata-lang/src/main/java/io/nosqlbench/virtdata/lang/ast/LongArg.java +++ b/virtdata-lang/src/main/java/io/nosqlbench/virtdata/lang/ast/LongArg.java @@ -1,6 +1,7 @@ package io.nosqlbench.virtdata.lang.ast; public class LongArg implements ArgType { + private final long longValue; public LongArg(Long longValue) { diff --git a/virtdata-lang/src/main/java/io/nosqlbench/virtdata/lang/ast/RefArg.java b/virtdata-lang/src/main/java/io/nosqlbench/virtdata/lang/ast/RefArg.java index b707158fc..0358c983a 100644 --- a/virtdata-lang/src/main/java/io/nosqlbench/virtdata/lang/ast/RefArg.java +++ b/virtdata-lang/src/main/java/io/nosqlbench/virtdata/lang/ast/RefArg.java @@ -1,6 +1,7 @@ package io.nosqlbench.virtdata.lang.ast; public class RefArg implements ArgType { + private final String refName; public RefArg(String refName) { diff --git a/virtdata-lang/src/main/java/io/nosqlbench/virtdata/lang/ast/StringArg.java b/virtdata-lang/src/main/java/io/nosqlbench/virtdata/lang/ast/StringArg.java index 5b7596bca..af06ab780 100644 --- a/virtdata-lang/src/main/java/io/nosqlbench/virtdata/lang/ast/StringArg.java +++ b/virtdata-lang/src/main/java/io/nosqlbench/virtdata/lang/ast/StringArg.java @@ -1,6 +1,7 @@ package io.nosqlbench.virtdata.lang.ast; public class StringArg implements ArgType { + private final String rawEscapedText; private final String unEscapedText; diff --git a/virtdata-lang/src/main/java/io/nosqlbench/virtdata/lang/ast/VariableRef.java b/virtdata-lang/src/main/java/io/nosqlbench/virtdata/lang/ast/VariableRef.java index e46879054..3fd76dc66 100644 --- a/virtdata-lang/src/main/java/io/nosqlbench/virtdata/lang/ast/VariableRef.java +++ b/virtdata-lang/src/main/java/io/nosqlbench/virtdata/lang/ast/VariableRef.java @@ -1,9 +1,14 @@ package io.nosqlbench.virtdata.lang.ast; public class VariableRef { + private final String refName; public VariableRef(String refName) { this.refName = refName; } + + public String getRefName() { + return this.refName; + } } diff --git a/virtdata-lang/src/main/java/io/nosqlbench/virtdata/lang/ast/VirtDataAST.java b/virtdata-lang/src/main/java/io/nosqlbench/virtdata/lang/ast/VirtDataAST.java index 9001b4109..97f81e367 100644 --- a/virtdata-lang/src/main/java/io/nosqlbench/virtdata/lang/ast/VirtDataAST.java +++ b/virtdata-lang/src/main/java/io/nosqlbench/virtdata/lang/ast/VirtDataAST.java @@ -4,7 +4,8 @@ import java.util.ArrayList; import java.util.List; public class VirtDataAST { - private List flows = new ArrayList<>(); + + private final List flows = new ArrayList<>(); public void addFlow(VirtDataFlow flow) { this.flows.add(flow); diff --git a/virtdata-lang/src/main/java/io/nosqlbench/virtdata/lang/ast/VirtDataFlow.java b/virtdata-lang/src/main/java/io/nosqlbench/virtdata/lang/ast/VirtDataFlow.java index 472d21b27..fe5a0cb6e 100644 --- a/virtdata-lang/src/main/java/io/nosqlbench/virtdata/lang/ast/VirtDataFlow.java +++ b/virtdata-lang/src/main/java/io/nosqlbench/virtdata/lang/ast/VirtDataFlow.java @@ -4,7 +4,8 @@ import java.util.ArrayList; import java.util.List; public class VirtDataFlow { - private List expressions = new ArrayList<>(); + + private final List expressions = new ArrayList<>(); public List getExpressions() { return expressions;