* 转换数据,主要是转换负号,方法执行
*/
private Object parseItem(Object item) {
// 处理参数个数
if (methods.peek() != null) {
MethodOpt opt = methods.peek();
if (opt.getSize() <= 0) {
if (!(item instanceof CommaOpt) && !(item instanceof RBracketOpt)) {
opt.setSize(1);
}
} else {
if (item instanceof CommaOpt) {
opt.setSize(opt.getSize() + 1);
}
}
}
// 左括号
if (item instanceof LBracketOpt) {
if (prev instanceof Elobj) {
MethodOpt prem = new MethodOpt();
item = new Object[]{prem, new LBracketOpt()};
methods.addFirst(prem);
} else {
methods.addFirst(null);
}