Class: Syntax::Convertors::Abstract

Class Syntax::Convertors::Abstract |
In: | lib/syntax/convertors/abstract.rb
Parent: | Object

The abstract ancestor class for all convertors. It implements a few convenience methods to provide a common interface for all convertors.

Methods

- for_syntax
- new

Attributes

[R] | tokenizer | A reference to the tokenizer used by this convertor.

Public Class methods
for_syntax( syntax )

A convenience method for instantiating a new convertor for a specific syntax.

[ show source ]

        # File lib/syntax/convertors/abstract.rb, line 15
    15:       def self.for_syntax( syntax )
    16:         new( Syntax.load( syntax ) )
    17:       end

new( tokenizer )

Creates a new convertor that uses the given tokenizer.

[ show source ]

        # File lib/syntax/convertors/abstract.rb, line 20
    20:       def initialize( tokenizer )
    21:         @tokenizer = tokenizer
    22:       end