dependencies {
javaCup group: 'nz.ac.waikato.cms.weka.thirdparty', name: 'java-cup-11b', version: '2015.03.26'
- flex group: 'de.jflex', name: 'jflex', version: '1.6.1'
+ flex group: 'de.jflex', name: 'jflex', version: '1.7.0'
compile group: 'org.json', name: 'json', version: '20180130'
- implementation group: 'nz.ac.waikato.cms.weka.thirdparty', name: 'java-cup-11b', version: '2015.03.26'
implementation group: 'nz.ac.waikato.cms.weka.thirdparty', name: 'java-cup-11b-runtime', version: '2015.03.26'
// NB When you update to a newer version of Groovy here, also change
private Block currentBlock = null;
private Tag currentTag = null;
- static <T> List<T> createList() {
+ <T> List<T> createList() {
return new Vector<T>();
}
- static <T> List<T> createList(T o) {
+ <T> List<T> createList(T o) {
List<T> l = createList();
l.add(o);
return l;
}
- static <T> List<T> append(List<T> l, T o) {
+ <T> List<T> append(List<T> l, T o) {
l.add(o);
return l;
}
- static Expression getRValue(final Variable id) {
+ Expression getRValue(final Variable id) {
return new IDExpression(id);
}
- static Import createImport(String name) throws ParseException {
+ Import createImport(String name) throws ParseException {
boolean ok = name.length() > 0;
for (int i=0; ok && i<name.length(); i++) {
char c = name.charAt(i);
throw new ParseException("Illegal import statement: import " + name + ";");
}
- static Variable createDotRef(final Variable variable, final String label) {
+ Variable createDotRef(final Variable variable, final String label) {
return new Variable() {
public String getName() {
return variable.getName() + "." + label;
};
}
- static Variable createAttributeRef(final Variable variable, final String attribute) {
+ Variable createAttributeRef(final Variable variable, final String attribute) {
return new Variable() {
public String getName() {
return variable.getName() + "#" + attribute;
}
- static void debug_output(String s) {
+ void debug_output(String s) {
//System.out.println(s);
}
- private static class Elements<ElemType> {
+ private class Elements<ElemType> {
public List<String> labels;
public List<ElemType> values;
dependencies {
javaCup group: 'nz.ac.waikato.cms.weka.thirdparty', name: 'java-cup-11b', version: '2015.03.26'
- flex group: 'de.jflex', name: 'jflex', version: '1.6.1'
+ flex group: 'de.jflex', name: 'jflex', version: '1.7.0'
implementation group: 'nz.ac.waikato.cms.weka.thirdparty', name: 'java-cup-11b', version: '2015.03.26'
implementation group: 'nz.ac.waikato.cms.weka.thirdparty', name: 'java-cup-11b-runtime', version: '2015.03.26'
action code{:
- private static MlfNonterminalNode createTree(List<List<MlfNode>> lines, Map<String, Map<List<String>, String>> substitutions) {
+ private MlfNonterminalNode createTree(List<List<MlfNode>> lines, Map<String, Map<List<String>, String>> substitutions) {
MlfNode matrix[][] = new MlfNode[lines.size()][];
int maxdepth = 0;
int size=0;
return vroot;
}
- private static void substitute(MlfNode n, Map<String, Map<List<String>, String>> substitutions) {
+ private void substitute(MlfNode n, Map<String, Map<List<String>, String>> substitutions) {
if (!apply(n, substitutions)) {
for (int i=0; i<n.numChildren(); i++)
substitute(n.getChild(i), substitutions);
}
- private static boolean apply(MlfNode n, Map<String, Map<List<String>, String>> substitutions) {
+ private boolean apply(MlfNode n, Map<String, Map<List<String>, String>> substitutions) {
if (substitutions != null && n instanceof MlfNonterminalNode) {
Map<List<String>, String> subs = substitutions.get(n.getLabel());
if (subs != null) {