PrevState = CurrState;
}
void onDispExpr(const MCExpr *SymRef, StringRef SymRefName) {
- IntelExprState CurrState = State;
+ PrevState = State;
switch (State) {
default:
State = IES_ERROR;
IC.pushOperand(IC_IMM);
break;
}
- PrevState = CurrState;
}
void onInteger(int64_t TmpInt) {
IntelExprState CurrState = State;
PrevState = CurrState;
}
void onStar() {
- IntelExprState CurrState = State;
+ PrevState = State;
switch (State) {
default:
State = IES_ERROR;
IC.pushOperator(IC_MULTIPLY);
break;
}
- PrevState = CurrState;
}
void onDivide() {
- IntelExprState CurrState = State;
+ PrevState = State;
switch (State) {
default:
State = IES_ERROR;
IC.pushOperator(IC_DIVIDE);
break;
}
- PrevState = CurrState;
}
void onLBrac() {
- IntelExprState CurrState = State;
+ PrevState = State;
switch (State) {
default:
State = IES_ERROR;
IC.pushOperator(IC_PLUS);
break;
}
- PrevState = CurrState;
}
void onRBrac() {
IntelExprState CurrState = State;
case IES_MULTIPLY:
case IES_DIVIDE:
case IES_LPAREN:
+ // FIXME: We don't handle this type of unary minus, yet.
+ if ((PrevState == IES_PLUS || PrevState == IES_MINUS ||
+ PrevState == IES_MULTIPLY || PrevState == IES_DIVIDE ||
+ PrevState == IES_LPAREN || PrevState == IES_LBRAC) &&
+ CurrState == IES_MINUS) {
+ State = IES_ERROR;
+ break;
+ }
State = IES_LPAREN;
IC.pushOperator(IC_LPAREN);
break;
PrevState = CurrState;
}
void onRParen() {
- IntelExprState CurrState = State;
+ PrevState = State;
switch (State) {
default:
State = IES_ERROR;
IC.pushOperator(IC_RPAREN);
break;
}
- PrevState = CurrState;
}
};