Created
March 14, 2018 22:56
-
-
Save jcttrll/2c7c086c76e7edb3f3ba08fdbcd18b27 to your computer and use it in GitHub Desktop.
Demo of Antlr grammar testing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.perihelios.parser.javaregex | |
import com.perihelios.parser.javaregex.helper.TreeMatcher | |
import org.junit.Assert | |
import org.junit.Test | |
class SimpleTests { | |
private TreeMatcher treeMatcher = new TreeMatcher(JavaRegexLexer, JavaRegexParser, "regex") | |
@Test | |
void canary() { | |
Assert.assertThat("a", treeMatcher.parsesToTree({ | |
entity { | |
literalCharacter { | |
token "a" | |
} | |
} | |
EOF() | |
})) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment