Class: Racc::ParserFileGenerator

### Home Classes Methods

### In Files

- lib/racc/parserfilegenerator.rb

### Parent

Object

### Namespace

- CLASS Racc::ParserFileGenerator::Params

### Methods

- ::new
- #generate_parser
- #generate_parser_file
- #put_state_transition_table

### Files

- Manifest.txt
- README.rdoc
- pre-setup
- NEWS.en.rdoc
- grammar.en.rdoc

### Class/Module Index

Quicksearch

- Racc
- Racc::Accept
- Racc::ActionTable
- Racc::CompileError
- Racc::DebugFlags
- Racc::Error
- Racc::Goto
- Racc::Grammar
- Racc::Grammar::DefinitionEnv
- Racc::Grammar::PrecedenceDefinitionEnv
- Racc::GrammarFileParser
- Racc::GrammarFileParser::Result
- Racc::GrammarFileScanner
- Racc::ISet
- Racc::Item
- Racc::LocationPointer
- Racc::LogFileGenerator
- Racc::OrMark
- Racc::ParseError
- Racc::ParseError
- Racc::Parser
- Racc::ParserClassGenerator
- Racc::ParserFileGenerator
- Racc::ParserFileGenerator::Params
- Racc::Prec
- Racc::RRconflict
- Racc::Reduce
- Racc::Rule
- Racc::SRconflict
- Racc::Shift
- Racc::SourceText
- Racc::State
- Racc::StateTransitionTable
- Racc::StateTransitionTableGenerator
- Racc::States
- Racc::Sym
- Racc::SymbolTable
- Racc::UserAction
- Object
- Object::ParseError
- Array

No matching classes.

# Racc::ParserFileGenerator

### Constants

RE_CACHE
RUBY_PATH

### Public Class Methods

new(states, params) click to toggle source

    # File lib/racc/parserfilegenerator.rb, line 72
    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 78
    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 89
    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 254
    def put_state_transition_table(f)
      @f = f
      state_transition_table
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.