Skip to content

Commit

Permalink
fix node creation signal bug created by previous optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
j-brant committed Sep 26, 2024
1 parent 487357c commit c3c5d4e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/SmaCC_Development/SmaCCRHS.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ SmaCCRHS >> firstTerminals [
SmaCCRHS >> generateNamedVariableCollectionWarningFor: problemIndex [
SmaCCCompilationNotification new
messageText: 'Node creation';
tag: [ String
tagBlock: [ String
streamContents: [ :stream |
stream
nextPutAll: 'Non terminal symbol that returns a variable collection is assigned to a variable. The non terminal should be changed to return an AST node:';
Expand Down
25 changes: 25 additions & 0 deletions src/SmaCC_Runtime/SmaCCParser.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,31 @@ SmaCCParser >> shiftAction [
^ 2r01
]

{ #category : #accessing }
SmaCCParser >> shortestPathsFrom: startingState [
| paths todo currentState nextState |
paths := Dictionary new.
paths at: startingState put: OrderedCollection new.
todo := OrderedCollection with: startingState.
[ todo notEmpty ]
whileTrue: [ currentState := todo removeFirst.
1
to: self symbolNames size
do: [ :i |
(self actionsForState: currentState and: i)
do: [ :action |
(action bitAnd: 2r11) = self shiftAction
ifTrue: [ nextState := action bitShift: -2.
(paths includesKey: nextState)
ifFalse: [ todo add: nextState.
paths
at: nextState
put: ((paths at: currentState) copy
add: i;
yourself) ] ] ] ] ].
^ paths
]

{ #category : #parsing }
SmaCCParser >> spawnParser: aGLRParserClass [
^ self
Expand Down

0 comments on commit c3c5d4e

Please sign in to comment.