;;; Generated by Guile-SMC 0.5.2
;;; <https://github.com/artyom-poptsov/guile-smc>


;;; This finite-state machine is produced by:
;;;   PlantUML <https://plantuml.com> Reader Finite-State Machine.
;;;   This FSM is a part of Guile State-Machine Compiler (Guile-SMC)
;;;   <https://github.com/artyom-poptsov/guile-smc>
;;;
;;; Statistics:
;;;   step-counter:               294
;;;   transition-counter:          55
;;;
;;; Resolver status:
;;;   #<directory (smc context char)>
;;;     #<procedure char:eof-object? (ctx ch)>
;;;   #<directory (smc trace-context)>
;;;     #<<generic> event-source (1)>
;;;     #<procedure #{guard:#t}# (ctx event)>
;;;     #<procedure action:format-error (ctx line)>
;;;     #<procedure action:no-op (ctx event)>
;;;     #<procedure action:parse-message (ctx line)>
;;;     #<procedure action:parse-transition (ctx line)>
;;;     #<procedure guard:message? (ctx line)>
;;;     #<procedure guard:transition? (ctx line)>


(define-module
  (smc trace-fsm)
  #:use-module
  (oop goops)
  #:use-module
  (smc fsm)
  #:use-module
  (smc trace-context)
  #:use-module
  (smc context char)
  #:use-module
  (smc context oop char)
  #:re-export
  (fsm-run!)
  #:export
  (<trace-fsm>))



(define %transition-table
  `(((name . read_line)
     (description . "Read lines from a log.")
     (event-source unquote event-source)
     (transitions
       (,char:eof-object? ,action:no-op #f)
       (,guard:transition?
        ,action:parse-transition
        read_line)
       (,guard:message? ,action:parse-message read_line)
       (,#{guard:#t}# ,action:format-error #f)))))


(define-class <trace-fsm> (<fsm>))


(define-method
  (initialize (self <trace-fsm>) initargs)
  (next-method)
  (fsm-description-set! self #f)
  (fsm-event-source-set! self event-source)
  (fsm-transition-table-set!
    self
    (transition-list->hash-table
      self
      %transition-table))
  (fsm-current-state-set!
    self
    (fsm-state self 'read_line)))

