Class: Racc::LocationPointer

### Home Classes Methods

### In Files

- lib/racc/grammar.rb

### Parent

Object

### Methods

- ::new
- #==
- #before
- #eql?
- #head?
- #increment
- #inspect
- #next
- #to_s

### 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::LocationPointer

A set of rule and position in it's RHS. Note that the number of pointers is more than rule's RHS array, because pointer points right edge of the final symbol when reducing.

### Attributes

dereference[R]
hash[R]
ident[R]
index[R]
reduce[R]
reduce?[R]
rule[R]
symbol[R]

### Public Class Methods

new(rule, i, sym) click to toggle source

    # File lib/racc/grammar.rb, line 811
    def initialize(rule, i, sym)
      @rule   = rule
      @index  = i
      @symbol = sym
      @ident  = @rule.hash + i
      @reduce = sym.nil?
    end

### Public Instance Methods

==(ot) click to toggle source
Alias for: eql?
before(len) click to toggle source

    # File lib/racc/grammar.rb, line 853
    def before(len)
      @rule.ptrs[@index - len] or ptr_bug!
    end

eql?(ot) click to toggle source

    # File lib/racc/grammar.rb, line 837
    def eql?(ot)
      @hash == ot.hash
    end

Also aliased as: ==
head?() click to toggle source

    # File lib/racc/grammar.rb, line 843
    def head?
      @index == 0
    end

increment() click to toggle source
Alias for: next
inspect() click to toggle source
Alias for: to_s
next() click to toggle source

    # File lib/racc/grammar.rb, line 847
    def next
      @rule.ptrs[@index + 1] or ptr_bug!
    end

Also aliased as: increment
to_s() click to toggle source

    # File lib/racc/grammar.rb, line 830
    def to_s
      sprintf('(%d,%d %s)',
              @rule.ident, @index, (reduce?() ? '#' : @symbol.to_s))
    end

Also aliased as: inspect

[Validate]

Generated with the Darkfish Rdoc Generator 2.