pub struct Tokens {
pub tokens: Vec<Token>,
pub ints: Vec<IntConstant>,
pub floats: Vec<FloatConstant>,
pub chars: Vec<CharConstant>,
pub strings: Vec<StringLiteral>,
}Expand description
The tokens of a translation unit, with the values they refer to.
Fields§
§tokens: Vec<Token>The tokens themselves, ending in one TokenKind::Eof.
ints: Vec<IntConstant>The integer constants, in the order they were converted.
floats: Vec<FloatConstant>The floating constants, in the order they were converted.
chars: Vec<CharConstant>The character constants, in the order they were converted.
strings: Vec<StringLiteral>The string literals, one per run of adjacent ones.
Implementations§
Source§impl Tokens
impl Tokens
Sourcepub fn int(&self, token: Token) -> Option<&IntConstant>
pub fn int(&self, token: Token) -> Option<&IntConstant>
The integer constant token refers to, and None when it is not an integer constant.
Sourcepub fn float(&self, token: Token) -> Option<&FloatConstant>
pub fn float(&self, token: Token) -> Option<&FloatConstant>
The floating constant token refers to, and None when it is not one.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Tokens
impl RefUnwindSafe for Tokens
impl Send for Tokens
impl Sync for Tokens
impl Unpin for Tokens
impl UnsafeUnpin for Tokens
impl UnwindSafe for Tokens
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more