Object subclass: #ConflictStrategy instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'T-gen-Conflict Strategies'! ConflictStrategy comment: 'ConflictStrategy implements the action that a translator generator performs when it detects a conflict. Subclasses must implement the following messages: resolving resolveReduceReduceFor: resolveShiftReduceFor: '! !ConflictStrategy methodsFor: 'resolving'! resolveReduceReduceFor: aTerm atState: currState self subclassResponsibility! resolveShiftReduceFor: aTransitSymbol atState: currState self subclassResponsibility! ! ConflictStrategy subclass: #ShiftingConflictStrategy instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'T-gen-Conflict Strategies'! ShiftingConflictStrategy comment: 'ShiftingConflictStrategy resolves shift/reduce conflicts by always shifting, this handles most ambiguities correctly.'! !ShiftingConflictStrategy methodsFor: 'resolving'! resolveReduceReduceFor: aTerm atState: currState ^OrderedCollection with: currState! resolveShiftReduceFor: aTransitSymbol atState: currState currState reduceMap removeKey: aTransitSymbol. ^OrderedCollection new.! ! ConflictStrategy subclass: #StandardConflictStrategy instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'T-gen-Conflict Strategies'! StandardConflictStrategy comment: 'StandardConflictStrategy implements the standard conflict resolution present in the original T-Gen (i.e., none)'! !StandardConflictStrategy methodsFor: 'resolving'! resolveReduceReduceFor: aTerm atState: currState ^OrderedCollection with: currState! resolveShiftReduceFor: aTransitSymbol atState: currState ^OrderedCollection with: currState! !