Package org.erlide.engine.internal.model.erlang

Examples of org.erlide.engine.internal.model.erlang.ErlMacroDef


    private IErlMember addMacroDef(final IErlModule module, final OtpErlangObject pos,
            final OtpErlangObject val, final OtpErlangObject extra, final String nameS) {
        if (val instanceof OtpErlangAtom) {
            final String s = Util.stringValue(extra);
            final ErlMember r = new ErlMacroDef(module,
                    ((OtpErlangAtom) val).atomValue(), s);
            setPos(r, pos);
            // r.setParseTree(val);
            return r;
        } else if (val instanceof OtpErlangList) {
            final OtpErlangList macroList = (OtpErlangList) val;
            if (macroList.elementAt(0) instanceof OtpErlangTuple) {
                final OtpErlangTuple macroNameTuple = (OtpErlangTuple) macroList
                        .elementAt(0);
                OtpErlangObject o = macroNameTuple.elementAt(2);
                if (o instanceof OtpErlangTuple) {
                    o = ((OtpErlangTuple) o).elementAt(2);
                }
                ErlMember r;
                if (o instanceof OtpErlangAtom) {
                    final String macroName = ((OtpErlangAtom) o).atomValue();
                    r = new ErlMacroDef(module, macroName, null);
                } else {
                    // what do we do here? the define isn't correct
                    // Erlang...
                    ErlLogger.warn("Strange macro definition in %s: %s",
                            module.getName(), o.toString());
                    r = new ErlMacroDef(module, o.toString(), null);
                }
                setPos(r, pos);
                // r.setParseTree(val);
                return r;
            }
View Full Code Here

TOP

Related Classes of org.erlide.engine.internal.model.erlang.ErlMacroDef

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.