User Tools

Site Tools


compilers:sample-lab-exam

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Last revision Both sides next revision
compilers:sample-lab-exam [2016/12/16 22:42]
deva created
compilers:sample-lab-exam [2016/12/16 22:46]
deva
Line 3: Line 3:
 Change/​extend the compiler of the While language as follows: Change/​extend the compiler of the While language as follows:
  
-  * Change the definition of variable names (identifiers) so that they have to contain at least one digit. +  * Grade 2: Change the definition of variable names (identifiers) so that they have to contain at least one digit. 
-  * Add the ''​elsif''​ keyword to the language. +  * Grade 3: Add the ''​elsif''​ keyword to the language. 
-  * Change the syntax of branching so that it allows multiple branches:+  * Grade 4: Change the syntax of branching so that it allows multiple branches. Example:
 <​code>​ <​code>​
 if x < 10 then if x < 10 then
Line 15: Line 15:
 end end
 </​code>​ </​code>​
-  * Emit error message if the condition of an ''​elsif''​ is not boolean.+  * Grade 5: Emit error message if the condition of an ''​elsif''​ is not boolean.
  
compilers/sample-lab-exam.txt · Last modified: 2016/12/16 22:46 by deva