mirror of
https://github.com/uwol/proleap-vb6-parser.git
synced 2025-12-18 20:44:35 +03:00
removed commons-lang3
This commit is contained in:
22
pom.xml
22
pom.xml
@@ -108,6 +108,16 @@
|
|||||||
<defaultGoal>package</defaultGoal>
|
<defaultGoal>package</defaultGoal>
|
||||||
</build>
|
</build>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.guava</groupId>
|
||||||
|
<artifactId>guava</artifactId>
|
||||||
|
<version>27.0-jre</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-io</groupId>
|
||||||
|
<artifactId>commons-io</artifactId>
|
||||||
|
<version>2.5</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.antlr</groupId>
|
<groupId>org.antlr</groupId>
|
||||||
<artifactId>antlr4</artifactId>
|
<artifactId>antlr4</artifactId>
|
||||||
@@ -123,24 +133,12 @@
|
|||||||
<artifactId>antlr4-maven-plugin</artifactId>
|
<artifactId>antlr4-maven-plugin</artifactId>
|
||||||
<version>${antlr.version}</version>
|
<version>${antlr.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-api</artifactId>
|
<artifactId>slf4j-api</artifactId>
|
||||||
<version>1.7.25</version>
|
<version>1.7.25</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>commons-io</groupId>
|
|
||||||
<artifactId>commons-io</artifactId>
|
|
||||||
<version>2.5</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.commons</groupId>
|
|
||||||
<artifactId>commons-lang3</artifactId>
|
|
||||||
<version>3.5</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>junit</groupId>
|
<groupId>junit</groupId>
|
||||||
<artifactId>junit</artifactId>
|
<artifactId>junit</artifactId>
|
||||||
|
|||||||
@@ -9,7 +9,8 @@
|
|||||||
package io.proleap.vb6.asg.metamodel.impl;
|
package io.proleap.vb6.asg.metamodel.impl;
|
||||||
|
|
||||||
import org.antlr.v4.runtime.ParserRuleContext;
|
import org.antlr.v4.runtime.ParserRuleContext;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
|
import com.google.common.base.Strings;
|
||||||
|
|
||||||
import io.proleap.vb6.asg.metamodel.Module;
|
import io.proleap.vb6.asg.metamodel.Module;
|
||||||
import io.proleap.vb6.asg.metamodel.Program;
|
import io.proleap.vb6.asg.metamodel.Program;
|
||||||
@@ -59,6 +60,6 @@ public abstract class ScopedElementImpl extends ASGElementImpl implements Scoped
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected String getSymbol(final String name) {
|
protected String getSymbol(final String name) {
|
||||||
return StringUtils.isBlank(name) ? name : name.toLowerCase();
|
return Strings.isNullOrEmpty(name) ? name : name.toLowerCase();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import org.antlr.v4.runtime.CharStreams;
|
|||||||
import org.antlr.v4.runtime.CommonTokenStream;
|
import org.antlr.v4.runtime.CommonTokenStream;
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
import org.apache.commons.io.FilenameUtils;
|
import org.apache.commons.io.FilenameUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@@ -162,13 +161,17 @@ public class VbParserRunnerImpl implements VbParserRunner {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected String capitalize(final String line) {
|
||||||
|
return Character.toUpperCase(line.charAt(0)) + line.substring(1);
|
||||||
|
}
|
||||||
|
|
||||||
protected VbParserParams createDefaultParams() {
|
protected VbParserParams createDefaultParams() {
|
||||||
final VbParserParams result = new VbParserParamsImpl();
|
final VbParserParams result = new VbParserParamsImpl();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String getModuleName(final File inputFile) {
|
protected String getModuleName(final File inputFile) {
|
||||||
return StringUtils.capitalize(FilenameUtils.removeExtension(inputFile.getName()));
|
return capitalize(FilenameUtils.removeExtension(inputFile.getName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean isClazzModule(final File inputFile) {
|
protected boolean isClazzModule(final File inputFile) {
|
||||||
|
|||||||
@@ -19,10 +19,11 @@ import java.util.Arrays;
|
|||||||
import org.antlr.v4.runtime.ANTLRInputStream;
|
import org.antlr.v4.runtime.ANTLRInputStream;
|
||||||
import org.antlr.v4.runtime.CommonTokenStream;
|
import org.antlr.v4.runtime.CommonTokenStream;
|
||||||
import org.apache.commons.io.FilenameUtils;
|
import org.apache.commons.io.FilenameUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import com.google.common.base.Strings;
|
||||||
|
|
||||||
import io.proleap.vb6.VisualBasic6Parser.StartRuleContext;
|
import io.proleap.vb6.VisualBasic6Parser.StartRuleContext;
|
||||||
import io.proleap.vb6.util.TreeUtils;
|
import io.proleap.vb6.util.TreeUtils;
|
||||||
|
|
||||||
@@ -110,7 +111,7 @@ public class TestGenerator {
|
|||||||
subOutputDirectory.mkdirs();
|
subOutputDirectory.mkdirs();
|
||||||
|
|
||||||
// determine the package name of test classes
|
// determine the package name of test classes
|
||||||
final String subPackageName = StringUtils.isBlank(packageName) ? subInputDirectoryName
|
final String subPackageName = Strings.isNullOrEmpty(packageName) ? subInputDirectoryName
|
||||||
: packageName + "." + subInputDirectoryName;
|
: packageName + "." + subInputDirectoryName;
|
||||||
|
|
||||||
generateTestClasses(subInputDirectory, subOutputDirectory, subPackageName);
|
generateTestClasses(subInputDirectory, subOutputDirectory, subPackageName);
|
||||||
|
|||||||
@@ -21,10 +21,11 @@ import org.antlr.v4.runtime.CommonTokenStream;
|
|||||||
import org.antlr.v4.runtime.tree.Trees;
|
import org.antlr.v4.runtime.tree.Trees;
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
import org.apache.commons.io.FilenameUtils;
|
import org.apache.commons.io.FilenameUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import com.google.common.base.Strings;
|
||||||
|
|
||||||
import io.proleap.vb6.VisualBasic6Lexer;
|
import io.proleap.vb6.VisualBasic6Lexer;
|
||||||
import io.proleap.vb6.VisualBasic6Parser;
|
import io.proleap.vb6.VisualBasic6Parser;
|
||||||
import io.proleap.vb6.VisualBasic6Parser.StartRuleContext;
|
import io.proleap.vb6.VisualBasic6Parser.StartRuleContext;
|
||||||
@@ -57,7 +58,7 @@ public class VbParseTestRunnerImpl implements VbParseTestRunner {
|
|||||||
|
|
||||||
final String treeFileData = FileUtils.readFileToString(treeFile);
|
final String treeFileData = FileUtils.readFileToString(treeFile);
|
||||||
|
|
||||||
if (!StringUtils.isBlank(treeFileData)) {
|
if (!Strings.isNullOrEmpty(treeFileData)) {
|
||||||
LOG.info("Comparing parse tree with file {}.", treeFile.getName());
|
LOG.info("Comparing parse tree with file {}.", treeFile.getName());
|
||||||
|
|
||||||
final String inputFileTree = Trees.toStringTree(startRule, parser);
|
final String inputFileTree = Trees.toStringTree(startRule, parser);
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ import org.antlr.v4.runtime.tree.Tree;
|
|||||||
import org.antlr.v4.runtime.tree.Trees;
|
import org.antlr.v4.runtime.tree.Trees;
|
||||||
import org.sonatype.inject.Nullable;
|
import org.sonatype.inject.Nullable;
|
||||||
|
|
||||||
|
import com.google.common.base.Strings;
|
||||||
|
|
||||||
public class TreeUtils {
|
public class TreeUtils {
|
||||||
|
|
||||||
public static final String NEWLINE = "\n";
|
public static final String NEWLINE = "\n";
|
||||||
@@ -16,7 +18,7 @@ public class TreeUtils {
|
|||||||
public static final String TAB = "\t";
|
public static final String TAB = "\t";
|
||||||
|
|
||||||
public static String indent(final int indent) {
|
public static String indent(final int indent) {
|
||||||
return org.apache.commons.lang3.StringUtils.repeat(TAB, indent);
|
return Strings.repeat(TAB, indent);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user