Class: Jaina::Parser Private

Inherits:
Object
  • Object
show all
Defined in:
lib/jaina/parser.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

Defined Under Namespace

Modules: Expression, Tokenizer Classes: AST, CodeConverter

Instance Attribute Summary collapse

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



33
34
35
# File 'lib/jaina/parser.rb', line 33

def initialize(program)
  @program = program.dup.tap(&:freeze)
end

Instance Attribute Details

#programString (readonly)

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



26
27
28
# File 'lib/jaina/parser.rb', line 26

def program
  @program
end

Class Method Details

.parse(program) ⇒ Jaina::Parser::AST

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:

Since:

  • 0.1.0



17
18
19
# File 'lib/jaina/parser.rb', line 17

def parse(program)
  new(program).parse
end

Instance Method Details

#parseJaina::Parser::AST

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:

Since:

  • 0.1.0



41
42
43
# File 'lib/jaina/parser.rb', line 41

def parse
  AST.build(program)
end