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.
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
#la ⇒ Object (readonly)
Returns the value of attribute la.
49 50 51 |
# File 'lib/racc/debugflags.rb', line 49 def la @la end |
#parse ⇒ Object (readonly)
Returns the value of attribute parse.
45 46 47 |
# File 'lib/racc/debugflags.rb', line 45 def parse @parse end |
#prec ⇒ Object (readonly)
Returns the value of attribute prec.
50 51 52 |
# File 'lib/racc/debugflags.rb', line 50 def prec @prec end |
#rule ⇒ Object (readonly)
Returns the value of attribute rule.
46 47 48 |
# File 'lib/racc/debugflags.rb', line 46 def rule @rule end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
48 49 50 |
# File 'lib/racc/debugflags.rb', line 48 def state @state end |
#status_logging ⇒ Object (readonly)
Returns the value of attribute status_logging.
56 57 58 |
# File 'lib/racc/debugflags.rb', line 56 def status_logging @status_logging end |
#token ⇒ Object (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
52 53 54 |
# File 'lib/racc/debugflags.rb', line 52 def any? @any end |