You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
2.0 KiB

  1. /*
  2. * This file is part of the program ltl2dstar (http://www.ltl2dstar.de/).
  3. * Copyright (C) 2005-2007 Joachim Klein <j.klein@ltl2dstar.de>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  17. */
  18. #ifndef NBA_I_H
  19. #define NBA_I_H
  20. #include "APMonom.hpp"
  21. #include "APElement.hpp"
  22. #include "APSet.hpp"
  23. /**
  24. * Simple virtual interface to the functions in a NBA needed by
  25. * parsers to construct an NBA.
  26. */
  27. class NBA_I {
  28. public:
  29. /** Constructor */
  30. virtual ~NBA_I() {};
  31. /**
  32. * Create a new state.
  33. * @return the index of the new state
  34. */
  35. virtual unsigned int nba_i_newState() = 0;
  36. /**
  37. * Add an edge from state <i>from</i> to state <i>to</i>
  38. * for the edges covered by the APMonom.
  39. * @param from the index of the 'from' state
  40. * @param m the APMonom
  41. * @param to the index of the 'to' state
  42. */
  43. virtual void nba_i_addEdge(unsigned int from,
  44. APMonom& m,
  45. unsigned int to) = 0;
  46. /**
  47. * Get the underlying APSet
  48. * @return a const pointer to the APSet
  49. */
  50. virtual APSet_cp nba_i_getAPSet() = 0;
  51. /**
  52. * Set the final flag (accepting) for a state.
  53. * @param state the state index
  54. * @param final the flag
  55. */
  56. virtual void nba_i_setFinal(unsigned int state, bool final) = 0;
  57. /**
  58. * Set the state as the start state.
  59. * @param state the state index
  60. */
  61. virtual void nba_i_setStartState(unsigned int state) = 0;
  62. };
  63. #endif