Module: ANTLR3::Template::Builder

Extended by:
ClassMacros
Included in:
RewriteBuilder
Defined in:
lib/antlr3/template.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object


36
37
38
39
# File 'lib/antlr3/template.rb', line 36

def self.included( klass )
  super
  Class === klass and klass.extend( ClassMethods )
end

Instance Method Details

#create_template(source, values = {}) ⇒ Object


51
52
53
# File 'lib/antlr3/template.rb', line 51

def create_template( source, values = {} )
  @templates.new( source, values )
end

#fetch_template(name, values = {}) ⇒ Object


55
56
57
# File 'lib/antlr3/template.rb', line 55

def fetch_template( name, values = {} )
  @templates.fetch( name, values )
end

#initialize(input, options = {}) ⇒ Object


41
42
43
44
45
46
47
# File 'lib/antlr3/template.rb', line 41

def initialize( input, options = {} )
  templates = @templates || options.fetch( :templates ) do
    self.class.template_library or ANTLR3::Template::Group.new
  end
  super( input, options )
  self.templates = templates
end