📄 constant.java
字号:
package inter;import lexer.*; import symbols.*;public class Constant extends Expr { public Constant(Token tok, Type p) { super(tok, p); } public Constant(int i) { super(new Num(i), Type.Int); } public static final Constant True = new Constant(Word.True, Type.Bool), False = new Constant(Word.False, Type.Bool); public void jumping(int t, int f) { if ( this == True && t != 0 ) emit("goto L" + t); else if ( this == False && f != 0) emit("goto L" + f); } public String toString() { if(type == Type.Int) { return "ldc " + ((Num)op).value + "\n"; } else if(type == Type.Float) { return "ldc " + ((Real) op).value + "\n"; } else if(type == Type.Complex) { return "ldc 0.0\nldc " + ((Complex) op).iValue + "\n"; } return "nop\n"; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -