Struct AstBasicType
pub struct AstBasicType(pub Vec<AstBasicTypeSpecifier>);Expand description
The basic type of a declaration.
The term ‘basic type’ is not used in the C Standard, but it is used informally when discussing C parsers. The basic type is the first type we see in a declaration before any of the declarators.
unsigned long int *age = 0, calculate(float salary);
~~~~~~~~~~~~~~~~~
typedef int MyInt;
MyInt a = 0, b = 1, c = 2;
~~~~~The subsequent declarators (e.g. *age, calculate(float salary), a, b, c) augment the basic type to create
a derived type. The derived type always modifies the basic type. For example, *age augments the basic type
unsigned long int and creates a derived type of unsigned long int *.
Tuple Fields§
§0: Vec<AstBasicTypeSpecifier>Implementations§
§impl AstBasicType
impl AstBasicType
pub fn location(&self) -> SourceLocation
pub fn location(&self) -> SourceLocation
The source location of all specifiers in the basic type.
Trait Implementations§
§impl Clone for AstBasicType
impl Clone for AstBasicType
§fn clone(&self) -> AstBasicType
fn clone(&self) -> AstBasicType
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for AstBasicType
impl Debug for AstBasicType
§impl Default for AstBasicType
impl Default for AstBasicType
§fn default() -> AstBasicType
fn default() -> AstBasicType
Returns the “default value” for a type. Read more
§impl Display for AstBasicType
impl Display for AstBasicType
§impl PartialEq for AstBasicType
impl PartialEq for AstBasicType
impl Eq for AstBasicType
impl StructuralPartialEq for AstBasicType
Auto Trait Implementations§
impl Freeze for AstBasicType
impl RefUnwindSafe for AstBasicType
impl Send for AstBasicType
impl Sync for AstBasicType
impl Unpin for AstBasicType
impl UnwindSafe for AstBasicType
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