Documentation
¶
Overview ¶
5 december 2019
4 december 2019
Index ¶
Constants ¶
View Source
const ( LowestPrec = gotoken.LowestPrec UnaryPrec = gotoken.UnaryPrec HightestPrec = gotoken.HighestPrec )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Token ¶
type Token int
Token is the set of lexical tokens in the assembler.
const ( // Special tokens. // These are not literals, operators, or keywords. ILLEGAL Token = iota EOF COMMENT // Literal tokens. IDENT INT CHAR STRING // Operators and delimiters. ADD // + SUB // - MUL // * DIV // / BAND // & BOR // | BXOR // ^ SHL // << SHR // >> CMPL // ~ EQ // == NE // != LT // < LE // <= GT // > GE // >= LAND // && LOR // || NOT // ! COMMA // , SEMI // ; COLON // : AT // @ (denotes local labels) NEXT // :+ (reference to next nameless label in scope) PREV // :- (reference to previous nameless label in scope) POUND // # LPAREN // ( RPAREN // ) // Keywords and entire classes of keywords for 68000-specific tokens. OPCODE // all opcodes DATAREG // d0 .. d7 ADDRREG // a0 .. a7, sp DATAREG_W // d0.w .. d7.w ADDRREG_W // a0.w .. a7.w, sp.w DATAREG_L // d0.l .. d7.l ADDRREG_L // a0.l .. a7.l, sp.l PC // pc USP // usp CCR // ccr SR // sr DOT_W // .w (absolute addressing suffix) DOT_L // .l (absolute addressing suffix) DOT // . (the current position; equivalent to $ or * in other assemblers) MOD // .mod )
Predefined tokens.
func Lookup ¶
Lookup returns the token type for the identifier or keyword stored in str. If str does not store a keyword, IDENT is returned.
func (Token) IsOperator ¶
IsOperator returns whether t is an operator. MOD is not considered an operator for the purposes of this test.
func (Token) Precedence ¶
Precedence returns the binary-operator precedence for t. The precedence of MOD is the same as that of MUL. Precedence rules are the same as in Go. If t is neither MOD nor a binary operator, LowestPrec is returned.
Click to show internal directories.
Click to hide internal directories.