This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: The grammar and semantics of Beginning Student as discussed in class CS 135 Fall 2008 1 The grammar Here are all the grammatical rules for Beginning Student as covered in class 1 through the end of lecture module 04. When doing traces by hand, these are the rules that are expected. h program i = h deforexpr i ... h deforexpr i = h def i  h exp i h def i = (define ( h id i h id i ... h id i ) h exp i ) h def i = (define h id i h exp i ) h def i = (definestruct h id i ( h id i ... h id i )) h primop i = builtin function names h primop i = cs1  ...  csn  c? (where c is a structure with fields s1 ... sn ) h exp i = h id i h exp i = h val i h exp i = ( h id i h exp i ... h exp i ) h exp i = ( h primop i h exp i ... h exp i ) h exp i = (cond [ h exp i h exp i ] ... [ h exp i h exp i ]) h exp i = (cond [ h exp i h exp i ] ... [else h exp i ]) h exp i = (and h exp i ... ) h exp i = (or h exp i ... ) h val i = h number i  h symbol i  h string i  true  false  h posn i  h lstval...
View
Full
Document
This note was uploaded on 10/21/2010 for the course CS 135 taught by Professor Vasiga during the Fall '07 term at Waterloo.
 Fall '07
 VASIGA

Click to edit the document details