*/
private IErlMember create(final IErlModule module, final OtpErlangTuple el) {
final OtpErlangAtom type = (OtpErlangAtom) el.elementAt(0);
final String typeS = type.atomValue();
if ("error".equals(typeS)) {
final OtpErlangTuple er = (OtpErlangTuple) el.elementAt(1);
final String msg = helper.formatError(er);
final ErlParserProblem e = ErlParserProblem.newError(module, msg);
setPos(e, er.elementAt(0));
return e;
} else if ("tree".equals(typeS)) {
final OtpErlangTuple atr = (OtpErlangTuple) el.elementAt(3);
final OtpErlangObject pos = ((OtpErlangTuple) el.elementAt(2)).elementAt(1);
final OtpErlangTuple name = (OtpErlangTuple) atr.elementAt(1);
final OtpErlangAtom n = (OtpErlangAtom) concreteTerm(name);
final OtpErlangObject val = atr.elementAt(2);
final OtpErlangObject extra = el.arity() > 4 ? el.elementAt(4) : null;
return addAttribute(module, pos, n, val, extra, null);
} else if ("attribute".equals(typeS)) {
final OtpErlangObject pos = el.elementAt(1);
final OtpErlangAtom name = (OtpErlangAtom) el.elementAt(2);
final OtpErlangObject val = el.elementAt(3);
final OtpErlangObject extra = el.arity() > 4 ? el.elementAt(4) : null;
final OtpErlangObject arity = el.arity() > 5 ? el.elementAt(5) : null;
return addAttribute(module, pos, name, val, extra, arity);
} else if ("function".equals(typeS)) {
final ErlFunction f = makeErlFunction(module, el);
final OtpErlangList clauses = (OtpErlangList) el.elementAt(6);
final List<ErlFunctionClause> cls = Lists.newArrayListWithCapacity(clauses
.arity());
for (int i = 0; i < clauses.arity(); i++) {
final OtpErlangTuple clause = (OtpErlangTuple) clauses.elementAt(i);
final ErlFunctionClause cl = makeErlFunctionClause(f, i, clause);
cls.add(cl);
}
f.setChildren(cls);
return f;