Skip to main content

module demo::lang::turing::l1::cst::Syntax

rascal-0.40.17

Usage

import demo::lang::turing::l1::cst::Syntax;

syntax WhiteSpace

layout WhiteSpace = [\ \t\n\r]* !>> [\ \t\n\r];

syntax Program

start syntax Program = program: Statement+  statements;

syntax Statement

syntax Statement
= jumpAlways: "J_" Number num
| jumpSet: "J1" Number num
| jumpUnset: "J0" Number num
| writeSet: "W1"
| writeUnset: "W0"
| moveForward: "MF"
| moveBackward: "MB"
;

syntax Number

lexical Number = [0-9]+ !>> [0-9];