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.
137 138 139 140 |
# File 'lib/mof/helper.rb', line 137 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.
136 137 138 |
# File 'lib/mof/helper.rb', line 136 def line @line end |
#stack ⇒ Object (readonly)
Returns the value of attribute stack.
136 137 138 |
# File 'lib/mof/helper.rb', line 136 def stack @stack end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
136 137 138 |
# File 'lib/mof/helper.rb', line 136 def token @token end |
#token_value ⇒ Object (readonly)
Returns the value of attribute token_value.
136 137 138 |
# File 'lib/mof/helper.rb', line 136 def token_value @token_value end |
Instance Method Details
#to_s ⇒ Object
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
# File 'lib/mof/helper.rb', line 141 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 |