match(_t,NAME);
_t = _t.getNextSibling();
if (tables.containsKey(tname.getText()))
table = tables.get(tname.getText());
else throw new RecognitionException("Undefined table: "+ tname.getText());
{
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case NAME:
{
vname = (AST)_t;
AST vname_AST_in = null;
vname_AST = astFactory.create(vname);
match(_t,NAME);
_t = _t.getNextSibling();
int i = 0;
for (AST tableEntry : table) {
Map<String,AST> curVars = new HashMap<String,AST> ();
curVars.put(vname.getText(), (AST)astFactory.make( (new ASTArray(1)).add(astFactory.create(NUM,Integer.toString(i)))));
res.add(new SSLInstructionName(tableEntry.getText(), curVars));
i++;
}
break;
}
case NUM:
{
tidx = (AST)_t;
AST tidx_AST_in = null;
tidx_AST = astFactory.create(tidx);
match(_t,NUM);
_t = _t.getNextSibling();
int index = Integer.parseInt(tidx.getText());
if (index < table.size()) {
res.add(new SSLInstructionName(table.get(index).getText()));
} else throw new RecognitionException("Index " + index + " out of bounds for table " + tname.getText() + "!");
break;
}
default:
{