[−][src]Enum cpclib_asm::preamble::Token
Variants
Bank(Expr)
Bankset(Expr)
Basic code which tokens will be included in the code (imported variables, lines to hide, code)
BuildSna(SnapshotVersion)
Comment(String)
CrunchedBinary(CrunchType, String)
CrunchedSection(CrunchType, BaseListing<Token>)
If(Vec<(TestKind, BaseListing<Token>)>, Option<BaseListing<Token>>)
Conditional expression. _0 contains all the expression and the appropriate code, _1 contains the else case
Incbin(String, Option<Expr>, Option<Expr>, Option<Expr>, Option<Expr>, Option<Vec<u8>>, BinaryTransformation)
Include of an asm file _0 contains the name of the file, _1 contains the content of the file. It is not loaded at the creation of the Token because there is not enough context to know where to load file
Include(String, Option<BaseListing<Token>>)
Label(String)
Limit(Expr)
OpCode(Mnemonic, Option<DataAccess>, Option<DataAccess>)
Print(Vec<FormattedExpr>)
Repeat(Expr, BaseListing<Token>, Option<String>)
Duplicate the token stream
RepeatUntil(Expr, BaseListing<Token>)
Rorg(Expr, BaseListing<Token>)
Set the value of $ to Expr
Fields of Save
SetCPC(Expr)
SetCrtc(Expr)
StableTicker(StableTickerAction)
Undef(String)
While(Expr, BaseListing<Token>)
Methods
impl Token
[src]
pub fn is_opcode(&self) -> bool
[src]
pub fn label(&self) -> Option<&String>
[src]
pub fn mnemonic(&self) -> Option<&Mnemonic>
[src]
pub fn mnemonic_arg1(&self) -> Option<&DataAccess>
[src]
pub fn mnemonic_arg2(&self) -> Option<&DataAccess>
[src]
pub fn org_expr(&self) -> Option<&Expr>
[src]
please use expr
instead as other token need it
pub fn expr(&self) -> Option<&Expr>
[src]
Trait Implementations
impl Clone for Token
[src]
impl Debug for Token
[src]
impl Display for Token
[src]
impl Eq for Token
[src]
impl From<u8> for Token
[src]
impl ListingElement for Token
[src]
impl PartialEq<Token> for Token
[src]
impl StructuralEq for Token
[src]
impl StructuralPartialEq for Token
[src]
impl TokenExt for Token
[src]
fn unroll(
&self,
sym: &SymbolsTableCaseDependent
) -> Option<Result<Vec<&Self>, AssemblerError>>
[src]
&self,
sym: &SymbolsTableCaseDependent
) -> Option<Result<Vec<&Self>, AssemblerError>>
Unroll the tokens when in a repetition loop TODO return an iterator in order to not produce the vector each time
fn disassemble_data(&self) -> Result<Listing, String>
[src]
Generate the listing of opcodes for directives that contain data Defb/defw/Defs in order to have mnemonics. Fails when some values are not opcodes
fn read_referenced_file(
&mut self,
ctx: &ParserContext
) -> Result<(), AssemblerError>
[src]
&mut self,
ctx: &ParserContext
) -> Result<(), AssemblerError>
Modify the few tokens that need to read files TODO refactor file reading of filename search
fn to_bytes(&self) -> Result<Bytes, AssemblerError>
[src]
Dummy version that assemble without taking into account the context TODO find a way to not build a symbol table each time
fn to_bytes_with_context(
&self,
table: &mut SymbolsTableCaseDependent
) -> Result<Bytes, AssemblerError>
[src]
&self,
table: &mut SymbolsTableCaseDependent
) -> Result<Bytes, AssemblerError>
Assemble the symbol taking into account some context, but never modify this context
fn estimated_duration(&self) -> Result<usize, String>
[src]
Returns an estimation of the duration. This estimation may be wrong for instruction having several states.
fn number_of_bytes(&self) -> Result<usize, String>
[src]
Return the number of bytes of the token
fn number_of_bytes_with_context(
&self,
table: &mut SymbolsTableCaseDependent
) -> Result<usize, String>
[src]
&self,
table: &mut SymbolsTableCaseDependent
) -> Result<usize, String>
Return the number of bytes of the token given the provided context
fn is_valid(&self) -> bool
[src]
impl<'_> TokenTryFrom<&'_ str> for Token
[src]
impl TokenTryFrom<String> for Token
[src]
Auto Trait Implementations
impl RefUnwindSafe for Token
impl Send for Token
impl Sync for Token
impl Unpin for Token
impl UnwindSafe for Token
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,