mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 09:40:21 +00:00
19 lines
344 B
Plaintext
19 lines
344 B
Plaintext
module Compile
|
|
|
|
import Syntax;
|
|
|
|
str compile(Machine m) =
|
|
"while (true) {
|
|
' event = input.next();
|
|
' switch (current) {
|
|
' <for (q <- m.states) {>
|
|
' case \"<q.name>\":
|
|
' <for (t <- q.out) {>
|
|
' if (event.equals(\"<t.event>\"))
|
|
' current = \"<t.to>\";
|
|
' <}>
|
|
' break;
|
|
' <}>
|
|
' }
|
|
'}";
|