This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
compilers:sample-lab-exam [2016/12/16 22:45] deva |
compilers:sample-lab-exam [2016/12/16 22:46] (current) deva |
||
---|---|---|---|
Line 4: | Line 4: | ||
* Grade 2: 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. | ||
- | * Grade 3: Add the ''elsif'' keyword to the language. (1 point) | + | * Grade 3: Add the ''elsif'' keyword to the language. |
- | * Grade 4: Change the syntax of branching so that it allows multiple branches: (1 point) | + | * Grade 4: Change the syntax of ''if'' instructions 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> | ||
- | * Grade 5: Emit error message if the condition of an ''elsif'' is not boolean. (1 point) | + | * Grade 5: Emit error message if the condition of an ''elsif'' is not boolean. |