return result;
}
public void parseVars(String line)
throws Exception
{
Variable v = null;
String name = "";
String value = "";
if(line.startsWith(symbols[5]) && line.contains(symbols[23]))
{
name = line.substring(line.indexOf(symbols[5]) + 1, line.indexOf(symbols[23]));
value = line.substring(line.indexOf(symbols[23]) + 1);
if(name.equals("") || value.equals(""))
ge.throwGrits(ge.GE_BAD_SYNTAX, line);
if(isNum(value))
{
v = new Variable(1);
v.setName(name);
v.setValue(Integer.parseInt(value));
}
else if(isString(value))
{
v = new Variable(0);
v.setName(name);
v.setValue(value);
for(int i = 0; i < value.length(); i++)
{
Variable string_pos = new Variable(0);
string_pos.setName(name + symbols[21] + i);
string_pos.setValue(value.charAt(i));
vars.add(string_pos);
}
Variable string_length = new Variable(1);
string_length.setName(name + symbols[21] + symbols[2]);
string_length.setValue(value.length());
vars.add(string_length);
}
else if(isMaths(value))
{
v = new Variable(1);
v.setName(name);
v.setValue(parseMaths(value));
}
else if(value.equals(symbols[19]))
{
v = new Variable(0);
v.setName(name);
v.setValue(getInput());
}
else if(isConcat(value))
{
v = new Variable(0);
v.setName(name);
v.setValue(parseConcat(value));
}
else if(isArray(value))
{
v = new Variable(2);
v.setName(name);
value = value.replaceAll("[\\[\\]]", "");
v.setArrayValue(value.split(" "));
}
else if(value.startsWith(symbols[15]) && value.endsWith(symbols[16]))
{
int x = parseMaths(value.replaceAll("[\\(,\\)]", ""));
v = new Variable(1);
v.setName(name);
v.setValue(x);
}
else if(value.equals(symbols[7]))
{
v = new Variable(1);
v.setName(name);
v.setValue(this.meta_int);
}
else if(value.equals(symbols[6]))
{
v = new Variable(0);
v.setName(name);
v.setValue(this.meta_string);
}
for(int n = 0; n < vars.size(); n++)
{
if(vars.get(n).getName().equals(value))
{
v = new Variable(vars.get(n).getType());
v.setName(name);
v.setValue(vars.get(n).getValue());
}
}
if(v.getType() == 2)
{
Variable size = new Variable(1);
size.setName(name + symbols[21] + symbols[2]);
size.setValue(v.getArrayValue().length);
vars.add(size);
for(int i = 0; i < v.getArrayValue().length; i++)
{
if(isNum(v.getArrayValue()[i].toString()))
{
Variable v2 = new Variable(1);
v2.setName(name + symbols[21] + i);
v2.setValue(Integer.parseInt(v.getArrayValue()[i].toString()));
vars.add(v2);
}
else if(isString(v.getArrayValue()[i].toString()))
{
Variable v2 = new Variable(0);
v2.setName(name + symbols[21] + i);
v2.setValue(v.getArrayValue()[i].toString());
vars.add(v2);
}
for(int j = 0; j < vars.size(); j++)
{
if(vars.get(j).getName().equals(v.getArrayValue()[i].toString()))
{
Variable v2 = new Variable(0);
v2.setName(name + symbols[21] + i);
v2.setValue(vars.get(j).getValue());
vars.add(v2);
}
}
}
}