misc: Attempt to fix/improve the fileout of the code
This code is using classPragmas to initialize various GSM attributes, for file-out we need to tell the system which classPragmas to use and this is what the code attempts to do. There is a bug that prevents to file-out the <gsmMinValueSize: max:> pragma but we will get there.
This commit is contained in:
parent
129f45c879
commit
4a51f03659
64
GSM48.st
64
GSM48.st
|
@ -48,6 +48,26 @@ IEBase subclass: GSM48IE [
|
|||
<category: 'parsing'>
|
||||
^ gsmIeMask ifNil: [16rFF]
|
||||
]
|
||||
|
||||
gsmName [
|
||||
<category: 'gsm-pragma'>
|
||||
^gsmName
|
||||
]
|
||||
|
||||
gsmElementId [
|
||||
<category: 'gsm-pragma'>
|
||||
^gsmElementId
|
||||
]
|
||||
|
||||
gsmIeMask [
|
||||
<category: 'gsm-pragma'>
|
||||
^gsmIeMask
|
||||
]
|
||||
|
||||
classPragmas [
|
||||
<category: 'gsm-pragma'>
|
||||
^super classPragmas, #(#gsmName #gsmElementId #gsmIeMask)
|
||||
]
|
||||
]
|
||||
|
||||
GSM48IE class >> elementId [
|
||||
|
@ -75,6 +95,16 @@ GSM48IE subclass: GSM48FixedSizeIE [
|
|||
gsmValueLength := aLength
|
||||
]
|
||||
|
||||
gsmValueLength [
|
||||
<category: 'gsm-pragma'>
|
||||
^gsmValueLength
|
||||
]
|
||||
|
||||
classPragmas [
|
||||
<category: 'gsm-pragma'>
|
||||
^super classPragmas, #(#gsmValueLength)
|
||||
]
|
||||
|
||||
length: aStream [
|
||||
<category: 'parsing'>
|
||||
^ self gsmValueLength
|
||||
|
@ -123,6 +153,40 @@ GSM48IE subclass: GSM48VariableSizedIE [
|
|||
gsmValueRange := aMin to: aMax.
|
||||
]
|
||||
|
||||
gsmValueSizeMin [
|
||||
<category: 'gsm-pragma'>
|
||||
^gsmValueRange first
|
||||
]
|
||||
|
||||
gsmValueSizeMax [
|
||||
<category: 'gsm-pragma'>
|
||||
^gsmValueRange last
|
||||
]
|
||||
|
||||
gsmValueSizeMin: aMin [
|
||||
| last |
|
||||
<category: 'gsm-pragma'>
|
||||
last := gsmValueRange isNil
|
||||
ifTrue: [aMin]
|
||||
ifFalse: [gsmValueRange last].
|
||||
gsmValueRange := aMin to: last.
|
||||
]
|
||||
|
||||
gsmValueSizeMax: aMax [
|
||||
| first |
|
||||
<category: 'gsm-pragma'>
|
||||
first := gsmValueRange isNil
|
||||
ifTrue: [aMax]
|
||||
ifFalse: [gsmValueRange first].
|
||||
gsmValueRange := first to: aMax.
|
||||
]
|
||||
|
||||
classPragmas [
|
||||
<category: 'gsm-pragma'>
|
||||
"The gsmMinValueSize:max: can not be expressed right now."
|
||||
^super classPragmas, #(#gsmValueSizeMin #gsmValueSizeMax).
|
||||
]
|
||||
|
||||
validSizes [
|
||||
<category: 'parsing'>
|
||||
"Default size"
|
||||
|
|
Reference in New Issue