Class: Racc::Grammar::PrecedenceDefinitionEnv

### Home Classes Methods

### In Files

- lib/racc/grammar.rb

### Parent

Object

### Methods

- ::new
- #higher
- #left
- #lower
- #nonassoc
- #right

### 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::Grammar::PrecedenceDefinitionEnv

### Attributes

reverse[R]

### Public Class Methods

new(g) click to toggle source

    # File lib/racc/grammar.rb, line 363
    def initialize(g)
      @grammar = g
      @prechigh_seen = false
      @preclow_seen = false
      @reverse = false
    end

### Public Instance Methods

higher() click to toggle source

    # File lib/racc/grammar.rb, line 372
    def higher
      if @prechigh_seen
        raise CompileError, "prechigh used twice"
      end
      @prechigh_seen = true
    end

left(*syms) click to toggle source

    # File lib/racc/grammar.rb, line 389
    def left(*syms)
      @grammar.declare_precedence :Left, syms.map {|s| @grammar.intern(s) }
    end

lower() click to toggle source

    # File lib/racc/grammar.rb, line 379
    def lower
      if @preclow_seen
        raise CompileError, "preclow used twice"
      end
      if @prechigh_seen
        @reverse = true
      end
      @preclow_seen = true
    end

nonassoc(*syms) click to toggle source

    # File lib/racc/grammar.rb, line 397
    def nonassoc(*syms)
      @grammar.declare_precedence :Nonassoc, syms.map {|s| @grammar.intern(s)}
    end

right(*syms) click to toggle source

    # File lib/racc/grammar.rb, line 393
    def right(*syms)
      @grammar.declare_precedence :Right, syms.map {|s| @grammar.intern(s) }
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.