Module: ANTLR3::TokenFactory

Overview

There are a variety of different entities throughout the ANTLR runtime library that need to create token objects This module serves as a mixin that provides methods for constructing tokens.

Including this module provides a token_class attribute. Instance of the including class can create tokens using the token class (which defaults to ANTLR3::CommonToken). Token classes are presumed to have an #initialize method that can be called without any parameters and the token objects are expected to have the standard token attributes (see ANTLR3::Token).