Class ANTLRTester

  extended by org.norecess.antlr.ANTLRTester

public class ANTLRTester
extends Object

This is the entry point to using ANTLR Testing. Provide the constructor of this class with your own implementation of IANTLRFrontEnd so that the tester can construct instances of your lexer, parser, and tree parser.

Initialization typically looks like this:

 private ANTLRTester myTester;
 public void setUp() {
   myTester = new ANTLRTester(new MyOwnFrontEnd());

See Assert for the kinds of assertions you can make with an ANTLR tester.

Jeremy D. Frens

Constructor Summary
ANTLRTester(IANTLRFrontEnd frontEnd)
          Constructs a tester with a factory for your front end.
Method Summary
 PostScan scanInput(String input)
          Scans the input to generate a token stream.
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public ANTLRTester(IANTLRFrontEnd frontEnd)
Constructs a tester with a factory for your front end.

frontEnd - the front-end factory.
Method Detail


public PostScan scanInput(String input)
Scans the input to generate a token stream. The token stream is actually hidden in the PostScan return value to make assertions (like Assert.assertToken(int, String, PostScan)) or to parse the token stream (with PostScan.parseAs(String)).

See Assert for example usage.

input - input for the lexer
a post-scan processor for assertion or parsing.