pub struct LocatedToken { /* private fields */ }
Expand description
Add span information for a Token.
Implementations§
Source§impl LocatedToken
impl LocatedToken
pub fn context(&self) -> &ParserContext
Source§impl LocatedToken
impl LocatedToken
Trait Implementations§
Source§impl Clone for LocatedToken
impl Clone for LocatedToken
Source§impl Debug for LocatedToken
impl Debug for LocatedToken
Source§impl Deref for LocatedToken
impl Deref for LocatedToken
Source§impl Display for LocatedToken
impl Display for LocatedToken
Source§impl ListingElement for LocatedToken
impl ListingElement for LocatedToken
type AssemblerControlCommand = LocatedAssemblerControlCommand
type DataAccess = LocatedDataAccess
type Expr = LocatedExpr
type MacroParam = LocatedMacroParam
type TestKind = LocatedTestKind
fn is_print(&self) -> bool
fn is_buildcpr(&self) -> bool
fn is_label(&self) -> bool
fn is_equ(&self) -> bool
fn is_assign(&self) -> bool
fn is_module(&self) -> bool
fn is_directive(&self) -> bool
fn is_rorg(&self) -> bool
fn is_iterate(&self) -> bool
fn is_for(&self) -> bool
fn is_repeat_until(&self) -> bool
fn is_repeat(&self) -> bool
fn is_macro_definition(&self) -> bool
fn is_if(&self) -> bool
fn is_include(&self) -> bool
fn is_incbin(&self) -> bool
fn is_call_macro_or_build_struct(&self) -> bool
fn is_function_definition(&self) -> bool
fn is_crunched_section(&self) -> bool
fn is_confined(&self) -> bool
fn is_switch(&self) -> bool
fn is_db(&self) -> bool
fn is_dw(&self) -> bool
fn is_str(&self) -> bool
fn is_set(&self) -> bool
fn is_comment(&self) -> bool
fn is_org(&self) -> bool
fn is_assembler_control(&self) -> bool
fn is_while(&self) -> bool
fn is_assert(&self) -> bool
fn is_run(&self) -> bool
fn is_breakpoint(&self) -> bool
fn is_save(&self) -> bool
fn assign_symbol(&self) -> &str
fn assign_value(&self) -> &Self::Expr
fn equ_symbol(&self) -> &str
fn equ_value(&self) -> &Self::Expr
fn module_name(&self) -> &str
fn while_expr(&self) -> &Self::Expr
fn mnemonic(&self) -> Option<&Mnemonic>
fn mnemonic_arg1(&self) -> Option<&Self::DataAccess>
fn mnemonic_arg2(&self) -> Option<&Self::DataAccess>
fn rorg_expr(&self) -> &Self::Expr
fn iterate_counter_name(&self) -> &str
fn iterate_values(&self) -> Either<&Vec<Self::Expr>, &Self::Expr> ⓘ
fn for_label(&self) -> &str
fn for_start(&self) -> &Self::Expr
fn for_stop(&self) -> &Self::Expr
fn for_step(&self) -> Option<&Self::Expr>
fn repeat_until_condition(&self) -> &Self::Expr
fn repeat_count(&self) -> &Self::Expr
fn repeat_counter_name(&self) -> Option<&str>
fn repeat_counter_start(&self) -> Option<&Self::Expr>
fn repeat_counter_step(&self) -> Option<&Self::Expr>
fn macro_definition_name(&self) -> &str
fn macro_definition_arguments(&self) -> SmallVec<[&str; 4]>
fn macro_definition_code(&self) -> &str
fn macro_call_name(&self) -> &str
fn macro_call_arguments(&self) -> &[Self::MacroParam]
fn if_nb_tests(&self) -> usize
fn incbin_fname(&self) -> &Self::Expr
fn incbin_offset(&self) -> Option<&Self::Expr>
fn incbin_length(&self) -> Option<&Self::Expr>
fn incbin_transformation(&self) -> &BinaryTransformation
fn include_fname(&self) -> &Self::Expr
fn include_namespace(&self) -> Option<&str>
fn include_once(&self) -> bool
fn function_definition_name(&self) -> &str
fn function_definition_params(&self) -> SmallVec<[&str; 4]>
fn crunched_section_kind(&self) -> &CrunchType
fn switch_expr(&self) -> &Self::Expr
fn data_exprs(&self) -> &[Self::Expr]
fn assembler_control_command(&self) -> &Self::AssemblerControlCommand
fn assembler_control_get_max_passes(&self) -> Option<&Self::Expr>
fn macro_flavor(&self) -> AssemblerFlavor
fn run_expr(&self) -> &Self::Expr
fn org_first(&self) -> &Self::Expr
fn org_second(&self) -> Option<&Self::Expr>
fn to_token(&self) -> Cow<'_, Token>
fn is_warning(&self) -> bool
fn warning_message(&self) -> &str
fn while_listing(&self) -> &[Self]
fn module_listing(&self) -> &[Self]
fn mnemonic_arg1_mut(&mut self) -> Option<&mut Self::DataAccess>
fn mnemonic_arg2_mut(&mut self) -> Option<&mut Self::DataAccess>
fn rorg_listing(&self) -> &[Self]
fn iterate_listing(&self) -> &[Self]
fn for_listing(&self) -> &[Self]
fn repeat_until_listing(&self) -> &[Self]
fn repeat_listing(&self) -> &[Self]
fn function_definition_inner(&self) -> &[Self]
fn crunched_section_listing(&self) -> &[Self]
fn if_test(&self, idx: usize) -> (&Self::TestKind, &[Self])
fn if_else(&self) -> Option<&[Self]>
fn confined_listing(&self) -> &[Self]
fn switch_cases( &self, ) -> Box<dyn Iterator<Item = (&Self::Expr, &[Self], bool)> + '_>
fn switch_default(&self) -> Option<&[Self]>
fn warning_token(&self) -> &Self
fn assembler_control_get_listing(&self) -> &[Self]
fn defer_listing_output(&self) -> bool
fn is_opcode(&self) -> bool
fn include_is_standard_include(&self) -> bool
fn starts_with_label(&self) -> bool
Source§impl MayHaveSpan for LocatedToken
impl MayHaveSpan for LocatedToken
Source§impl ParsingStateVerified for LocatedToken
impl ParsingStateVerified for LocatedToken
fn is_accepted(&self, state: &ParsingState) -> bool
Source§impl PartialEq for LocatedToken
impl PartialEq for LocatedToken
Source§impl ReturnExpr for LocatedToken
impl ReturnExpr for LocatedToken
type Expr = LocatedExpr
fn return_expr(&self) -> Option<&Self::Expr>
Source§impl ToSimpleToken for LocatedToken
impl ToSimpleToken for LocatedToken
Source§fn as_simple_token(&self) -> Cow<'_, Token>
fn as_simple_token(&self) -> Cow<'_, Token>
Convert the token in its simplest form
Source§impl TokenExt for LocatedToken
impl TokenExt for LocatedToken
fn estimated_duration(&self) -> Result<usize, AssemblerError>
Source§fn unroll(&self, _env: &Env) -> Option<Result<Vec<&Self>, AssemblerError>>
fn unroll(&self, _env: &Env) -> Option<Result<Vec<&Self>, AssemblerError>>
Unroll the tokens when it represents a loop
Source§fn disassemble_data(&self) -> Result<Listing, String>
fn disassemble_data(&self) -> Result<Listing, String>
Generate the listing of opcodes for directives that embed bytes
Source§fn fallback_number_of_bytes(&self) -> Result<usize, String>
fn fallback_number_of_bytes(&self) -> Result<usize, String>
returns the number of bytes without assembling it
fn to_bytes_with_options( &self, option: EnvOptions, ) -> Result<Vec<u8>, AssemblerError>
Source§fn number_of_bytes(&self) -> Result<usize, String>
fn number_of_bytes(&self) -> Result<usize, String>
Returns the number of bytes of the instructions by assembling it
Source§fn number_of_bytes_with_context(
&self,
table: &mut SymbolsTableCaseDependent,
) -> Result<usize, String>
fn number_of_bytes_with_context( &self, table: &mut SymbolsTableCaseDependent, ) -> Result<usize, String>
Return the number of bytes of the token given the provided context
Source§fn to_bytes(&self) -> Result<Vec<u8>, AssemblerError>
fn to_bytes(&self) -> Result<Vec<u8>, AssemblerError>
Dummy version that assemble without taking into account the context
TODO find a way to not build a symbol table each time
Source§fn to_bytes_with_context(
&self,
table: &mut SymbolsTableCaseDependent,
) -> Result<Vec<u8>, AssemblerError>
fn to_bytes_with_context( &self, table: &mut SymbolsTableCaseDependent, ) -> Result<Vec<u8>, AssemblerError>
Assemble the symbol taking into account some context, but never modify this context
Source§impl Visited for LocatedToken
impl Visited for LocatedToken
impl Eq for LocatedToken
impl StructuralPartialEq for LocatedToken
Auto Trait Implementations§
impl !Freeze for LocatedToken
impl RefUnwindSafe for LocatedToken
impl Send for LocatedToken
impl Sync for LocatedToken
impl Unpin for LocatedToken
impl UnwindSafe for LocatedToken
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
Causes
self
to use its Binary
implementation when Debug
-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
Causes
self
to use its Display
implementation when
Debug
-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
Causes
self
to use its LowerExp
implementation when
Debug
-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
Causes
self
to use its LowerHex
implementation when
Debug
-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
Causes
self
to use its Octal
implementation when Debug
-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
Causes
self
to use its Pointer
implementation when
Debug
-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
Causes
self
to use its UpperExp
implementation when
Debug
-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
Causes
self
to use its UpperHex
implementation when
Debug
-formatted.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Pipes by value. This is generally the method you want to use. Read more
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
Borrows
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
Mutably borrows
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
Borrows
self
, then passes self.as_ref()
into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
Mutably borrows
self
, then passes self.as_mut()
into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
Borrows
self
, then passes self.deref()
into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Immutable access to the
Borrow<B>
of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
Mutable access to the
BorrowMut<B>
of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
Immutable access to the
AsRef<R>
view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
Mutable access to the
AsMut<R>
view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Immutable access to the
Deref::Target
of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Mutable access to the
Deref::Target
of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
Calls
.tap()
only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls
.tap_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
Calls
.tap_borrow()
only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
Calls
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
Calls
.tap_ref()
only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
Calls
.tap_ref_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
Calls
.tap_deref()
only in debug builds, and is erased in release
builds.Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString
. Read more