Class: Racc::DebugFlags

Inherits:
Object show all
Defined in:
lib/racc/debugflags.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parse = false, rule = false, token = false, state = false, la = false, prec = false, conf = false) ⇒ DebugFlags

Returns a new instance of DebugFlags.


33
34
35
36
37
38
39
40
41
42
43
# File 'lib/racc/debugflags.rb', line 33

def initialize(parse = false, rule = false, token = false, state = false,
               la = false, prec = false, conf = false)
  @parse = parse
  @rule = rule
  @token = token
  @state = state
  @la = la
  @prec = prec
  @any = (parse || rule || token || state || la || prec)
  @status_logging = conf
end

Instance Attribute Details

#laObject (readonly)

Returns the value of attribute la


49
50
51
# File 'lib/racc/debugflags.rb', line 49

def la
  @la
end

#parseObject (readonly)

Returns the value of attribute parse


45
46
47
# File 'lib/racc/debugflags.rb', line 45

def parse
  @parse
end

#precObject (readonly)

Returns the value of attribute prec


50
51
52
# File 'lib/racc/debugflags.rb', line 50

def prec
  @prec
end

#ruleObject (readonly)

Returns the value of attribute rule


46
47
48
# File 'lib/racc/debugflags.rb', line 46

def rule
  @rule
end

#stateObject (readonly)

Returns the value of attribute state


48
49
50
# File 'lib/racc/debugflags.rb', line 48

def state
  @state
end

#status_loggingObject (readonly)

Returns the value of attribute status_logging


56
57
58
# File 'lib/racc/debugflags.rb', line 56

def status_logging
  @status_logging
end

#tokenObject (readonly)

Returns the value of attribute token


47
48
49
# File 'lib/racc/debugflags.rb', line 47

def token
  @token
end

Class Method Details

.parse_option_string(s) ⇒ Object


15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/racc/debugflags.rb', line 15

def DebugFlags.parse_option_string(s)
  parse = rule = token = state = la = prec = conf = false
  s.split(//).each do |ch|
    case ch
    when 'p' then parse = true
    when 'r' then rule = true
    when 't' then token = true
    when 's' then state = true
    when 'l' then la = true
    when 'c' then prec = true
    when 'o' then conf = true
    else
      raise "unknown debug flag char: #{ch.inspect}"
    end
  end
  new(parse, rule, token, state, la, prec, conf)
end

Instance Method Details

#any?Boolean

Returns:

  • (Boolean)

52
53
54
# File 'lib/racc/debugflags.rb', line 52

def any?
  @any
end