8.10
3.1.1 v1 Languages
(require cpsc411/langs/v1) | package: cpsc411-lib |
paren-x64-v1 : grammar?
p | ::= | (begin s ...) | ||
s | ::= | (set! reg int64) | ||
| | (set! reg reg) | |||
| | (set! reg_1 (binop reg_1 int32)) | |||
| | (set! reg_1 (binop reg_1 reg)) | |||
reg | ::= | rsp | ||
| | rbp | |||
| | rax | |||
| | rbx | |||
| | rcx | |||
| | rdx | |||
| | rsi | |||
| | rdi | |||
| | r8 | |||
| | r9 | |||
| | r10 | |||
| | r11 | |||
| | r12 | |||
| | r13 | |||
| | r14 | |||
| | r15 | |||
binop | ::= | * | ||
| | + | |||
int64 | ::= | int64? | ||
int32 | ::= | int32? |
procedure
(paren-x64-v1? a) → boolean?
a : any/c
Decides whether a is a valid program in the paren-x64-v1 grammar, represented as a quoted datum. The first non-terminal in the grammar defines valid programs.
procedure
(interp-paren-x64-v1 a) → any/c
a : paren-x64-v1?
Evaluates a paren-x64-v1 program to a value.