higher()
click to toggle source
def higher
if @prechigh_seen
raise CompileError, "prechigh used twice"
end
@prechigh_seen = true
end
left(*syms)
click to toggle source
def left(*syms)
@grammar.declare_precedence :Left, syms.map {|s| @grammar.intern(s) }
end
lower()
click to toggle source
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
def nonassoc(*syms)
@grammar.declare_precedence :Nonassoc, syms.map {|s| @grammar.intern(s)}
end
right(*syms)
click to toggle source
def right(*syms)
@grammar.declare_precedence :Right, syms.map {|s| @grammar.intern(s) }
end