forked from jasder/antlr
[Swift] Remove unused constructors.
Remove unused constructors from ATNConfig and DFAState, and merge two by using a default parameter instead.
This commit is contained in:
parent
176d92d373
commit
8f42439943
|
@ -66,25 +66,10 @@ public class ATNConfig: Hashable, CustomStringConvertible {
|
|||
|
||||
public final let semanticContext: SemanticContext
|
||||
|
||||
public init(_ old: ATNConfig) {
|
||||
// dup
|
||||
self.state = old.state
|
||||
self.alt = old.alt
|
||||
self.context = old.context
|
||||
self.semanticContext = old.semanticContext
|
||||
self.reachesIntoOuterContext = old.reachesIntoOuterContext
|
||||
}
|
||||
|
||||
public convenience init(_ state: ATNState,
|
||||
_ alt: Int,
|
||||
_ context: PredictionContext?) {
|
||||
self.init(state, alt, context, SemanticContext.NONE)
|
||||
}
|
||||
|
||||
public init(_ state: ATNState,
|
||||
_ alt: Int,
|
||||
_ context: PredictionContext?,
|
||||
_ semanticContext: SemanticContext) {
|
||||
_ semanticContext: SemanticContext = SemanticContext.NONE) {
|
||||
self.state = state
|
||||
self.alt = alt
|
||||
self.context = context
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
public final class DFAState: Hashable, CustomStringConvertible {
|
||||
public internal(set) var stateNumber = -1
|
||||
|
||||
public internal(set) var configs = ATNConfigSet()
|
||||
public internal(set) var configs: ATNConfigSet
|
||||
|
||||
///
|
||||
/// `edges[symbol]` points to target of symbol. Shift up by 1 so (-1)
|
||||
|
@ -96,13 +96,6 @@ public final class DFAState: Hashable, CustomStringConvertible {
|
|||
}
|
||||
}
|
||||
|
||||
public init() {
|
||||
}
|
||||
|
||||
public init(_ stateNumber: Int) {
|
||||
self.stateNumber = stateNumber
|
||||
}
|
||||
|
||||
public init(_ configs: ATNConfigSet) {
|
||||
self.configs = configs
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue