rubyfflat.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * 2007 Victor Hugo Borja <vic@rubyforge.org>
  3. * Copyright 2001-2007 Adrian Thurston <thurston@complang.org>
  4. */
  5. /* This file is part of Ragel.
  6. *
  7. * Ragel is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * Ragel is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with Ragel; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  20. */
  21. #ifndef _RUBY_FFLATCODEGEN_H
  22. #define _RUBY_FFLATCODEGEN_H
  23. #include <iostream>
  24. #include "rubyflat.h"
  25. class RubyFFlatCodeGen : public RubyFlatCodeGen
  26. {
  27. public:
  28. RubyFFlatCodeGen( ostream &out ) :
  29. RubyFlatCodeGen(out) {}
  30. protected:
  31. std::ostream &TO_STATE_ACTION_SWITCH();
  32. std::ostream &FROM_STATE_ACTION_SWITCH();
  33. std::ostream &EOF_ACTION_SWITCH();
  34. std::ostream &ACTION_SWITCH();
  35. void GOTO( ostream &out, int gotoDest, bool inFinish );
  36. void GOTO_EXPR( ostream &out, GenInlineItem *ilItem, bool inFinish );
  37. void CALL( ostream &out, int callDest, int targState, bool inFinish );
  38. void CALL_EXPR(ostream &out, GenInlineItem *ilItem, int targState, bool inFinish );
  39. void RET( ostream &out, bool inFinish );
  40. void BREAK( ostream &out, int targState );
  41. virtual int TO_STATE_ACTION( RedStateAp *state );
  42. virtual int FROM_STATE_ACTION( RedStateAp *state );
  43. virtual int EOF_ACTION( RedStateAp *state );
  44. virtual int TRANS_ACTION( RedTransAp *trans );
  45. virtual void writeData();
  46. virtual void writeExec();
  47. };
  48. /*
  49. * Local Variables:
  50. * mode: c++
  51. * indent-tabs-mode: 1
  52. * c-file-style: "bsd"
  53. * End:
  54. */
  55. #endif