Skip to content

Commit

Permalink
removed Java 7 style multi-catch statements
Browse files Browse the repository at this point in the history
  • Loading branch information
d-b committed Feb 24, 2014
1 parent 9929496 commit 07303db
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions A3/src/compiler488/semantics/Semantics.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Boolean actionDeclareScalar(ScalarDeclPart scalarDecl) {

@Action(number = 11) // Declare forward function.
Boolean actionDeclareForwardFunction(RoutineDecl routineDecl) {
return workingSet(routineDecl.getName(),
return symbolTable.scopeSet(routineDecl.getName(),
new FunctionSymbol(routineDecl.getName(), routineDecl.getFunctionType(), false));
}

Expand Down Expand Up @@ -429,11 +429,10 @@ boolean invokeProcessor(AST obj, Map<String, Method> map) {
analysisTop = obj;

// Invoke the processor on object
try {
m.invoke(this, obj); return true;
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
e.printStackTrace(); return false;
}
try { m.invoke(this, obj); return true; }
catch (IllegalAccessException e) { e.printStackTrace(); return false; }
catch (IllegalArgumentException e) { e.printStackTrace(); return false; }
catch (InvocationTargetException e) { e.printStackTrace(); return false; }
}

void semanticAction(int actionNumber) {
Expand Down Expand Up @@ -468,9 +467,10 @@ void semanticAction(int actionNumber) {
try {
Boolean result = (Boolean) m.invoke(this, analysisTop);
System.out.println((result ? "Semantic Action: S" : "Semantic Error: S") + actionNumber);
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
e.printStackTrace();
}
catch (IllegalAccessException e) { e.printStackTrace(); }
catch (IllegalArgumentException e) { e.printStackTrace(); }
catch (InvocationTargetException e) { e.printStackTrace(); }
}
}

Expand Down

0 comments on commit 07303db

Please sign in to comment.