class Racc::ParserFileGenerator
Constants
- RE_CACHE
- RUBY_PATH
Public Class Methods
new(states, params)
click to toggle source
# File lib/racc/parserfilegenerator.rb, line 74 def initialize(states, params) @states = states @grammar = states.grammar @params = params end
Public Instance Methods
generate_parser()
click to toggle source
# File lib/racc/parserfilegenerator.rb, line 80 def generate_parser string_io = StringIO.new init_line_conversion_system @f = string_io parser_file string_io.rewind string_io.read end
generate_parser_file(destpath)
click to toggle source
# File lib/racc/parserfilegenerator.rb, line 91 def generate_parser_file(destpath) init_line_conversion_system File.open(destpath, 'w') {|f| @f = f parser_file } File.chmod 0755, destpath if @params.make_executable? end
put_state_transition_table(f)
click to toggle source
State
Transition Table Serialization
# File lib/racc/parserfilegenerator.rb, line 257 def put_state_transition_table(f) @f = f state_transition_table end