only:EPIC: Improve toolset for default tune canned tune generation #4871
This commit is contained in:
parent
8c2ba87915
commit
de9fb2ab69
|
@ -10,6 +10,11 @@ public interface ConfigField {
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConfigStructure getParent() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isArray() {
|
||||
return false;
|
||||
|
@ -158,6 +163,8 @@ public interface ConfigField {
|
|||
}
|
||||
}
|
||||
|
||||
ConfigStructure getParent();
|
||||
|
||||
ConfigStructure getStructureType();
|
||||
|
||||
boolean isArray();
|
||||
|
|
|
@ -50,6 +50,7 @@ public class ConfigFieldImpl implements ConfigField {
|
|||
private final boolean hasAutoscale;
|
||||
private final String trueName;
|
||||
private final String falseName;
|
||||
private final ConfigStructure parent;
|
||||
private boolean isFromIterate;
|
||||
private String iterateOriginalName;
|
||||
private int iterateIndex;
|
||||
|
@ -78,6 +79,7 @@ public class ConfigFieldImpl implements ConfigField {
|
|||
if (!isVoid())
|
||||
Objects.requireNonNull(state);
|
||||
this.state = state;
|
||||
this.parent = state == null ? null : (state.isStackEmpty() ? null : state.peek());
|
||||
this.comment = comment;
|
||||
|
||||
if (!isVoid())
|
||||
|
@ -104,6 +106,11 @@ public class ConfigFieldImpl implements ConfigField {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConfigStructure getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
private static int getSize(VariableRegistry variableRegistry, String s) {
|
||||
if (variableRegistry.intValues.containsKey(s)) {
|
||||
return variableRegistry.intValues.get(s);
|
||||
|
|
|
@ -39,4 +39,6 @@ public interface ReaderState {
|
|||
List<String> getPrependFiles();
|
||||
|
||||
boolean isStackEmpty();
|
||||
|
||||
ConfigStructure peek();
|
||||
}
|
||||
|
|
|
@ -297,7 +297,8 @@ public class ReaderStateImpl implements ReaderState {
|
|||
name = line;
|
||||
comment = null;
|
||||
}
|
||||
ConfigStructureImpl structure = new ConfigStructureImpl(name, comment, withPrefix);
|
||||
ConfigStructure parent = state.stack.isEmpty() ? null : state.stack.peek();
|
||||
ConfigStructureImpl structure = new ConfigStructureImpl(name, comment, withPrefix, parent);
|
||||
state.stack.push(structure);
|
||||
if (log.debugEnabled())
|
||||
log.debug("Starting structure " + structure.getName());
|
||||
|
@ -443,4 +444,9 @@ public class ReaderStateImpl implements ReaderState {
|
|||
public boolean isStackEmpty() {
|
||||
return stack.isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConfigStructure peek() {
|
||||
return stack.peek();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,8 @@ import java.util.List;
|
|||
public interface ConfigStructure {
|
||||
String UNUSED_ANYTHING_PREFIX = "unused";
|
||||
|
||||
ConfigStructure getParent();
|
||||
|
||||
String getName();
|
||||
|
||||
ConfigField getTsFieldByName(String name);
|
||||
|
|
|
@ -20,6 +20,7 @@ public class ConfigStructureImpl implements ConfigStructure {
|
|||
private final String name;
|
||||
private final String comment;
|
||||
private final boolean withPrefix;
|
||||
private final ConfigStructure parent;
|
||||
private final List<ConfigField> cFields = new ArrayList<>();
|
||||
private final List<ConfigField> tsFields = new ArrayList<>();
|
||||
|
||||
|
@ -32,10 +33,11 @@ public class ConfigStructureImpl implements ConfigStructure {
|
|||
private ConfigField cPrevField = ConfigFieldImpl.VOID;
|
||||
private final Set<String> names = new HashSet<>();
|
||||
|
||||
public ConfigStructureImpl(String name, String comment, boolean withPrefix) {
|
||||
public ConfigStructureImpl(String name, String comment, boolean withPrefix, ConfigStructure parent) {
|
||||
this.name = name;
|
||||
this.comment = comment;
|
||||
this.withPrefix = withPrefix;
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public void addBitField(ConfigFieldImpl bitField) {
|
||||
|
@ -43,6 +45,11 @@ public class ConfigStructureImpl implements ConfigStructure {
|
|||
this.readingBitState.incrementBitIndex(bitField);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConfigStructure getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
|
|
Loading…
Reference in New Issue