[Nice-commit] Nice/src/bossa/util UserError.java,1.5,1.6 Location.java,1.22,1.23
Brought to you by:
bonniot
From: <bo...@us...> - 2003-02-20 14:58:44
|
Update of /cvsroot/nice/Nice/src/bossa/util In directory sc8-pr-cvs1:/tmp/cvs-serv10332/src/bossa/util Modified Files: UserError.java Location.java Log Message: Allow error messages to be displayed during code generation. Index: UserError.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/util/UserError.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** UserError.java 12 Mar 2002 15:51:52 -0000 1.5 --- UserError.java 20 Feb 2003 14:58:38 -0000 1.6 *************** *** 31,47 **** public UserError(Located responsible, String message) { this(message); ! this.responsible = responsible; } public String getMessage() { ! if (responsible == null || responsible.location() == null) return message; else ! return responsible.location() + ":\n" + message; } public String message; ! public Located responsible; } --- 31,59 ---- public UserError(Located responsible, String message) { + this(responsible.location(), message); + } + + public UserError(gnu.expr.Expression responsible, String message) + { + this(new Location(responsible.getFile(), responsible.getLine(), + responsible.getColumn()), + message); + } + + public UserError(Location location, String message) + { this(message); ! this.location = location; } public String getMessage() { ! if (location == null) return message; else ! return location + ":\n" + message; } public String message; ! public Location location; } Index: Location.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/util/Location.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Location.java 20 Jan 2003 19:20:07 -0000 1.22 --- Location.java 20 Feb 2003 14:58:39 -0000 1.23 *************** *** 60,66 **** } public Location(String fileName) { ! this(fileName,-1,-1,-1,-1); } --- 60,71 ---- } + public Location(String fileName, int startLine, int startColumn) + { + this(fileName, startLine, startColumn, -1, -1); + } + public Location(String fileName) { ! this(fileName, -1, -1); } |