Files
linguist/samples/Rascal/Compile.rsc
Ahmad Salim Al-Sibahi 4e6e58a099 Added Example Rascal files
2016-11-29 23:37:34 +01:00

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;
' <}>
' }
'}";