Exception: MOF::Helper::ParserError
- Defined in:
- lib/mof/helper.rb
Instance Attribute Summary collapse
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#stack ⇒ Object
readonly
Returns the value of attribute stack.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
-
#token_value ⇒ Object
readonly
Returns the value of attribute token_value.
Attributes inherited from Error
Instance Method Summary collapse
-
#initialize(name, lineno, line, token, token_value, stack) ⇒ ParserError
constructor
A new instance of ParserError.
- #to_s ⇒ Object
Constructor Details
#initialize(name, lineno, line, token, token_value, stack) ⇒ ParserError
Returns a new instance of ParserError.
116 117 118 119 |
# File 'lib/mof/helper.rb', line 116 def initialize name, lineno, line, token, token_value, stack @token,@token_value,@stack = token, token_value, stack super name,lineno,line,"" end |
Instance Attribute Details
#line ⇒ Object (readonly)
Returns the value of attribute line.
115 116 117 |
# File 'lib/mof/helper.rb', line 115 def line @line end |
#stack ⇒ Object (readonly)
Returns the value of attribute stack.
115 116 117 |
# File 'lib/mof/helper.rb', line 115 def stack @stack end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
115 116 117 |
# File 'lib/mof/helper.rb', line 115 def token @token end |
#token_value ⇒ Object (readonly)
Returns the value of attribute token_value.
115 116 117 |
# File 'lib/mof/helper.rb', line 115 def token_value @token_value end |
Instance Method Details
#to_s ⇒ Object
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
# File 'lib/mof/helper.rb', line 120 def to_s ret = "#{super}\tnear token #{@token_value.inspect}\n" ret << "\tStack [#{@stack.size}]:\n" idx = stack.size-1 (1..12).each do |i| s = stack[idx] c = s.class case s when String, NilClass s = s.inspect else s = s.to_s end if s.size > 80 ret << "[#{i}:#{c}]\t#{s[0,80]}..." else ret << "[#{i}:#{c}]\t#{s}" end ret << "\n" idx -= 1 break if idx < 0 end ret end |