All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.duelengine.duel.parsing.InvalidTokenException Maven / Gradle / Ivy

There is a newer version: 0.9.7
Show newest version
package org.duelengine.duel.parsing;

/**
 * Represents compilation errors related to a specific token in the source file
 */
@SuppressWarnings("serial")
public class InvalidTokenException extends SyntaxException {

	private final DuelToken token;

	public InvalidTokenException(String message, DuelToken duelToken) {
		super(message,
			(duelToken != null) ? duelToken.getIndex() : -1,
			(duelToken != null) ? duelToken.getLine() : -1,
			(duelToken != null) ? duelToken.getColumn() : -1);

		token = duelToken;
	}

	public InvalidTokenException(String message, DuelToken duelToken, Throwable cause) {
		super(message,
			(duelToken != null) ? duelToken.getIndex() : -1,
			(duelToken != null) ? duelToken.getLine() : -1,
			(duelToken != null) ? duelToken.getColumn() : -1,
			cause);

		token = duelToken;
	}

	public DuelToken getToken() {
		return token;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy