Search in sources :

Example 1 with CstrSpecLexer

use of org.btrplace.safeplace.spec.antlr.CstrSpecLexer in project scheduler by btrplace.

the class SpecScanner method getTokens.

private static CommonTokenStream getTokens(String source) throws IOException {
    CharStream is = CharStreams.fromReader(new StringReader(source));
    CstrSpecLexer lexer = new CstrSpecLexer(is);
    lexer.removeErrorListeners();
    lexer.addErrorListener(new DiagnosticErrorListener());
    return new CommonTokenStream(lexer);
}
Also used : CommonTokenStream(org.antlr.v4.runtime.CommonTokenStream) DiagnosticErrorListener(org.antlr.v4.runtime.DiagnosticErrorListener) CstrSpecLexer(org.btrplace.safeplace.spec.antlr.CstrSpecLexer) StringReader(java.io.StringReader) CharStream(org.antlr.v4.runtime.CharStream)

Aggregations

StringReader (java.io.StringReader)1 CharStream (org.antlr.v4.runtime.CharStream)1 CommonTokenStream (org.antlr.v4.runtime.CommonTokenStream)1 DiagnosticErrorListener (org.antlr.v4.runtime.DiagnosticErrorListener)1 CstrSpecLexer (org.btrplace.safeplace.spec.antlr.CstrSpecLexer)1