// 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;
                //risolve il caso del nodo con relazione inversa e var "amr-unknown"
                n.relation = n.relation.substring(0, n.relation.length() - 3);
                String swap = root.getInstance().var;
                root.getInstance().var = n.getInstance().var;
                n.getInstance().var = swap;

            } else {

                Node newNode = root.getCopy(n.relation.substring(0, n.relation.length() - 3));

                //newNode.list.add(root.getInstance());
                this.nodes.add(newNode);
                n.relation = TOP;
                n.list.add(newNode);
            }

        }

        for (Node n1 : root.list) {
            n1 = inverseChecker(n1);
        }

        return root;
    }

    /*
    Imposta il valore del verbo di riferimento per i nodi figli
     */
    private void args(Node root) {
        for (Node n : root.list) {
// 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;

                //risolve il caso del nodo con relazione inversa e var "amr-unknown"
                n.relation = n.relation.substring(0, n.relation.length() - 3);
                String swap = root.getInstance().var;
                root.getInstance().var = n.getInstance().var;
                n.getInstance().var = swap;

            } else {

                Node newNode = root.getCopy(n.relation.substring(0, n.relation.length() - 3));

                //newNode.list.add(root.getInstance());
                this.nodes.add(newNode);
                n.relation = TOP;
                n.list.add(newNode);
            }

        }

        for (Node n1 : root.list) {
            n1 = inverseChecker(n1);
        }

        return root;
    }

    /*
    Imposta il valore del verbo di riferimento per i nodi figli
     */
    private void args(Node root) {
        for (Node n : root.list) {
            if (n.relation.matches(AMR_ARG)) {