pub enum Token {
Show 63 variants Align(ExprOption<Expr>), Assert(ExprOption<Vec<FormattedExpr, Global>>), Assign(SmolStr, ExprOption<BinaryOperation>), Bank(Option<Expr>), Bankset(Expr), Basic(Option<Vec<SmolStr, Global>>, Option<Vec<u16, Global>>, String), Break, Breakpoint(Option<Expr>), BuildCpr, BuildSna(Option<SnapshotVersion>), Charset(CharsetFormat), Comment(String), CrunchedBinary(CrunchType, SmolStr), CrunchedSection(CrunchTypeBaseListing<Token>), Defb(Vec<Expr, Global>), Defs(Vec<(Expr, Option<Expr>), Global>), Defw(Vec<Expr, Global>), End, Equ(SmolStr, Expr), Export(Vec<SmolStr, Global>), Fail(Option<Vec<FormattedExpr, Global>>), For { label: SmolStr, start: Expr, stop: Expr, step: Option<Expr>, listing: BaseListing<Token>, }, Function(SmolStr, Vec<SmolStr, Global>, BaseListing<Token>), If(Vec<(TestKind, BaseListing<Token>), Global>, Option<BaseListing<Token>>), Incbin { fname: String, offset: Option<Expr>, length: Option<Expr>, extended_offset: Option<Expr>, off: bool, transformation: BinaryTransformation, }, Include(StringOption<SmolStr>, bool), Iterate(SmolStr, Vec<Expr, Global>, BaseListing<Token>), Label(SmolStr), Let(SmolStr, Expr), Limit(Expr), List, Macro(SmolStr, Vec<SmolStr, Global>, String), MacroCall(SmolStr, Vec<MacroParam, Global>), MultiPop(Vec<DataAccess, Global>), MultiPush(Vec<DataAccess, Global>), Next(SmolStr, SmolStr, Option<Expr>), NoExport(Vec<SmolStr, Global>), NoList, OpCode(MnemonicOption<DataAccess>, Option<DataAccess>, Option<Register8>), Org(ExprOption<Expr>), Pause, Print(Vec<FormattedExpr, Global>), Protect(ExprExpr), Range(StringExprExpr), Repeat(ExprBaseListing<Token>, Option<SmolStr>, Option<Expr>), RepeatUntil(ExprBaseListing<Token>), Return(Expr), Rorg(ExprBaseListing<Token>), Run(ExprOption<Expr>), Save { filename: String, address: Option<Expr>, size: Option<Expr>, save_type: Option<SaveType>, dsk_filename: Option<String>, side: Option<Expr>, }, Section(SmolStr), SetCPC(Expr), SetCrtc(Expr), SetN(SmolStr, SmolStr, Option<Expr>), SnaInit(String), SnaSet(SnapshotFlagFlagValue), StableTicker(StableTickerAction), Str(Vec<Expr, Global>), Struct(SmolStr, Vec<(SmolStr, Token), Global>), Switch(ExprVec<(Expr, BaseListing<Token>, bool), Global>, Option<BaseListing<Token>>), Undef(SmolStr), WaitNops(Expr), While(ExprBaseListing<Token>),
}
Expand description

The embeded Listing can be of several kind (with the token or with decorated version of the token)

Variants

Align(ExprOption<Expr>)

Assert(ExprOption<Vec<FormattedExpr, Global>>)

Assign(SmolStr, ExprOption<BinaryOperation>)

Bank(Option<Expr>)

Configure the bank - completely incompatible with rasm behavior The expression corresponds to the GATE ARRAY value to select the bank of interest

Bankset(Expr)

Basic(Option<Vec<SmolStr, Global>>, Option<Vec<u16, Global>>, String)

Basic code which tokens will be included in the code (imported variables, lines to hide, code)

Break

Breakpoint(Option<Expr>)

BuildCpr

BuildSna(Option<SnapshotVersion>)

Charset(CharsetFormat)

Comment(String)

CrunchedBinary(CrunchType, SmolStr)

CrunchedSection(CrunchTypeBaseListing<Token>)

Defb(Vec<Expr, Global>)

Defs(Vec<(Expr, Option<Expr>), Global>)

Defw(Vec<Expr, Global>)

End

Equ(SmolStr, Expr)

Export(Vec<SmolStr, Global>)

Fail(Option<Vec<FormattedExpr, Global>>)

For

Fields

label: SmolStr
start: Expr
stop: Expr
step: Option<Expr>
listing: BaseListing<Token>

Function(SmolStr, Vec<SmolStr, Global>, BaseListing<Token>)

Function embeds a listing with a limited number of possible instructions and return a value

If(Vec<(TestKind, BaseListing<Token>), Global>, Option<BaseListing<Token>>)

Conditional expression. _0 contains all the expression and the appropriate code, _1 contains the else case

Incbin

Fields

fname: String
offset: Option<Expr>
length: Option<Expr>
extended_offset: Option<Expr>
off: bool
transformation: 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(StringOption<SmolStr>, bool)

Iterate(SmolStr, Vec<Expr, Global>, BaseListing<Token>)

Label(SmolStr)

Let(SmolStr, Expr)

Limit(Expr)

List

Macro(SmolStr, Vec<SmolStr, Global>, String)

MacroCall(SmolStr, Vec<MacroParam, Global>)

MultiPop(Vec<DataAccess, Global>)

MultiPush(Vec<DataAccess, Global>)

Next(SmolStr, SmolStr, Option<Expr>)

NoExport(Vec<SmolStr, Global>)

NoList

OpCode(MnemonicOption<DataAccess>, Option<DataAccess>, Option<Register8>)

Very last argument concerns only few undocumented instructions that save their results in a register

Org(ExprOption<Expr>)

Pause

Print(Vec<FormattedExpr, Global>)

Protect(ExprExpr)

Range(StringExprExpr)

Define a named section in the current page

Repeat(ExprBaseListing<Token>, Option<SmolStr>, Option<Expr>)

Duplicate the token stream

RepeatUntil(ExprBaseListing<Token>)

Return(Expr)

Return value from a function

Rorg(ExprBaseListing<Token>)

Set the value of $ to Expr

Run(ExprOption<Expr>)

Save

Fields

filename: String
address: Option<Expr>
size: Option<Expr>
save_type: Option<SaveType>
dsk_filename: Option<String>
side: Option<Expr>

Section(SmolStr)

SetCPC(Expr)

SetCrtc(Expr)

SetN(SmolStr, SmolStr, Option<Expr>)

SnaInit(String)

This directive setup a value for a given flag of the snapshot

SnaSet(SnapshotFlagFlagValue)

StableTicker(StableTickerAction)

Str(Vec<Expr, Global>)

Struct(SmolStr, Vec<(SmolStr, Token), Global>)

Switch(ExprVec<(Expr, BaseListing<Token>, bool), Global>, Option<BaseListing<Token>>)

Undef(SmolStr)

WaitNops(Expr)

While(ExprBaseListing<Token>)

Implementations

When diassembling code, the token with relative information are not appropriate

Check if it is an undocumented instruction that makes a copy of the data to save in an additional register

👎 Deprecated since 0.1.1:

please use expr instead as other token need it

Rename the @labels in macros XXX no more needed - to remove later

Return true for directives that can emebed some listing information

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Converts to this type from the input type.

Converts to this type from the input type.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Convert the token in its simplest form

Unroll the tokens when in a repetition loop TODO return an iterator in order to not produce the vector each time

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

Returns an estimation of the duration. This estimation may be wrong for instruction having several states.

Return the number of bytes of the token given the provided context

Dummy version that assemble without taking into account the context TODO find a way to not build a symbol table each time Read more

Assemble the symbol taking into account some context, but never modify this context

Check if the token is valid. We consider a token vlaid if it is possible to assemble it

Make all the necessary for the given token

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Converts self into T using Into<T>. Read more

Compare self to key and return true if they are equal.

Causes self to use its Binary implementation when Debug-formatted. Read more

Causes self to use its Display implementation when Debug-formatted. Read more

Causes self to use its LowerExp implementation when Debug-formatted. Read more

Causes self to use its LowerHex implementation when Debug-formatted. Read more

Causes self to use its Octal implementation when Debug-formatted. Read more

Causes self to use its Pointer implementation when Debug-formatted. Read more

Causes self to use its UpperExp implementation when Debug-formatted. Read more

Causes self to use its UpperHex implementation when Debug-formatted. Read more

Formats each item in a sequence. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Pipes by value. This is generally the method you want to use. Read more

Borrows self and passes that borrow into the pipe function. Read more

Mutably borrows self and passes that borrow into the pipe function. Read more

Borrows self, then passes self.borrow() into the pipe function. Read more

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more

Borrows self, then passes self.as_ref() into the pipe function.

Mutably borrows self, then passes self.as_mut() into the pipe function. Read more

Borrows self, then passes self.deref() into the pipe function.

Mutably borrows self, then passes self.deref_mut() into the pipe function. Read more

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Immutable access to a value. Read more

Mutable access to a value. Read more

Immutable access to the Borrow<B> of a value. Read more

Mutable access to the BorrowMut<B> of a value. Read more

Immutable access to the AsRef<R> view of a value. Read more

Mutable access to the AsMut<R> view of a value. Read more

Immutable access to the Deref::Target of a value. Read more

Mutable access to the Deref::Target of a value. Read more

Calls .tap() only in debug builds, and is erased in release builds.

Calls .tap_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref_mut() only in debug builds, and is erased in release builds. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

Attempts to convert self into T using TryInto<T>. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.