1. A medium holding computer executable instruction for performing a method, the medium comprising instructions for: receiving a statechart, the statechart comprising at least one state, at least one transition, and at least one graphical function, wherein the graphical function is graphically represented in the representation of the statechart and is distinct from each of the at least one states of the statechart, the graphical function comprising a function prototype that specifies a syntax for invoking the graphical function; parsing the statechart into an intermediate representation using a computer, the instructions for parsing the statechart comprising instructions for searching the statechart for the graphical function, generating an intermediate representation of the graphical function, parsing a state or transition of the statechart, encountering a function invocation in the state or transition, wherein the graphical function is invoked in the function invocation, and checking the function invocation for compliance with the syntax for invoking the graphical function; and synthesizing, using the computer, the intermediate representation of the statechart into computer code in a target code language.