}
switch (state) {
case 0:
if (y.symbol == SYM_TYPE) {
type = (Type) y.value;
PlcLang l = languages.get(type.language);
if (l == null)
throw new CustomICException("invalid ic language: " + type.language + " (" + y.line +
":" + y.col + ")");
state = 1;
} else
throw new CustomICException("unexpected token: " + y.value + " (" + y.line + ":" + y.col
+ ")");
break;
case 1:
if (y.symbol == SYM_NAME) {
name = (Name) y.value;
state = 2;
} else
throw new CustomICException("unexpected token: " + y.value + " (" + y.line + ":" + y.col
+ ")");
break;
case 2:
switch (y.symbol) {
case SYM_PROG:
PlcLang l = languages.get(type.language);
if (l == null) throw new CustomICException("internal error: invalid ic language");
CustomICBase cic = new CustomICBase(l, name.title, (String) y.value);
dest.registerIC(name.icName, cic, type.type);
state = 0;
break;