decompiler
1.0.0
|
A token representing an operator in the high-level language. More...
#include <printlanguage.hh>
Public Types | |
enum | tokentype { binary, unary_prefix, postsurround, presurround, space } |
The possible types of operator token. More... | |
Public Member Functions | |
bool | parentheses (const OpToken &op2, int4 stage) const |
Determine if the given token should be emitted in its own parenthetic expression. More... | |
Public Attributes | |
const char * | |
Printing characters for the token. | |
int4 | stage |
Additional elements consumed from the RPN stack when emitting this token. | |
int4 | precedence |
Precedence level of this token (higher binds more tightly) | |
bool | associative |
True if the operator is associative. | |
tokentype | type |
The basic token type. | |
int4 | spacing |
Spaces to print around operator. | |
int4 | bump |
Spaces to indent if we break here. | |
OpToken * | negate |
The token representing the negation of this token. | |
A token representing an operator in the high-level language.
The token knows how to print itself and other syntax information like precedence level and associativity within the language, desired spacing, and how operator groups its input expressions. Note that an operator has a broader meaning than just p-code operators in this context.
enum OpToken::tokentype |
bool OpToken::parentheses | ( | const OpToken & | op2, |
int4 | stage | ||
) | const |
Determine if the given token should be emitted in its own parenthetic expression.
This token is being emitted. Check if its input expression, ending with the given operator token, needs to be surrounded by parentheses to convey the proper meaning.
op2 | is the input token to this operator |
stage | is the stage of this operator currently being printed |
References associative, binary, postsurround, precedence, presurround, space, stage, type, and unary_prefix.