Skip to content

Commit

Permalink
add trace generation
Browse files Browse the repository at this point in the history
  • Loading branch information
tomooda committed May 20, 2024
1 parent 9cac14b commit 398803b
Show file tree
Hide file tree
Showing 16 changed files with 150 additions and 205 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ ViennaTraceRepeatOptionalPatternNode >> label [
^ 'TraceRepeatOptionalPattern'
]

{ #category : 'enumerating' }
ViennaTraceRepeatOptionalPatternNode >> numbersDo: aBlock [
{ #category : 'accessing' }
ViennaTraceRepeatOptionalPatternNode >> range [

aBlock
value: 0;
value: 1
^ 0 to: 1
]
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ ViennaTraceRepeatPatternNode >> maximalType [
^ ViennaType unit
]

{ #category : 'enumerating' }
ViennaTraceRepeatPatternNode >> numbersDo: aBlock [
{ #category : 'accessing' }
ViennaTraceRepeatPatternNode >> range [

^ self subclassResponsibility
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ ViennaTraceRepeatPlusPatternNode >> label [
^ 'TraceRepeatPlusPattern'
]

{ #category : 'enumerating' }
ViennaTraceRepeatPlusPatternNode >> numbersDo: aBlock [
{ #category : 'accessing' }
ViennaTraceRepeatPlusPatternNode >> range [

1 to: self timesUpperbound do: aBlock
^ 1 to: self timesUpperbound
]
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,13 @@ ViennaTraceRepeatRangePatternNode >> label [
^ 'TraceRepeatRangePattern'
]

{ #category : 'enumerating' }
ViennaTraceRepeatRangePatternNode >> numbersDo: aBlock [

self size = 1
ifTrue: [ aBlock value: self times1 ]
ifFalse: [
(self times1 min: self times2) to: (self times1 max: self times2)
do: aBlock ]
{ #category : 'accessing' }
ViennaTraceRepeatRangePatternNode >> range [

^ self size = 1
ifTrue: [ { self times1 } ]
ifFalse: [
(self times1 min: self times2) to: (self times1 max: self times2) ]
]

{ #category : 'accessing' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ ViennaTraceRepeatStarPatternNode >> label [
^ 'TraceRepeatStarPattern'
]

{ #category : 'enumerating' }
ViennaTraceRepeatStarPatternNode >> numbersDo: aBlock [
{ #category : 'accessing' }
ViennaTraceRepeatStarPatternNode >> range [

0 to: self timesUpperbound do: aBlock
^ 0 to: self timesUpperbound
]
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ ViennaLauncher class >> worldMenuOn: aBuilder [
action: [ self showSettingBrowser ];
order: 0.0;
help: 'open the preferences on ViennaTalk';
iconName: #smallConfigurationIcon;
iconName: #smallConfiguration;
withSeparatorAfter ]
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Class {
}

{ #category : 'instance creation' }
ViennaBindCombinatorialGenerator class >> withAll: aCollection bindBlock: aBlock [
ViennaBindCombinatorialGenerator class >> collection: aCollection bindBlock: aBlock [

^ self new
set: aCollection;
Expand Down Expand Up @@ -85,7 +85,7 @@ ViennaBindCombinatorialGenerator >> stepBind: aDictionary [

[ bindStream atEnd ] whileTrue: [
valueStream atEnd ifTrue: [ ^ false ].
bindStream := (bindBlock value: aDictionary value: valueStream next)
bindStream := (bindBlock value: valueStream next)
readStream ].
isBindReady := true.
^ true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Class {
#package : 'ViennaTalk-Transpiler-Core'
}

{ #category : 'instance creation' }
{ #category : 'as yet unclassified' }
ViennaBlockCombinatorialGenerator class >> on: aBlock [

^ self new
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ ViennaLetBestCombinatorialGenerator >> reset [
{ #category : 'operations' }
ViennaLetBestCombinatorialGenerator >> step: aDictionary [

isDone ifTrue: [ ^ self ].
isDone ifTrue: [ ^ false ].
isBindReady ifFalse: [
[ self valueGuard: aDictionary ] whileFalse: [
(self stepBind: aDictionary) ifFalse: [ ^ nil ] ].
(self stepBind: aDictionary) ifFalse: [ ^ false ] ].
isBindReady := true ].
(subgenerator step: aDictionary copy) ifTrue: [
isBindReady := true.
Expand Down Expand Up @@ -123,6 +123,7 @@ ViennaLetBestCombinatorialGenerator >> subgenerator: aVIennaCombinatorialGenerat
ViennaLetBestCombinatorialGenerator >> value: aDictionary [

| env |
isDone ifTrue: [ ^ nil ].
isBindReady ifFalse: [
[ self valueGuard: aDictionary ] whileFalse: [
(self stepBind: aDictionary) ifFalse: [ ^ nil ] ].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,7 @@ Class {
}

{ #category : 'instance creation' }
ViennaLetDefCombinatorialGenerator class >> on: aBlock [

^ self new
block: aBlock;
yourself
]

{ #category : 'instance creation' }
ViennaLetDefCombinatorialGenerator class >> on: aBlock in: aViennaCombinatorialGenerator [
ViennaLetDefCombinatorialGenerator class >> bindBlock: aBlock in: aViennaCombinatorialGenerator [

^ self new
block: aBlock;
Expand Down
Loading

0 comments on commit 398803b

Please sign in to comment.