Re: String concatenation design
- From: "Anton Treuenfels" <atreuenfels@xxxxxxxxxxxxx>
- Date: Wed, 29 Mar 2006 04:53:40 GMT
"Risto Lankinen" <rlankine@xxxxxxxxxxx> wrote in message
news:KB4Wf.25028$Nb2.456997@xxxxxxxxxxxxxxxxxx
allow
"Anton Treuenfels" <atreuenfels@xxxxxxxxxxxxx> wrote in message
news:lw3Wf.310$i41.119@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Now I am considering how best to add string concatenation. The problem
isn't
so much how to actually concatenate strings (that's easy) but how to
the operation to be expressed.
[...]
2) use no operator. Imply concatenation by adjacent strings. "A" "B" ->
"AB"
3) pick a currently unused symbol (or one that only appears in some
non-conflicting context) to use as the concatenation operator. But what
might be a good, easily remembered choice? "&", maybe?
Do you allow string variables? If all strings are literals, then I would
choose option 2) [which begs a question: why is concatenation needed
anyway]. If you do allow string variables then I would choose option
3) and use the ampersand "&" for concatenation.
Presently all strings are literals but not necessarily constants :) The
expression analyzer is part of a macro assembler and macro argument
substitution can change the value of a string literal during macro expansion
(I get to write the rules, so I permit this!).
In assembly languages opcode argument expressions sometimes contain, for
example, address mode information as well as numeric. I want to be able to
massage such expressions before passing them to the analyzer, rather than
tying the analyzer to one particular assembly language. More particularly I
want to be able to provide that facility at the user level as part of an
effort to make the assembler more customizable.
But obviously string variables are a reasonable extension.
.
- References:
- String concatenation design
- From: Anton Treuenfels
- Re: String concatenation design
- From: Risto Lankinen
- String concatenation design
- Prev by Date: Re: Patricia Tree
- Next by Date: Re: Cannot understand the following codes
- Previous by thread: Re: String concatenation design
- Next by thread: Re: String concatenation design
- Index(es):
Relevant Pages
|