// Path: amr2Fred/src/amr2fred/Glossary.java
// public static final int ENDLESS = 1000;
// 
// Path: amr2Fred/src/amr2fred/Glossary.java
// public static final String FRED = "fred:";
// 
// Path: amr2Fred/src/amr2fred/Glossary.java
// public static final String NULL = "Null";
// 
// Path: amr2Fred/src/amr2fred/Glossary.java
// public static final String PIVOT = "Pivot";
// 
// Path: amr2Fred/src/amr2fred/Glossary.java
// public static final String TOP = "top";
// 
// Path: amr2Fred/src/amr2fred/Glossary.java
// public static final String VN_ROLE = "vn.role:";
// 
// Path: amr2Fred/src/amr2fred/Glossary.java
// public static final String AMR_ARG = ":arg.";
// 
// Path: amr2Fred/src/amr2fred/Glossary.java
// public static final String AMR_ARG0 = ":arg0";
// 
// Path: amr2Fred/src/amr2fred/Glossary.java
// public static final String AMR_ARG1 = ":arg1";
// 
// Path: amr2Fred/src/amr2fred/Glossary.java
// public static final String AMR_ARG2 = ":arg2";


import static amr2fred.Glossary.AMR_ARG1;
import static amr2fred.Glossary.AMR_ARG2;
import static amr2fred.Glossary.ENDLESS;
import static amr2fred.Glossary.FRED;
import static amr2fred.Glossary.NULL;
import static amr2fred.Glossary.PIVOT;
import static amr2fred.Glossary.TOP;
import static amr2fred.Glossary.VN_ROLE;
import static amr2fred.Glossary.NodeStatus.AMR;
import static amr2fred.Glossary.NodeStatus.OK;
import static amr2fred.Glossary.NodeStatus.REMOVE;
import static amr2fred.Glossary.NodeType.VERB;
import java.util.ArrayList;
import java.util.Iterator;
import static amr2fred.Glossary.AMR_ARG;
import static amr2fred.Glossary.AMR_ARG0;
            }

        }

        if (instance.var.equalsIgnoreCase(Glossary.AMR_RELATIVE_POSITION)) {

            // caso relative-position
            if (root.getChild(Glossary.AMR_DIRECTION) != null && root.getChild(Glossary.AMR_OP1) != null
                    && root.getChild(Glossary.AMR_QUANT) != null && root.getChild(Glossary.AMR_QUANT).getInstance() != null) {
                Node op1 = getOriginal(root.getChild(Glossary.AMR_OP1));
                root.list.remove(op1);
                Node direction = getOriginal(root.getChild(Glossary.AMR_DIRECTION));
                op1.relation = FRED+direction.getInstance().var + Glossary.OF;
                direction.list.add(op1);
                Node quant = root.getChild(Glossary.AMR_QUANT);
                root.getInstance().var = quant.getInstance().var.replace(Glossary.QUANTITY, "");
            }
        }

        if (instance.var.equalsIgnoreCase(Glossary.HAVE_ORG_ROLE) || instance.var.equalsIgnoreCase(Glossary.HAVE_REL_ROLE)) {

            /*
            casi in cui il verbo è have-org-role-91 o have rel-role-91
            
            TODO Prevedere i casi :arg3 = role of entity B (often left unspecified) 
            e :arg4 = relationship basis (contract, case; rarely used) per HAVE_REL_ROLE 
             */
            String role;
            Node newRoot, arg1, arg2, arg2Instance;

// Path: amr2Fred/src/amr2fred/Glossary.java
// public static final int ENDLESS = 1000;
// 
// Path: amr2Fred/src/amr2fred/Glossary.java
// public static final String FRED = "fred:";
// 
// Path: amr2Fred/src/amr2fred/Glossary.java
// public static final String NULL = "Null";
// 
// Path: amr2Fred/src/amr2fred/Glossary.java
// public static final String PIVOT = "Pivot";
// 
// Path: amr2Fred/src/amr2fred/Glossary.java
// public static final String TOP = "top";
// 
// Path: amr2Fred/src/amr2fred/Glossary.java
// public static final String VN_ROLE = "vn.role:";
// 
// Path: amr2Fred/src/amr2fred/Glossary.java
// public static final String AMR_ARG = ":arg.";
// 
// Path: amr2Fred/src/amr2fred/Glossary.java
// public static final String AMR_ARG0 = ":arg0";
// 
// Path: amr2Fred/src/amr2fred/Glossary.java
// public static final String AMR_ARG1 = ":arg1";
// 
// Path: amr2Fred/src/amr2fred/Glossary.java
// public static final String AMR_ARG2 = ":arg2";


// Path: amr2Fred/src/amr2fred/Parser.java
import static amr2fred.Glossary.AMR_ARG1;
import static amr2fred.Glossary.AMR_ARG2;
import static amr2fred.Glossary.ENDLESS;
import static amr2fred.Glossary.FRED;
import static amr2fred.Glossary.NULL;
import static amr2fred.Glossary.PIVOT;
import static amr2fred.Glossary.TOP;
import static amr2fred.Glossary.VN_ROLE;
import static amr2fred.Glossary.NodeStatus.AMR;
import static amr2fred.Glossary.NodeStatus.OK;
import static amr2fred.Glossary.NodeStatus.REMOVE;
import static amr2fred.Glossary.NodeType.VERB;
import java.util.ArrayList;
import java.util.Iterator;
import static amr2fred.Glossary.AMR_ARG;
import static amr2fred.Glossary.AMR_ARG0;

            }

        }

        if (instance.var.equalsIgnoreCase(Glossary.AMR_RELATIVE_POSITION)) {

            // caso relative-position
            if (root.getChild(Glossary.AMR_DIRECTION) != null && root.getChild(Glossary.AMR_OP1) != null
                    && root.getChild(Glossary.AMR_QUANT) != null && root.getChild(Glossary.AMR_QUANT).getInstance() != null) {
                Node op1 = getOriginal(root.getChild(Glossary.AMR_OP1));
                root.list.remove(op1);
                Node direction = getOriginal(root.getChild(Glossary.AMR_DIRECTION));
                op1.relation = FRED+direction.getInstance().var + Glossary.OF;
                direction.list.add(op1);
                Node quant = root.getChild(Glossary.AMR_QUANT);
                root.getInstance().var = quant.getInstance().var.replace(Glossary.QUANTITY, "");
            }
        }

        if (instance.var.equalsIgnoreCase(Glossary.HAVE_ORG_ROLE) || instance.var.equalsIgnoreCase(Glossary.HAVE_REL_ROLE)) {

            /*
            casi in cui il verbo è have-org-role-91 o have rel-role-91
            
            TODO Prevedere i casi :arg3 = role of entity B (often left unspecified) 
            e :arg4 = relationship basis (contract, case; rarely used) per HAVE_REL_ROLE 
             */
            String role;
            Node newRoot, arg1, arg2, arg2Instance;

            newRoot = root.getChild(AMR_ARG0);