Class: FFI::Clang::Token

Inherits:
Object
  • Object
show all
Defined in:
lib/ffi/clang/token.rb

Instance Method Summary collapse

Constructor Details

#initialize(token, translation_unit) ⇒ Token

Returns a new instance of Token.



59
60
61
62
# File 'lib/ffi/clang/token.rb', line 59

def initialize(token, translation_unit)
	@token = token
	@translation_unit = translation_unit
end

Instance Method Details

#extentObject



76
77
78
# File 'lib/ffi/clang/token.rb', line 76

def extent
	SourceRange.new Lib.get_token_extent(@translation_unit, @token)
end

#kindObject



64
65
66
# File 'lib/ffi/clang/token.rb', line 64

def kind
	Lib.get_token_kind(@token)
end

#locationObject



72
73
74
# File 'lib/ffi/clang/token.rb', line 72

def location
	ExpansionLocation.new Lib.get_token_location(@translation_unit, @token)
end

#spellingObject



68
69
70
# File 'lib/ffi/clang/token.rb', line 68

def spelling
	Lib.extract_string Lib.get_token_spelliing(@translation_unit, @token)
end