Class: FFI::Clang::Token
- Inherits:
-
Object
- Object
- FFI::Clang::Token
- Defined in:
- lib/ffi/clang/token.rb
Instance Method Summary collapse
- #extent ⇒ Object
-
#initialize(token, translation_unit) ⇒ Token
constructor
A new instance of Token.
- #kind ⇒ Object
- #location ⇒ Object
- #spelling ⇒ Object
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
#extent ⇒ Object
76 77 78 |
# File 'lib/ffi/clang/token.rb', line 76 def extent SourceRange.new Lib.get_token_extent(@translation_unit, @token) end |
#kind ⇒ Object
64 65 66 |
# File 'lib/ffi/clang/token.rb', line 64 def kind Lib.get_token_kind(@token) end |
#location ⇒ Object
72 73 74 |
# File 'lib/ffi/clang/token.rb', line 72 def location ExpansionLocation.new Lib.get_token_location(@translation_unit, @token) end |
#spelling ⇒ Object
68 69 70 |
# File 'lib/ffi/clang/token.rb', line 68 def spelling Lib.extract_string Lib.get_token_spelliing(@translation_unit, @token) end |