|
|
@ -58,8 +58,11 @@ public class PrePostFixOperator extends Operator { |
|
|
|
* Sets the return type of this operator. |
|
|
|
* Sets the return type of this operator. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void setType(Type type) { |
|
|
|
public void setType(Type type) { |
|
|
|
store.setLValueType(type); |
|
|
|
if (!isVoid()) { |
|
|
|
super.setType(store.getLValueType()); |
|
|
|
store.setLValueType(type); |
|
|
|
|
|
|
|
super.setType(store.getLValueType()); |
|
|
|
|
|
|
|
} else |
|
|
|
|
|
|
|
super.setType(type); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setOperandType(Type[] inputTypes) { |
|
|
|
public void setOperandType(Type[] inputTypes) { |
|
|
@ -71,18 +74,18 @@ public class PrePostFixOperator extends Operator { |
|
|
|
throws java.io.IOException { |
|
|
|
throws java.io.IOException { |
|
|
|
boolean needBrace = false; |
|
|
|
boolean needBrace = false; |
|
|
|
int priority = 700; |
|
|
|
int priority = 700; |
|
|
|
if (postfix) { |
|
|
|
if (!postfix) { |
|
|
|
writer.print(getOperatorString()); |
|
|
|
writer.print(getOperatorString()); |
|
|
|
priority = 800; |
|
|
|
priority = 800; |
|
|
|
} |
|
|
|
} |
|
|
|
if (store.getPriority() < priority) { |
|
|
|
if (store.getLValuePriority() < priority) { |
|
|
|
needBrace = true; |
|
|
|
needBrace = true; |
|
|
|
writer.print("("); |
|
|
|
writer.print("("); |
|
|
|
} |
|
|
|
} |
|
|
|
store.dumpLValue(writer, operands); |
|
|
|
store.dumpLValue(writer, operands); |
|
|
|
if (needBrace) |
|
|
|
if (needBrace) |
|
|
|
writer.print(")"); |
|
|
|
writer.print(")"); |
|
|
|
if (!postfix) |
|
|
|
if (postfix) |
|
|
|
writer.print(getOperatorString()); |
|
|
|
writer.print(getOperatorString()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|