I basically have a parser ready to parse text input. However another representation of the source is binary - although with the exact same AST structure. It seems that adding those two methods allow me to treat ByteArray as byte sequences and Integers as bytes:
ByteArray>>#asPParser
^ PP2LiteralSequenceNode on: self
Integer>>#asPParser
^ PP2LiteralObjectNode on: self
Thinking about it doing something like
SequencableCollection>>#asPParser
^ PP2LiteralSequenceNode on: self
would even allow parsing "numeric collection" in general ...
Is this the way to go?
I basically have a parser ready to parse text input. However another representation of the source is binary - although with the exact same AST structure. It seems that adding those two methods allow me to treat
ByteArrayas byte sequences andIntegersas bytes:Thinking about it doing something like
would even allow parsing "numeric collection" in general ...
Is this the way to go?