formatting change
This commit is contained in:
@ -64,9 +64,7 @@ public final class StupsCompiler {
|
|||||||
StupsParser stupsParser = StupsParser.fromGrammar(grammar);
|
StupsParser stupsParser = StupsParser.fromGrammar(grammar);
|
||||||
|
|
||||||
AST tree = stupsParser.parse(lexer.getAllTokens(), lexer.getVocabulary());
|
AST tree = stupsParser.parse(lexer.getAllTokens(), lexer.getVocabulary());
|
||||||
|
|
||||||
tree.postprocess(grammar);
|
tree.postprocess(grammar);
|
||||||
|
|
||||||
TypeChecker.validate(tree);
|
TypeChecker.validate(tree);
|
||||||
|
|
||||||
System.out.println("Compilation completed.");
|
System.out.println("Compilation completed.");
|
||||||
|
|||||||
@ -6,12 +6,8 @@ import static util.Logger.log;
|
|||||||
|
|
||||||
public class ParseException extends RuntimeException {
|
public class ParseException extends RuntimeException {
|
||||||
|
|
||||||
public ParseException(String message) {
|
|
||||||
super(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ParseException(String message, AST ast) {
|
public ParseException(String message, AST ast) {
|
||||||
super(message);
|
super("\n" + message);
|
||||||
|
|
||||||
log("\nAST at last state:\n" + ast);
|
log("\nAST at last state:\n" + ast);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,6 +3,6 @@ package typechecker;
|
|||||||
public class AssignmentTypeMismatchException extends RuntimeException {
|
public class AssignmentTypeMismatchException extends RuntimeException {
|
||||||
|
|
||||||
public AssignmentTypeMismatchException(String message) {
|
public AssignmentTypeMismatchException(String message) {
|
||||||
super(message);
|
super("\n" + message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,6 +3,6 @@ package typechecker;
|
|||||||
public class OperatorTypeMismatchException extends RuntimeException {
|
public class OperatorTypeMismatchException extends RuntimeException {
|
||||||
|
|
||||||
public OperatorTypeMismatchException(String message) {
|
public OperatorTypeMismatchException(String message) {
|
||||||
super(message);
|
super("\n" + message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,6 +3,6 @@ package typechecker;
|
|||||||
public class OperatorUsageException extends RuntimeException {
|
public class OperatorUsageException extends RuntimeException {
|
||||||
|
|
||||||
public OperatorUsageException(String message) {
|
public OperatorUsageException(String message) {
|
||||||
super(message);
|
super("\n" + message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,6 +3,6 @@ package typechecker;
|
|||||||
public class SymbolAlreadyDefinedException extends RuntimeException {
|
public class SymbolAlreadyDefinedException extends RuntimeException {
|
||||||
|
|
||||||
public SymbolAlreadyDefinedException(String message) {
|
public SymbolAlreadyDefinedException(String message) {
|
||||||
super(message);
|
super("\n" + message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user