EnterExitAction.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using System;
  2. using System.Xml.Linq;
  3. namespace csharp_sccd_compiler
  4. {
  5. public abstract class EnterExitAction : Visitable
  6. {
  7. public StateChartNode parent { get; private set; }
  8. public Action action { get; private set; }
  9. public EnterExitAction(StateChartNode parent, XElement xml = null)
  10. {
  11. this.parent = parent;
  12. if (xml != null)
  13. this.action = new Action(xml);
  14. else
  15. this.action = null;
  16. }
  17. public override void accept(Visitor visitor)
  18. {
  19. visitor.visit (this);
  20. }
  21. }
  22. public class EnterAction : EnterExitAction
  23. {
  24. public EnterAction(StateChartNode parent, XElement xml = null) : base(parent,xml)
  25. {
  26. }
  27. public override void accept(Visitor visitor)
  28. {
  29. visitor.visit (this);
  30. }
  31. }
  32. public class ExitAction : EnterExitAction
  33. {
  34. public ExitAction(StateChartNode parent, XElement xml = null) : base(parent,xml)
  35. {
  36. }
  37. public override void accept(Visitor visitor)
  38. {
  39. visitor.visit (this);
  40. }
  41. }
  42. }