import org.antlr.runtime.ANTLRReaderStream;
import org.antlr.runtime.CommonTokenStream;
-import org.antlr.runtime.MismatchedTokenException;
import org.antlr.runtime.RecognitionException;
import org.antlr.runtime.tree.CommonTree;
+import org.antlr.runtime.tree.RewriteCardinalityException;
import org.eclipse.linuxtools.ctf.parser.CTFLexer;
import org.eclipse.linuxtools.ctf.parser.CTFParser;
import org.eclipse.linuxtools.ctf.parser.CTFParser.parse_return;
tempException = new CTFReaderException(e);
} catch (ParseException e) {
tempException = new CTFReaderException(e);
- } catch (MismatchedTokenException e) {
- tempException = new CtfAntlrException(e);
} catch (RecognitionException e) {
tempException = new CtfAntlrException(e);
+ } catch (RewriteCardinalityException e){
+ tempException = new CtfAntlrException(e);
}
/* Ghetto resource management. Java 7 will deliver us from this... */
import org.antlr.runtime.MismatchedTokenException;
import org.antlr.runtime.RecognitionException;
+import org.antlr.runtime.tree.RewriteCardinalityException;
import org.eclipse.linuxtools.ctf.core.trace.CTFReaderException;
import org.eclipse.linuxtools.ctf.parser.CTFLexer;
private String fActualName = ""; //$NON-NLS-1$
private int fActualValue = -1;
-
/**
* Re-throw the exception but read its data
*
* @param e
* the previous recognition exception (Antlr specific)
*/
- public CtfAntlrException(MismatchedTokenException e){
+ public CtfAntlrException(MismatchedTokenException e) {
super(e);
this.fErrorLine = e.line;
this.fFile = "metadata"; //$NON-NLS-1$ // we're in CTF, the only thing using antlr is metadata
parseMismatchedException(e);
}
+ /**
+ * Re-throw the exception but read its data
+ *
+ * @param e
+ * the previous rewrite exception (Antlr specific)
+ */
+ public CtfAntlrException(RewriteCardinalityException e) {
+ super(e);
+ this.fErrorLine = -1;
+ this.fFile = "metadata"; //$NON-NLS-1$ // we're in CTF, the only thing using antlr is metadata
+ }
+
private void parseMismatchedException(MismatchedTokenException m) {
// Iterate through the tokens that are hidden in the CTFLexer
// They are private static final int fields.