gotable.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * Copyright 2001-2006 Adrian Thurston <thurston@complang.org>
  3. * 2004 Erich Ocean <eric.ocean@ampede.com>
  4. * 2005 Alan West <alan@alanz.com>
  5. */
  6. /* This file is part of Ragel.
  7. *
  8. * Ragel is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * Ragel is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with Ragel; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  21. */
  22. #ifndef _GOTABLE_H
  23. #define _GOTABLE_H
  24. #include <iostream>
  25. #include "gotablish.h"
  26. class GoTabCodeGen
  27. : public GoTablishCodeGen
  28. {
  29. public:
  30. GoTabCodeGen( ostream &out )
  31. : GoTablishCodeGen(out) {}
  32. virtual ~GoTabCodeGen() { }
  33. virtual void writeData();
  34. virtual void writeExec();
  35. protected:
  36. std::ostream &TO_STATE_ACTION_SWITCH( int level );
  37. std::ostream &FROM_STATE_ACTION_SWITCH( int level );
  38. std::ostream &EOF_ACTION_SWITCH( int level );
  39. std::ostream &ACTION_SWITCH( int level );
  40. std::ostream &COND_KEYS();
  41. std::ostream &COND_SPACES();
  42. std::ostream &KEYS();
  43. std::ostream &INDICIES();
  44. std::ostream &COND_OFFSETS();
  45. std::ostream &KEY_OFFSETS();
  46. std::ostream &INDEX_OFFSETS();
  47. std::ostream &COND_LENS();
  48. std::ostream &SINGLE_LENS();
  49. std::ostream &RANGE_LENS();
  50. std::ostream &TO_STATE_ACTIONS();
  51. std::ostream &FROM_STATE_ACTIONS();
  52. std::ostream &EOF_ACTIONS();
  53. std::ostream &EOF_TRANS();
  54. std::ostream &TRANS_TARGS();
  55. std::ostream &TRANS_ACTIONS();
  56. std::ostream &TRANS_TARGS_WI();
  57. std::ostream &TRANS_ACTIONS_WI();
  58. void LOCATE_TRANS();
  59. void COND_TRANSLATE();
  60. virtual std::ostream &TO_STATE_ACTION( RedStateAp *state );
  61. virtual std::ostream &FROM_STATE_ACTION( RedStateAp *state );
  62. virtual std::ostream &EOF_ACTION( RedStateAp *state );
  63. virtual std::ostream &TRANS_ACTION( RedTransAp *trans );
  64. virtual void calcIndexSize();
  65. };
  66. #endif