Skip to content

Instantly share code, notes, and snippets.

@jcttrll
Created March 14, 2018 22:56
Show Gist options
  • Save jcttrll/2c7c086c76e7edb3f3ba08fdbcd18b27 to your computer and use it in GitHub Desktop.
Save jcttrll/2c7c086c76e7edb3f3ba08fdbcd18b27 to your computer and use it in GitHub Desktop.
Demo of Antlr grammar testing
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