}
else
{
formulaToken = new FormulaToken();
formulaToken.OpCode = opCodePush.Token.OpCode;
formulaToken.Data = new Any(Type.STRING, token.image);
}
tokens.add(formulaToken);
token = tokenParser.getNextToken();
}
if ( brackets > 0 )
{
final FormulaOpCodeMapEntry opCode = (FormulaOpCodeMapEntry) parserNames.get(")");
while ( brackets-- != 0 )
{
formula = formula.concat(")");
images.add(")");
tokens.add(opCode.Token);
}
}
parser.parse(formula);
} catch ( ParseException ex )
{
boolean found = false;
// error occured so all token must be bad
for (int i = 0; i < tokens.size(); i++)
{
if ( !found && ex.currentToken != null && images.get(i).equals(ex.currentToken.image) )
found = true;
if ( found )
{
final FormulaToken dest = new FormulaToken();
dest.OpCode = ((FormulaOpCodeMapEntry) specialOpCodes.get(FormulaMapGroupSpecialOffset.BAD)).Token.OpCode;
dest.Data = new Any(Type.STRING, images.get(i));
tokens.remove(i);
tokens.add(i, dest);
}
}
} catch ( java.lang.Exception e )