Below is interpreter.java & there's errors in the code, so make sure to fix those errors with the information of what the code must have. Attached is images of the code with errors. Interpreter.java import java.util.*;
Comments |
None/Excessive (0) |
“What” not “Why”, few (5) |
Some “what” comments or missing some (7) |
Anything not obvious has reasoning (10) |
Variable/Function naming |
Single letters everywhere (0) |
Lots of abbreviations (5) |
Full words most of the time (8) |
Full words, descriptive (10) |
interpretFunction |
Not handled(0) |
|
|
Creates variables and calls interpretBlock (10) |
interpretBlock |
Not handled(0) |
|
|
Loops over the statement nodes and calls methods for each (5) |
expression |
Not handled(0) |
|
|
Handles mathOpNode, constantNodes, variable references (10) |
booleanCompare |
Not handled(0) |
|
|
Calls expression(), then compares (5) |
variableReferenceNode |
Not handled(0) |
|
|
Looks up nodes and returns IDT (5) |
mathOpNode |
Not handled(0) |
|
|
Calls expression(), then calculates (5) |
ifNode |
Not handled(0) |
|
|
Calls booleanCompare and chains (10) |
forNode |
Not handled(0) |
|
|
Loops over the range and calls interpretBlock(10) |
repeatNode |
Not handled(0) |
|
|
Calls booleanCompare and interpretBlock correctly (5) |
constantNodes |
Not handled(0) |
|
|
Returns a new IDT (5) |
whileNode |
Not handled(0) |
|
|
Calls booleanCompare and interpretBlock correctly (5) |
assignmentNode |
Not handled(0) |
|
|
calls expression() and replaces the IDT entry for the variable(5) |
Trending now
This is a popular solution!
Step by step
Solved in 3 steps