Search in sources :

Example 1 with ErlImport

use of org.erlide.engine.internal.model.erlang.ErlImport in project erlide_eclipse by erlang.

the class ErlParser method addImportAttribute.

private IErlImport addImportAttribute(final IErlModule module, final OtpErlangObject pos, final OtpErlangObject val) {
    final OtpErlangTuple t = (OtpErlangTuple) val;
    if (t.elementAt(0) instanceof OtpErlangAtom && t.elementAt(1) instanceof OtpErlangList) {
        final OtpErlangAtom importModule = (OtpErlangAtom) t.elementAt(0);
        final OtpErlangList functionList = (OtpErlangList) t.elementAt(1);
        final ErlImport imp = new ErlImport(module, importModule.atomValue(), functionList);
        setPos(imp, pos);
        return imp;
    }
    return null;
}
Also used : OtpErlangList(com.ericsson.otp.erlang.OtpErlangList) OtpErlangTuple(com.ericsson.otp.erlang.OtpErlangTuple) OtpErlangAtom(com.ericsson.otp.erlang.OtpErlangAtom) ErlImport(org.erlide.engine.internal.model.erlang.ErlImport) IErlImport(org.erlide.engine.model.erlang.IErlImport)

Aggregations

OtpErlangAtom (com.ericsson.otp.erlang.OtpErlangAtom)1 OtpErlangList (com.ericsson.otp.erlang.OtpErlangList)1 OtpErlangTuple (com.ericsson.otp.erlang.OtpErlangTuple)1 ErlImport (org.erlide.engine.internal.model.erlang.ErlImport)1 IErlImport (org.erlide.engine.model.erlang.IErlImport)1