📄 analyzestack.java
字号:
package compiler;
import java.util.Vector;
public class AnalyzeStack
{
public static Vector<Integer> state;
public static Vector<Integer> symbol;
public static int statop;
public static int symtop;
public AnalyzeStack()
{
state = new Vector<Integer>();
symbol = new Vector<Integer>();
state.add(0);
symbol.add(18);
statop = 1;
symtop = 1;
}
//////////////对状态栈的操作//////////////////////
public int getState()
{
return state.get(statop-1);
}
public void pushState(int sta)
{
state.add(sta);
statop++;
}
public int popState()
{
int x;
x = state.remove(--statop);
return x;
}
//////////////对符号栈的操作//////////////////////
public int getSymbol()
{
return symbol.get(symtop-1);
}
public void pushSymbol(int sym)
{
symbol.add(sym);
symtop++;
}
public int popSymbol()
{
int x;
x = symbol.remove(--symtop);
return x;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -