Commit d10f778b authored by Alexander Weigl's avatar Alexander Weigl
Browse files

rename lex() to createLexer()

parent f143eeb5
......@@ -39,7 +39,7 @@ public class DebugKeyLexer {
stream = System.out;
lexer = files.stream().map(it -> {
try {
return ParsingFacade.lex(it.toPath());
return ParsingFacade.createLexer(it.toPath());
} catch (IOException e) {
e.printStackTrace(stream);
}
......@@ -73,7 +73,7 @@ public class DebugKeyLexer {
}
public static void debug(String content) {
debug(ParsingFacade.lex(CharStreams.fromString(content)));
debug(ParsingFacade.createLexer(CharStreams.fromString(content)));
}
public static void debug(KeYLexer lexer) {
......
......@@ -74,7 +74,7 @@ public abstract class ParsingFacade {
}
private static KeYParser createParser(CharStream stream) {
KeYParser p = new KeYParser(new CommonTokenStream(lex(stream)));
KeYParser p = new KeYParser(new CommonTokenStream(createLexer(stream)));
p.removeErrorListeners();
p.addErrorListener(p.getErrorReporter());
p.addErrorListener(new ANTLRErrorListener() {
......@@ -102,11 +102,11 @@ public abstract class ParsingFacade {
return p;
}
public static KeYLexer lex(Path file) throws IOException {
return lex(CharStreams.fromPath(file));
public static KeYLexer createLexer(Path file) throws IOException {
return createLexer(CharStreams.fromPath(file));
}
public static KeYLexer lex(CharStream stream) {
public static KeYLexer createLexer(CharStream stream) {
return new KeYLexer(stream);
}
......
......@@ -59,7 +59,7 @@ public class ProofReplayer {
* @param startLine the starting of the sexpr needed for {@code prl}
*/
public static void run(CharStream input, IProofFileParser prl, final int startLine) {
KeYLexer lexer = ParsingFacade.lex(input);
KeYLexer lexer = ParsingFacade.createLexer(input);
CommonTokenStream stream = new CommonTokenStream(lexer);
Stack<IProofFileParser.ProofElementID> stack = new Stack<>(); //currently open proof elements
Stack<Integer> posStack = new Stack<>(); // stack of opened commands position
......
......@@ -8,10 +8,8 @@ import org.jetbrains.annotations.NotNull;
import org.junit.Assert;
import org.junit.Assume;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.key_project.util.testcategories.Interactive;
import java.io.BufferedReader;
import java.io.IOException;
......@@ -52,7 +50,7 @@ public class ExprTest {
KeyIO io = getIo();
@NotNull Term actual = io.parseExpression(expr);
if (actual == null) {
ParseAllKeyFilesTest.debugLexer(ParsingFacade.lex(CharStreams.fromString(expr)));
ParseAllKeyFilesTest.debugLexer(ParsingFacade.createLexer(CharStreams.fromString(expr)));
}
Assert.assertNotNull(actual);
System.out.println(actual);
......
......@@ -74,7 +74,7 @@ public class ParseAllKeyFilesTest {
@Test
public void lex() throws IOException {
KeYLexer toks = ParsingFacade.lex(file);
KeYLexer toks = ParsingFacade.createLexer(file);
debugLexer(toks);
}
}
......@@ -169,7 +169,7 @@ public class TestIntLiteralParsing extends AbstractTestTermParser {
@Test
public void testLex() {
KeYLexer lexer = ParsingFacade.lex(CharStreams.fromString(input));
KeYLexer lexer = ParsingFacade.createLexer(CharStreams.fromString(input));
List<? extends Token> toks = lexer.getAllTokens();
System.out.println(toks);
assertEquals(1, toks.size());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment