goftable.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 _GOFTABLE_H
  23. #define _GOFTABLE_H
  24. #include <iostream>
  25. #include "gotable.h"
  26. /* Forwards. */
  27. struct CodeGenData;
  28. /*
  29. * GoFTabCode
  30. */
  31. class GoFTabCodeGen
  32. : public GoTabCodeGen
  33. {
  34. public:
  35. GoFTabCodeGen( ostream &out )
  36. : GoTabCodeGen(out) {}
  37. protected:
  38. std::ostream &TO_STATE_ACTION_SWITCH( int level );
  39. std::ostream &FROM_STATE_ACTION_SWITCH( int level );
  40. std::ostream &EOF_ACTION_SWITCH( int level );
  41. std::ostream &ACTION_SWITCH( int level );
  42. virtual std::ostream &TO_STATE_ACTION( RedStateAp *state );
  43. virtual std::ostream &FROM_STATE_ACTION( RedStateAp *state );
  44. virtual std::ostream &EOF_ACTION( RedStateAp *state );
  45. virtual std::ostream &TRANS_ACTION( RedTransAp *trans );
  46. virtual void writeData();
  47. virtual void writeExec();
  48. virtual void calcIndexSize();
  49. };
  50. #endif