Enum orzir_core::TokenKind
source · pub enum TokenKind {
}Expand description
A token kind.
Variants§
Char(char)
A character
For delimiters, only :, =, ,, ;, * and - are supported. And
for brackets, only (, ), {, }, [, ], <, > are supported.
^, %, !, @ will be used for block label, value name, type alias
and symbol name respectively if they are not followed by an identifier,
otherwise they will be treated as normal characters.
Arrow
->
BlockLabel(String)
A block label starting with ^.
ValueName(String)
A block name starting with %.
TyAlias(String)
A type alias starting with !.
This is the same with MLIR, but not used yet.
SymbolName(String)
A symbol name starting with @.
Tokenized(String)
Other tokenized string.
This represents contiguous alphanumeric or with _, . characters. And
if the string is quoted, there can be escape sequences. This may also
represent numbers, but the parsing process is up to the parser.
Eof
End of file.
AnyBlockLabel
The wildcard for block label
AnyValueName
The wildcard for value name
AnyTyAlias
The wildcard for type alias
AnySymbolName
The wildcard for symbol name
AnyTokenized
The wildcard for any tokenized string.
Implementations§
Trait Implementations§
source§impl PartialEq for TokenKind
impl PartialEq for TokenKind
impl Eq for TokenKind
impl StructuralPartialEq for TokenKind
Auto Trait Implementations§
impl Freeze for TokenKind
impl RefUnwindSafe for TokenKind
impl Send for TokenKind
impl Sync for TokenKind
impl Unpin for TokenKind
impl UnwindSafe for TokenKind
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.