diff options
author | 2020-05-08 21:02:33 +0200 | |
---|---|---|
committer | 2020-05-08 21:02:33 +0200 | |
commit | 771e3773bb7ebbf6712724cb2b248467c9cc2e3c (patch) | |
tree | b1724af24b9c583b2780c7a2fe76e76fd174359d /Application/org.eclipse.viatra.solver.language/src/org/eclipse/viatra/solver/language/parser/antlr/SolverLanguageTokenDefInjectingParser.xtend | |
parent | Update solver language grammar (diff) | |
download | VIATRA-Generator-771e3773bb7ebbf6712724cb2b248467c9cc2e3c.tar.gz VIATRA-Generator-771e3773bb7ebbf6712724cb2b248467c9cc2e3c.tar.zst VIATRA-Generator-771e3773bb7ebbf6712724cb2b248467c9cc2e3c.zip |
Synthetic tokens for solver language
Diffstat (limited to 'Application/org.eclipse.viatra.solver.language/src/org/eclipse/viatra/solver/language/parser/antlr/SolverLanguageTokenDefInjectingParser.xtend')
-rw-r--r-- | Application/org.eclipse.viatra.solver.language/src/org/eclipse/viatra/solver/language/parser/antlr/SolverLanguageTokenDefInjectingParser.xtend | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Application/org.eclipse.viatra.solver.language/src/org/eclipse/viatra/solver/language/parser/antlr/SolverLanguageTokenDefInjectingParser.xtend b/Application/org.eclipse.viatra.solver.language/src/org/eclipse/viatra/solver/language/parser/antlr/SolverLanguageTokenDefInjectingParser.xtend new file mode 100644 index 00000000..87efd2b3 --- /dev/null +++ b/Application/org.eclipse.viatra.solver.language/src/org/eclipse/viatra/solver/language/parser/antlr/SolverLanguageTokenDefInjectingParser.xtend | |||
@@ -0,0 +1,16 @@ | |||
1 | package org.eclipse.viatra.solver.language.parser.antlr | ||
2 | |||
3 | import com.google.inject.Inject | ||
4 | import org.antlr.runtime.CharStream | ||
5 | import org.eclipse.xtext.parser.antlr.ITokenDefProvider | ||
6 | |||
7 | class SolverLanguageTokenDefInjectingParser extends SolverLanguageParser { | ||
8 | @Inject ITokenDefProvider tokenDefProvider | ||
9 | |||
10 | override protected createLexer(CharStream stream) { | ||
11 | val tokenSource = super.createLexer(stream) as SolverLanguageTokenSource | ||
12 | tokenSource.initializeTokenDefsFrom(tokenDefProvider) | ||
13 | tokenSource | ||
14 | } | ||
15 | |||
16 | } | ||