Class: Racc::DebugFlags
Instance Attribute Summary collapse
-
#la ⇒ Object
readonly
Returns the value of attribute la.
-
#parse ⇒ Object
readonly
Returns the value of attribute parse.
-
#prec ⇒ Object
readonly
Returns the value of attribute prec.
-
#rule ⇒ Object
readonly
Returns the value of attribute rule.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#status_logging ⇒ Object
readonly
Returns the value of attribute status_logging.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Class Method Summary collapse
Instance Method Summary collapse
- #any? ⇒ Boolean
-
#initialize(parse = false, rule = false, token = false, state = false, la = false, prec = false, conf = false) ⇒ DebugFlags
constructor
A new instance of DebugFlags.
Constructor Details
#initialize(parse = false, rule = false, token = false, state = false, la = false, prec = false, conf = false) ⇒ DebugFlags
Returns a new instance of DebugFlags.
34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/racc/debugflags.rb', line 34 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
#la ⇒ Object (readonly)
Returns the value of attribute la.
50 51 52 |
# File 'lib/racc/debugflags.rb', line 50 def la @la end |
#parse ⇒ Object (readonly)
Returns the value of attribute parse.
46 47 48 |
# File 'lib/racc/debugflags.rb', line 46 def parse @parse end |
#prec ⇒ Object (readonly)
Returns the value of attribute prec.
51 52 53 |
# File 'lib/racc/debugflags.rb', line 51 def prec @prec end |
#rule ⇒ Object (readonly)
Returns the value of attribute rule.
47 48 49 |
# File 'lib/racc/debugflags.rb', line 47 def rule @rule end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
49 50 51 |
# File 'lib/racc/debugflags.rb', line 49 def state @state end |
#status_logging ⇒ Object (readonly)
Returns the value of attribute status_logging.
57 58 59 |
# File 'lib/racc/debugflags.rb', line 57 def status_logging @status_logging end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
48 49 50 |
# File 'lib/racc/debugflags.rb', line 48 def token @token end |
Class Method Details
.parse_option_string(s) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/racc/debugflags.rb', line 16 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
53 54 55 |
# File 'lib/racc/debugflags.rb', line 53 def any? @any end |