From bee92ef11dfb7bd8f16339111e3d153691d27828 Mon Sep 17 00:00:00 2001 From: JanUlrich Date: Fri, 27 Jan 2017 13:20:22 +0100 Subject: [PATCH] Parser package-Struktur umstellen --- src/de/dhbwstuttgart/parser/CompilationUnitEvaluator.java | 7 ++++--- src/de/dhbwstuttgart/parser/JavaXParser.java | 7 +++++++ src/de/dhbwstuttgart/parser/RunParser.java | 6 ++---- src/de/dhbwstuttgart/parser/SyntaxTreeGenerator.java | 2 +- src/de/dhbwstuttgart/parser/{ => antlr}/Java8.g4 | 0 src/de/dhbwstuttgart/parser/{ => antlr}/Java8.tokens | 0 .../parser/{ => antlr}/Java8BaseListener.java | 2 +- src/de/dhbwstuttgart/parser/{ => antlr}/Java8Lexer.java | 2 +- src/de/dhbwstuttgart/parser/{ => antlr}/Java8Lexer.tokens | 0 src/de/dhbwstuttgart/parser/{ => antlr}/Java8Listener.java | 2 +- src/de/dhbwstuttgart/parser/{ => antlr}/Java8Parser.java | 4 +--- 11 files changed, 18 insertions(+), 14 deletions(-) create mode 100644 src/de/dhbwstuttgart/parser/JavaXParser.java rename src/de/dhbwstuttgart/parser/{ => antlr}/Java8.g4 (100%) rename src/de/dhbwstuttgart/parser/{ => antlr}/Java8.tokens (100%) rename src/de/dhbwstuttgart/parser/{ => antlr}/Java8BaseListener.java (99%) rename src/de/dhbwstuttgart/parser/{ => antlr}/Java8Lexer.java (99%) rename src/de/dhbwstuttgart/parser/{ => antlr}/Java8Lexer.tokens (100%) rename src/de/dhbwstuttgart/parser/{ => antlr}/Java8Listener.java (99%) rename src/de/dhbwstuttgart/parser/{ => antlr}/Java8Parser.java (99%) diff --git a/src/de/dhbwstuttgart/parser/CompilationUnitEvaluator.java b/src/de/dhbwstuttgart/parser/CompilationUnitEvaluator.java index fa1b7d1d..af5935ce 100644 --- a/src/de/dhbwstuttgart/parser/CompilationUnitEvaluator.java +++ b/src/de/dhbwstuttgart/parser/CompilationUnitEvaluator.java @@ -1,7 +1,8 @@ package de.dhbwstuttgart.parser; -import org.antlr.v4.runtime.tree.*; -import de.dhbwstuttgart.syntaxtree.*; -public class CompilationUnitEvaluator extends Java8BaseListener{ +import de.dhbwstuttgart.parser.antlr.Java8BaseListener; +import de.dhbwstuttgart.parser.antlr.Java8Parser; + +public class CompilationUnitEvaluator extends Java8BaseListener { @Override public void enterCompilationUnit(Java8Parser.CompilationUnitContext ctx) { System.out.println("SourceFile("); diff --git a/src/de/dhbwstuttgart/parser/JavaXParser.java b/src/de/dhbwstuttgart/parser/JavaXParser.java new file mode 100644 index 00000000..ab9e7c8c --- /dev/null +++ b/src/de/dhbwstuttgart/parser/JavaXParser.java @@ -0,0 +1,7 @@ +package de.dhbwstuttgart.parser; + +/** + * Created by janulrich on 26.01.17. + */ +public class JavaXParser { +} diff --git a/src/de/dhbwstuttgart/parser/RunParser.java b/src/de/dhbwstuttgart/parser/RunParser.java index b5118a92..4f1d5330 100644 --- a/src/de/dhbwstuttgart/parser/RunParser.java +++ b/src/de/dhbwstuttgart/parser/RunParser.java @@ -1,12 +1,10 @@ package de.dhbwstuttgart.parser; -import org.antlr.v4.runtime.*; +import de.dhbwstuttgart.parser.antlr.Java8Lexer; +import de.dhbwstuttgart.parser.antlr.Java8Parser; import org.antlr.v4.runtime.ANTLRInputStream; import org.antlr.v4.runtime.CommonTokenStream; -import org.antlr.v4.runtime.ParserRuleContext; -import org.antlr.v4.runtime.tree.ParseTreeWalker; import de.dhbwstuttgart.syntaxtree.*; import de.dhbwstuttgart.syntaxtree.modifier.*; -import de.dhbwstuttgart.typecheck.*; import java.util.Scanner; import java.io.ByteArrayInputStream; diff --git a/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator.java b/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator.java index 8e01897e..856c821e 100644 --- a/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator.java +++ b/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator.java @@ -1,9 +1,9 @@ package de.dhbwstuttgart.parser; +import de.dhbwstuttgart.parser.antlr.Java8Parser; import de.dhbwstuttgart.syntaxtree.*; import de.dhbwstuttgart.syntaxtree.modifier.*; import de.dhbwstuttgart.syntaxtree.statement.Block; -import de.dhbwstuttgart.syntaxtree.statement.Expr; import de.dhbwstuttgart.syntaxtree.type.RefType; import de.dhbwstuttgart.typecheck.*; import java.util.ArrayList; diff --git a/src/de/dhbwstuttgart/parser/Java8.g4 b/src/de/dhbwstuttgart/parser/antlr/Java8.g4 similarity index 100% rename from src/de/dhbwstuttgart/parser/Java8.g4 rename to src/de/dhbwstuttgart/parser/antlr/Java8.g4 diff --git a/src/de/dhbwstuttgart/parser/Java8.tokens b/src/de/dhbwstuttgart/parser/antlr/Java8.tokens similarity index 100% rename from src/de/dhbwstuttgart/parser/Java8.tokens rename to src/de/dhbwstuttgart/parser/antlr/Java8.tokens diff --git a/src/de/dhbwstuttgart/parser/Java8BaseListener.java b/src/de/dhbwstuttgart/parser/antlr/Java8BaseListener.java similarity index 99% rename from src/de/dhbwstuttgart/parser/Java8BaseListener.java rename to src/de/dhbwstuttgart/parser/antlr/Java8BaseListener.java index 0d26fe00..2181e4fe 100644 --- a/src/de/dhbwstuttgart/parser/Java8BaseListener.java +++ b/src/de/dhbwstuttgart/parser/antlr/Java8BaseListener.java @@ -1,5 +1,5 @@ // Generated from Java8.g4 by ANTLR 4.5.3 -package de.dhbwstuttgart.parser; +package de.dhbwstuttgart.parser.antlr; import org.antlr.v4.runtime.ParserRuleContext; import org.antlr.v4.runtime.tree.ErrorNode; diff --git a/src/de/dhbwstuttgart/parser/Java8Lexer.java b/src/de/dhbwstuttgart/parser/antlr/Java8Lexer.java similarity index 99% rename from src/de/dhbwstuttgart/parser/Java8Lexer.java rename to src/de/dhbwstuttgart/parser/antlr/Java8Lexer.java index 25cab56a..df61e73b 100644 --- a/src/de/dhbwstuttgart/parser/Java8Lexer.java +++ b/src/de/dhbwstuttgart/parser/antlr/Java8Lexer.java @@ -1,5 +1,5 @@ // Generated from Java8.g4 by ANTLR 4.5.3 -package de.dhbwstuttgart.parser; +package de.dhbwstuttgart.parser.antlr; import org.antlr.v4.runtime.Lexer; import org.antlr.v4.runtime.CharStream; import org.antlr.v4.runtime.Token; diff --git a/src/de/dhbwstuttgart/parser/Java8Lexer.tokens b/src/de/dhbwstuttgart/parser/antlr/Java8Lexer.tokens similarity index 100% rename from src/de/dhbwstuttgart/parser/Java8Lexer.tokens rename to src/de/dhbwstuttgart/parser/antlr/Java8Lexer.tokens diff --git a/src/de/dhbwstuttgart/parser/Java8Listener.java b/src/de/dhbwstuttgart/parser/antlr/Java8Listener.java similarity index 99% rename from src/de/dhbwstuttgart/parser/Java8Listener.java rename to src/de/dhbwstuttgart/parser/antlr/Java8Listener.java index 42e85a1a..67d7c051 100644 --- a/src/de/dhbwstuttgart/parser/Java8Listener.java +++ b/src/de/dhbwstuttgart/parser/antlr/Java8Listener.java @@ -1,5 +1,5 @@ // Generated from Java8.g4 by ANTLR 4.5.3 -package de.dhbwstuttgart.parser; +package de.dhbwstuttgart.parser.antlr; import org.antlr.v4.runtime.tree.ParseTreeListener; /** diff --git a/src/de/dhbwstuttgart/parser/Java8Parser.java b/src/de/dhbwstuttgart/parser/antlr/Java8Parser.java similarity index 99% rename from src/de/dhbwstuttgart/parser/Java8Parser.java rename to src/de/dhbwstuttgart/parser/antlr/Java8Parser.java index 00d81f15..2263d056 100644 --- a/src/de/dhbwstuttgart/parser/Java8Parser.java +++ b/src/de/dhbwstuttgart/parser/antlr/Java8Parser.java @@ -1,13 +1,11 @@ // Generated from Java8.g4 by ANTLR 4.5.3 -package de.dhbwstuttgart.parser; +package de.dhbwstuttgart.parser.antlr; import org.antlr.v4.runtime.atn.*; import org.antlr.v4.runtime.dfa.DFA; import org.antlr.v4.runtime.*; import org.antlr.v4.runtime.misc.*; import org.antlr.v4.runtime.tree.*; import java.util.List; -import java.util.Iterator; -import java.util.ArrayList; @SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"}) public class Java8Parser extends Parser {