001 package toolbus.exceptions; 002 003 public class SyntaxErrorException extends RuntimeException{ 004 private static final long serialVersionUID = 7761195368593480234L; 005 006 public final int line; 007 public final int column; 008 public final int position; 009 public final int sym; 010 public String filename = ""; 011 012 public SyntaxErrorException(String filename, int line, int column, int position, int sym){ 013 this(line, column, position, sym); 014 this.filename = filename; 015 } 016 017 public SyntaxErrorException(int line, int column, int position, int sym){ 018 super(); 019 this.line = line; 020 this.column = column; 021 this.position = position; 022 this.sym = sym; 023 } 024 025 public String getMessage(){ 026 return "Syntax error in "+filename+", at line: "+line+", column: "+column+", symbol id: "+sym; 027 } 028 }