From 0a11eefda04ddd83e83757ddebe29f65bd4d7d2b Mon Sep 17 00:00:00 2001 From: jespergravgaard Date: Mon, 6 Apr 2020 08:06:00 +0200 Subject: [PATCH] Syntax changes. --- .../parser/{ExpressionParser.java => ExprParser.java} | 2 +- .../{TestExpressionParser.java => TestExprParser.java} | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) rename src/main/java/dk/camelot64/kickc/parser/{ExpressionParser.java => ExprParser.java} (97%) rename src/test/java/dk/camelot64/kickc/parsing/{TestExpressionParser.java => TestExprParser.java} (92%) diff --git a/src/main/java/dk/camelot64/kickc/parser/ExpressionParser.java b/src/main/java/dk/camelot64/kickc/parser/ExprParser.java similarity index 97% rename from src/main/java/dk/camelot64/kickc/parser/ExpressionParser.java rename to src/main/java/dk/camelot64/kickc/parser/ExprParser.java index a94a09d71..886eef541 100644 --- a/src/main/java/dk/camelot64/kickc/parser/ExpressionParser.java +++ b/src/main/java/dk/camelot64/kickc/parser/ExprParser.java @@ -9,7 +9,7 @@ import org.antlr.v4.runtime.*; *

* Used by #if in the preprocessor */ -public class ExpressionParser { +public class ExprParser { /** * Parse an expression diff --git a/src/test/java/dk/camelot64/kickc/parsing/TestExpressionParser.java b/src/test/java/dk/camelot64/kickc/parsing/TestExprParser.java similarity index 92% rename from src/test/java/dk/camelot64/kickc/parsing/TestExpressionParser.java rename to src/test/java/dk/camelot64/kickc/parsing/TestExprParser.java index 14c6c8409..4e40571fb 100644 --- a/src/test/java/dk/camelot64/kickc/parsing/TestExpressionParser.java +++ b/src/test/java/dk/camelot64/kickc/parsing/TestExprParser.java @@ -7,10 +7,7 @@ import org.antlr.v4.runtime.CodePointCharStream; import org.antlr.v4.runtime.tree.TerminalNode; import org.junit.Test; -import java.io.IOException; -import java.net.URISyntaxException; - -public class TestExpressionParser { +public class TestExprParser { /** * Test the ExpressionParser @@ -28,13 +25,12 @@ public class TestExpressionParser { CodePointCharStream fragmentCharStream = CharStreams.fromString(expr); CParser cParser = new CParser(null); KickCLexer kickCLexer = new KickCLexer(fragmentCharStream, cParser); - KickCParser.ExprContext exprContext = ExpressionParser.parseExpression(kickCLexer); + KickCParser.ExprContext exprContext = ExprParser.parseExpression(kickCLexer); final KickCParserBaseVisitor exprVisitor = new ExprPrinter(); final String exprOut = exprVisitor.visit(exprContext); TestCase.assertEquals("Expression output does not match ", expected, exprOut); } - /** Prints the expression. */ private static class ExprPrinter extends KickCParserBaseVisitor {