def Token(token, value = nil)
case token
when String
if (tk = TkReading2Token[token]).nil?
IRB.fail TkReading2TokenNoKey, token
end
tk = Token(tk[0], value)
if tk.kind_of?(TkOp)
tk.name = token
end
return tk
when Symbol
if (tk = TkSymbol2Token[token]).nil?
IRB.fail TkSymbol2TokenNoKey, token
end
return Token(tk[0], value)
else
if (token.ancestors & [TkId, TkVal, TkOPASGN, TkUnknownChar]).empty?
token.new(@prev_seek, @prev_line_no, @prev_char_no)
else
token.new(@prev_seek, @prev_line_no, @prev_char_no, value)
end
end
end