renamings
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import lexer.StupsLexer;
|
||||
import org.antlr.v4.runtime.CharStreams;
|
||||
import org.antlr.v4.runtime.Lexer;
|
||||
import parser.Parser;
|
||||
import parser.StupsParser;
|
||||
import parser.grammar.Grammar;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -50,9 +50,9 @@ public final class StupsCompiler {
|
||||
return;
|
||||
}
|
||||
|
||||
Parser parser = Parser.fromGrammar(grammar);
|
||||
StupsParser stupsParser = StupsParser.fromGrammar(grammar);
|
||||
|
||||
parser.parse(lexer.getAllTokens(), lexer.getVocabulary());
|
||||
stupsParser.parse(lexer.getAllTokens(), lexer.getVocabulary());
|
||||
|
||||
System.out.println("Compilation completed.");
|
||||
}
|
||||
|
||||
@ -15,21 +15,21 @@ import java.util.List;
|
||||
|
||||
import static util.Logger.log;
|
||||
|
||||
public class Parser {
|
||||
public class StupsParser {
|
||||
|
||||
private final ParsingTable parsetable;
|
||||
|
||||
public Parser(ParsingTable parsetable) {
|
||||
public StupsParser(ParsingTable parsetable) {
|
||||
this.parsetable = parsetable;
|
||||
}
|
||||
|
||||
public static Parser fromGrammar(Path path) throws IOException {
|
||||
return Parser.fromGrammar(Grammar.fromFile(path));
|
||||
public static StupsParser fromGrammar(Path path) throws IOException {
|
||||
return StupsParser.fromGrammar(Grammar.fromFile(path));
|
||||
}
|
||||
|
||||
public static Parser fromGrammar(Grammar grammar) {
|
||||
public static StupsParser fromGrammar(Grammar grammar) {
|
||||
GrammarAnalyzer analyzer = new GrammarAnalyzer(grammar);
|
||||
return new Parser(analyzer.getTable());
|
||||
return new StupsParser(analyzer.getTable());
|
||||
}
|
||||
|
||||
public AST parse(List<? extends Token> token, Vocabulary voc) {
|
||||
Reference in New Issue
Block a user