Skip to main content
Version: Sprint 4

makeinit

Designates the initial (start) state of the machine.

Syntax​

makeinit(state);

Parameters​

  • state: The name of the state to use as the starting state

Rules​

  • Required: Every machine must have exactly one initial state
  • Can only be declared once
  • The state must be declared in makestates first
  • The machine begins execution in this state

Examples​

makestates(q0, q1, q2);
makeinit(q0); ### Machine starts in q0
makestates(start, middle, end);
makeinit(start); ### Machine starts in 'start'

Errors​

  • Missing: 'makeinit' is required
  • Duplicate: duplicate 'makeinit' — only one init state is allowed
  • Undeclared state: state 'q0' is not declared
  • Wrong arity: 'makeinit' takes exactly 1 argument, got 2

See Also​