Added Example Rascal files

This commit is contained in:
Ahmad Salim Al-Sibahi
2016-11-29 23:37:34 +01:00
parent c87976330f
commit 4e6e58a099
4 changed files with 923 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
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;
' <}>
' }
'}";