PageRenderTime 424ms CodeModel.GetById 212ms app.highlight 14ms RepoModel.GetById 197ms app.codeStats 0ms

/src/org/ubi/SyntaxError.java

http://github.com/nddrylliog/ooc
Java | 43 lines | 17 code | 7 blank | 19 comment | 0 complexity | 1ee521c7f23c0d3ec2d2e1e35b5a8cb8 MD5 | raw file
 1package org.ubi;
 2
 3/**
 4 * A syntax error is at a specific location
 5 *
 6 * @author Amos Wenger
 7 */
 8public class SyntaxError extends Exception {
 9
10    /**
11	 * 
12	 */
13	protected static final long serialVersionUID = 4274111704528892881L;
14	
15	protected FileLocation location;
16    protected String simpleMessage;
17
18    /**
19     * Create a new syntax error at specified location with specified message
20     * @param location
21     * @param message
22     */
23    public SyntaxError(FileLocation location, String message) {
24        super(message+location);
25        this.location = location;
26        this.simpleMessage = message;
27    }
28
29    /**
30     * @return where the error occured in the source
31     */
32    public FileLocation getLocation() {
33        return location;
34    }
35
36    /**
37     * @return the error message, without the stack trace
38     */
39    public String getSimpleMessage() {
40        return simpleMessage;
41    }
42
43}