Class: Jaina::Parser::CodeConverter::ToPrefixForm Private

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/jaina/parser/code_converter/to_prefix_form.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(program) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • program (String)

Since:

  • 0.1.0



28
29
30
31
32
# File 'lib/jaina/parser/code_converter/to_prefix_form.rb', line 28

def initialize(program)
  @program = program.dup.tap(&:freeze)
  @postfix_form = Jaina::Parser::CodeConverter::ToPostfixForm.call(@program)
  @tokens = Jaina::Parser::Tokenizer.tokenize(@postfix_form)
end

Class Method Details

.call(program) ⇒ String

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • program (String)

Returns:

  • (String)

Since:

  • 0.1.0



15
16
17
# File 'lib/jaina/parser/code_converter/to_prefix_form.rb', line 15

def call(program)
  new(program).call
end

Instance Method Details

#callString

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (String)

Since:

  • 0.1.0



38
39
40
# File 'lib/jaina/parser/code_converter/to_prefix_form.rb', line 38

def call
  to_prefix_form
end