1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-11-17 12:08:54 +00:00

Syntax changes.

This commit is contained in:
jespergravgaard 2020-04-06 08:06:00 +02:00
parent 263987f059
commit 0a11eefda0
2 changed files with 3 additions and 7 deletions

View File

@ -9,7 +9,7 @@ import org.antlr.v4.runtime.*;
* <p>
* Used by #if in the preprocessor
*/
public class ExpressionParser {
public class ExprParser {
/**
* Parse an expression

View File

@ -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<String> 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<String> {