1. A method for automatically generating an HDL code based on a graphical representation for coding a state machine, comprising: executing by a computer state transitions of the state machine by a backward-directed query starting from a target state; and reaching the target state based on the backward-directed query, wherein a state vector of the generated code is not used in a subsequent synthesis.