Class: CodeTools::Compiler::StringParser

Inherits:
Parser
  • Object
show all
Defined in:
lib/rubinius/code/compiler/stages.rb

Overview

source string -> AST

Direct Known Subclasses

EvalParser

Instance Attribute Summary

Attributes inherited from Parser

#transforms

Attributes inherited from Stage

#next_stage, #printer

Instance Method Summary collapse

Methods inherited from Parser

#add_magic_comment, #create, #default_transforms, #enable_category, #enable_transform, #initialize, #print, #root, #run

Methods inherited from Stage

#create_next_stage, #initialize, #insert, next_stage, next_stage_class, #processor, #run_next, stage, stage_name

Constructor Details

This class inherits a constructor from CodeTools::Compiler::Parser

Instance Method Details

#input(string, name = "(eval)", line = 1) ⇒ Object



234
235
236
237
238
# File 'lib/rubinius/code/compiler/stages.rb', line 234

def input(string, name="(eval)", line=1)
  @input = string
  @file = name
  @line = line
end

#parseObject



240
241
242
# File 'lib/rubinius/code/compiler/stages.rb', line 240

def parse
  create.parse_string(@input)
end