Esempio n. 1
0
        /**
         * Search for a mapping, fuzzily
         * @param result the query
         * @return the corresponding state or NULL otherwise
         */
        public DA_State find(SafraTreeTemplate result)
        {
            //map_type::const_iterator it;

            AbstractedKeyType search_key = new AbstractedKeyType(result.getState());

            //it = _map.find(search_key);

            if (_map.ContainsKey(search_key))
            {
                ValueList list = _map[search_key];

                int count = 0;
                while (list != null)
                {
                    // check to see if we are compatible

                    if (SafraTreeCandidateMatcher.isMatch(result, list._key))
                    {
                        //std::cerr << "Found: "<< count << std::endl;
                        return(list._state);
                    }

                    //	std::cerr << "Tree: "<< *list->_tree;

                    list = list._next;
                    count++;
                }
                //      std::cerr << "Not found: "<< count << std::endl;
            }

            // not found
            return(null);
        }
Esempio n. 2
0
 /**
  * Constructor
  * @param nba_states_with_all_succ_final A BitSet with the indizes of the
  *                                       NBA states that only have accepting (final)
  *                                       successors.
  * @param tree_template                  SafraTreeTemplate to keep track of removed nodes
  */
 public STVisitor_check_for_succ_final(BitSet nba_states_with_all_succ_final, SafraTreeTemplate tree_template)
 {
     _success = false;
     _nba_states_with_all_succ_final = nba_states_with_all_succ_final;
     _tree_template = tree_template;
 }
Esempio n. 3
0
 /**
  * Constructor.
  * @param final_states the states that are accepting (final) in the NBA
  * @param tree_template the tree template to keep track of new nodes
  */
 public STVisitor_check_finalset(BitSet final_states, SafraTreeTemplate tree_template)
 {
     _final_states  = final_states;
     _tree_template = tree_template;
 }
Esempio n. 4
0
 public STVisitor_remove_empty(SafraTreeTemplate tree_template)
 {
     _tree_template = tree_template;
 }
Esempio n. 5
0
 public STVisitor_check_children_vertical(SafraTreeTemplate tree_template)
 {
     _tree_template = tree_template;
 }
Esempio n. 6
0
 public static bool isMatch(SafraTreeTemplate temp, SafraTree tree)
 {
     return(temp.matches(tree));
 }