mirror of
https://gitlab.com/camelot/kickc.git
synced 2024-11-22 16:33:48 +00:00
Syntax changes.
This commit is contained in:
parent
263987f059
commit
0a11eefda0
@ -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
|
@ -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> {
|
||||
|
Loading…
Reference in New Issue
Block a user