I am trying to implement a stack in java, I want to be able to return the row and the column of the open bracket of its companion that returned an error. For instance:
public static foo() {
System.out.println ("foo"
}
this should produce an error when compiled, what I want to return is some error in the form of:
"ERROR: row 2 column 23 '(' found, and expected ')' at row 2 column 29 but found ' ' instead."
is this possible with a linkedLIst of linkedLists? Or would another tool be better for this application. I would like the push(), pop() and peek() methods to preserve a constant behavior.
Thank you