File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
solver/src/main/kotlin/org/ucfs/grammar/combinator
test-shared/src/test/kotlin/solver/correctnessTests Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 11package org.ucfs.grammar.combinator
22
33import org.ucfs.grammar.combinator.regexp.Nt
4- import org.ucfs.grammar.combinator.regexp.Regexp
5- import org.ucfs.incrementalDfs
64import org.ucfs.rsm.RsmState
7- import org.ucfs.rsm.symbol.ITerminal
8- import org.ucfs.rsm.symbol.Nonterminal
95
106
117open class Grammar {
@@ -14,6 +10,11 @@ open class Grammar {
1410 private lateinit var startNt: Nt
1511 private lateinit var fictitiousStartNt: Nt
1612
13+ val name: String = this .javaClass.simpleName.ifEmpty {
14+ // in case of lambda objects
15+ this .javaClass.name.substringBeforeLast(' $' ).substringAfterLast(' $' )
16+ }
17+
1718 private var _rsm : RsmState ? = null
1819 val rsm: RsmState
1920 get() {
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ abstract class AbstractCorrectnessTest {
2929
3030
3131 fun runTests (grammar : Grammar ) {
32- val grammarName = grammar.javaClass.simpleName
32+ val grammarName = grammar.name
3333 writeRsmToDot(grammar.rsm, " ${grammarName} Rsm" )
3434 val path: Path = getRootDataFolder()
3535 val testCasesFolder = File (path.resolve(grammarName).toUri())
You can’t perform that action at this time.
0 commit comments