Files
cs5/05-parsing/main.rkt
T
2025-10-09 11:15:50 -04:00

70 lines
1.2 KiB
Racket

;; The first three lines of this file were inserted by DrRacket. They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-intermediate-reader.ss" "lang")((modname main) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f)))
#|
<AE> ::= <PROD> + <AE> (1)
| <PROD> (2)
<PROD> ::= <ATOM> * <PROD> (3)
| <ATOM> (4)
<ATOM> ::= <num> (5)
| { <AE> } (6)
"5"
<atom> (5)
<num> 5
"{5}"
<atom> (6)
<ae> (2)
<prod> (4)
<atom> (5)
<num> 5
"{2 + 5}"
<atom> (6)
<ae> (1)
<prod> (4)
<atom> (5)
<num> 2
<ae> (2)
<prod> (4)
<atom> (5)
<num> 5
"{{{2 + 5}} * {5 * {{3 + 6}}}}"
<atom> (6)
<ae> (2)
<prod> (3)
<atom> (6)
<atom> (6)
<ae> (1)
<prod> (4)
<atom> (5)
<num> 2
<ae> (2)
<prod> (4)
<atom> (5)
<num> 5
<prod> (4)
<atom> (6)
<prod> (3)
<atom> (5)
<num> 5
<prod> (4)
<atom> (6)
<atom> (6)
<ae> (1)
<prod> (4)
<atom> (5)
<num> 3
<ae> (2)
<prod> (4)
<atom> (5)
<num> 6
|#