#resource "counter.c", "counter.h" #hostcode-c "#include \"counter.h\"" #hostcode-c-header "#include \"counter.h\"" scchart CounterApplication { input bool CountUp output int O host class Counter { @methodHasSelfParameter void increment() @methodHasSelfParameter void decrement() @methodHasSelfParameter int getValue() } counter = `newCounter()` region { initial state A "" if CountUp do counter.increment(); O = counter.getValue() go to A if !CountUp do counter.decrement(); O = counter.getValue() go to A } }