Search in sources :

Example 1 with AbstractTokenizer

use of org.spoofax.jsglr.client.imploder.AbstractTokenizer in project spoofax by metaborg.

the class JSGLRParseErrorHandler method reportErrorNearOffset.

private void reportErrorNearOffset(ITokens tokenizer, int offset, String message) {
    final IToken errorToken = ((AbstractTokenizer) tokenizer).getErrorTokenOrAdjunct(offset);
    final ISourceRegion region = JSGLRSourceRegionFactory.fromTokens(errorToken, errorToken);
    reportErrorAtRegion(region, message);
}
Also used : AbstractTokenizer(org.spoofax.jsglr.client.imploder.AbstractTokenizer) IToken(org.spoofax.jsglr.client.imploder.IToken) ISourceRegion(org.metaborg.core.source.ISourceRegion)

Aggregations

ISourceRegion (org.metaborg.core.source.ISourceRegion)1 AbstractTokenizer (org.spoofax.jsglr.client.imploder.AbstractTokenizer)1 IToken (org.spoofax.jsglr.client.imploder.IToken)1