module ANTLR3::Template::RewriteBuilder

Public Class Methods

included( klass ) click to toggle source
Calls superclass method ANTLR3::Template::Builder::included
# File lib/antlr3/template.rb, line 63
def self.included( klass )
  super
  Class === klass and klass.extend( Builder::ClassMethods )
end

Private Instance Methods

cast_input( input, options ) click to toggle source
Calls superclass method
# File lib/antlr3/template.rb, line 70
  def cast_input( input, options )
    case input
    when TokenSource then TokenRewriteStream.new( input, options )
    when IO, String
      if lexer_class = self.class.associated_lexer
        TokenRewriteStream.new( lexer_class.new( input, options ), options )
      else
        raise ArgumentError, Util.tidy( <<-END, true )
        | unable to automatically convert input #{ input.inspect }
        | to a ANTLR3::TokenStream object as #{ self.class }
        | does not appear to have an associated lexer class
        END
      end
    else
      super
    end
  end