Merged in PA1
This commit is contained in:
@@ -7,6 +7,7 @@ import java_cup.runtime.ComplexSymbolFactory.Location;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/** Collects the error messages in a Program. There is exactly one per Program node. */
|
||||
public class Errors extends Node {
|
||||
|
||||
@@ -26,11 +27,13 @@ public class Errors extends Node {
|
||||
allowMultipleErrors = true;
|
||||
}
|
||||
|
||||
|
||||
/** Return true iff there are any errors. */
|
||||
public boolean hasErrors() {
|
||||
return !this.errors.isEmpty();
|
||||
}
|
||||
|
||||
|
||||
/** Prevent multiple semantic errors on the same node. */
|
||||
public void suppressMultipleErrors() {
|
||||
allowMultipleErrors = false;
|
||||
|
||||
Reference in New Issue
Block a user