8.10
4.1.13 v11 Languages
| (require cpsc411/langs/v11) | package: cpsc411-lib |
racketish-surface : grammar?
| p | ::= | (module (define x (lambda (x ...) value)) ... value) | ||
| value | ::= | triv | ||
| | | (quote s-expr) | |||
| | | (value value ...) | |||
| | | (macro-id value ...) | |||
| | | (let ([x value] ...) value) | |||
| | | (if value value value) | |||
| | | (call value value ...) | |||
| triv | ::= | fixnum | ||
| | | prim-f | |||
| | | x | |||
| | | #t | |||
| | | #f | |||
| | | empty | |||
| | | (void) | |||
| | | (error uint8) | |||
| | | ascii-char-literal | |||
| | | (lambda (x ...) value) | |||
| | | vec-literal | |||
| x | ::= | name? | ||
| | | prim-f | |||
| s-expr | ::= | #t | ||
| | | #f | |||
| | | fixnum | |||
| | | ascii-char-literal | |||
| | | (s-expr ...) | |||
| macro-id | ::= | vector | ||
| | | and | |||
| | | or | |||
| | | begin | |||
| prim-f | ::= | * | ||
| | | + | |||
| | | - | |||
| | | eq? | |||
| | | < | |||
| | | <= | |||
| | | > | |||
| | | >= | |||
| | | fixnum? | |||
| | | boolean? | |||
| | | empty? | |||
| | | void? | |||
| | | ascii-char? | |||
| | | error? | |||
| | | not | |||
| | | pair? | |||
| | | procedure? | |||
| | | vector? | |||
| | | cons | |||
| | | car | |||
| | | cdr | |||
| | | make-vector | |||
| | | vector-length | |||
| | | vector-set! | |||
| | | vector-ref | |||
| | | procedure-arity | |||
| fixnum | ::= | int61? | ||
| uint8 | ::= | uint8? | ||
| ascii-char-literal | ::= | ascii-char-literal? | ||
| vec-literal | ::= | host:vector? |
procedure
(racketish-surface? a) → boolean?
a : any/c
Decides whether a is a valid program in the racketish-surface grammar, represented as a quoted datum. The first non-terminal in the grammar defines valid programs.
procedure
a : racketish-surface?
Evaluates a racketish-surface program to a value.
racketish-unique : grammar?
| p | ::= | (module (define aloc (lambda (aloc ...) value)) ... value) | ||
| value | ::= | triv | ||
| | | (quote s-expr) | |||
| | | (vector value ...) | |||
| | | (value value ...) | |||
| | | (macro-id value ...) | |||
| | | (let ([aloc value] ...) value) | |||
| | | (if value value value) | |||
| | | (call value value ...) | |||
| triv | ::= | fixnum | ||
| | | prim-f | |||
| | | aloc | |||
| | | #t | |||
| | | #f | |||
| | | empty | |||
| | | (void) | |||
| | | (error uint8) | |||
| | | ascii-char-literal | |||
| | | (lambda (aloc ...) value) | |||
| s-expr | ::= | #t | ||
| | | #f | |||
| | | fixnum | |||
| | | ascii-char-literal | |||
| | | (s-expr ...) | |||
| macro-id | ::= | and | ||
| | | or | |||
| | | quote | |||
| | | vector | |||
| | | begin | |||
| prim-f | ::= | * | ||
| | | + | |||
| | | - | |||
| | | eq? | |||
| | | < | |||
| | | <= | |||
| | | > | |||
| | | >= | |||
| | | fixnum? | |||
| | | boolean? | |||
| | | empty? | |||
| | | void? | |||
| | | ascii-char? | |||
| | | error? | |||
| | | not | |||
| | | pair? | |||
| | | procedure? | |||
| | | vector? | |||
| | | cons | |||
| | | car | |||
| | | cdr | |||
| | | make-vector | |||
| | | vector-length | |||
| | | vector-set! | |||
| | | vector-ref | |||
| | | procedure-arity | |||
| aloc | ::= | aloc? | ||
| fixnum | ::= | int61? | ||
| uint8 | ::= | uint8? | ||
| ascii-char-literal | ::= | ascii-char-literal? |
procedure
(racketish-unique? a) → boolean?
a : any/c
Decides whether a is a valid program in the racketish-unique grammar, represented as a quoted datum. The first non-terminal in the grammar defines valid programs.
procedure
(interp-racketish-unique a) → any/c
a : racketish-unique?
Evaluates a racketish-unique program to a value.