mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-12-29 21:31:01 +00:00
Added Example Rascal files
This commit is contained in:
18
samples/Rascal/Compile.rsc
Normal file
18
samples/Rascal/Compile.rsc
Normal 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;
|
||||
' <}>
|
||||
' }
|
||||
'}";
|
||||
Reference in New Issue
Block a user