D - How to resolve "cch" ambiguity
- Russ Lewis (8/8) Apr 11 2002 When lexically parsing D, how do you decide if the string "cch" is an
- Russ Lewis (8/8) Apr 11 2002 We might want to debate whether "hex suffix" even makes sense. Frankly,
- Walter (3/6) Apr 11 2002 'cch' is an identifier. '0cch' would be a hex value.
- Russ Lewis (12/18) Apr 11 2002 But it doesn't have to start with 0, right? I was looking at math2.d li...
- Russell Borogove (6/25) Apr 11 2002 I think it has to start with a digit for the parser's
- Pavel Minayev (7/10) Apr 11 2002 It seems so. By the way, it is exactly how assemblers with Intel
- Walter (4/14) Apr 11 2002 Yes.
When lexically parsing D, how do you decide if the string "cch" is an identifer (possible type, function, or variable name) or the hex value 0xcc? -- The Villagers are Online! villagersonline.com .[ (the fox.(quick,brown)) jumped.over(the dog.lazy) ] .[ (a version.of(English).(precise.more)) is(possible) ] ?[ you want.to(help(develop(it))) ]
Apr 11 2002
We might want to debate whether "hex suffix" even makes sense. Frankly, I've found hex suffixes make it really hard to tell (at a glance) that the thing is a number and not an obscure variable name. -- The Villagers are Online! villagersonline.com .[ (the fox.(quick,brown)) jumped.over(the dog.lazy) ] .[ (a version.of(English).(precise.more)) is(possible) ] ?[ you want.to(help(develop(it))) ]
Apr 11 2002
"Russ Lewis" <spamhole-2001-07-16 deming-os.org> wrote in message news:3CB626D5.A9829740 deming-os.org...When lexically parsing D, how do you decide if the string "cch" is an identifer (possible type, function, or variable name) or the hex value 0xcc?'cch' is an identifier. '0cch' would be a hex value.
Apr 11 2002
Walter wrote:"Russ Lewis" <spamhole-2001-07-16 deming-os.org> wrote in message news:3CB626D5.A9829740 deming-os.org...But it doesn't have to start with 0, right? I was looking at math2.d line 1299 (still from version 0.25, iirc), and it has the constant 1A2h which I understood to mean 0x1A2 right? -- The Villagers are Online! http://villagersonline.com .[ (the fox.(quick,brown)) jumped.over(the dog.lazy) ] .[ (a version.of(English).(precise.more)) is(possible) ] ?[ you want.to(help(develop(it))) ]When lexically parsing D, how do you decide if the string "cch" is an identifer (possible type, function, or variable name) or the hex value 0xcc?'cch' is an identifier. '0cch' would be a hex value.
Apr 11 2002
Russ Lewis wrote:Walter wrote:I think it has to start with a digit for the parser's benefit; the leading zero is only necessary if the hex representation leads with an alpha character. Though what was wrong with good old 0xCC, I don't know. --the other other Russell"Russ Lewis" <spamhole-2001-07-16 deming-os.org> wrote in message news:3CB626D5.A9829740 deming-os.org...But it doesn't have to start with 0, right? I was looking at math2.d line 1299 (still from version 0.25, iirc), and it has the constant 1A2h which I understood to mean 0x1A2 right?When lexically parsing D, how do you decide if the string "cch" is an identifer (possible type, function, or variable name) or the hex value 0xcc?'cch' is an identifier. '0cch' would be a hex value.
Apr 11 2002
"Russell Borogove" <kaleja estarcion.com> wrote in message news:3CB64AC1.8010402 estarcion.com...I think it has to start with a digit for the parser's benefit; the leading zero is only necessary if the hex representation leads with an alpha character.It seems so. By the way, it is exactly how assemblers with Intel syntax parse hex numbers: 1000h - correct A000h - invalid 0A000h - correct
Apr 11 2002
"Pavel Minayev" <evilone omen.ru> wrote in message news:a95mdc$7ak$1 digitaldaemon.com..."Russell Borogove" <kaleja estarcion.com> wrote in message news:3CB64AC1.8010402 estarcion.com...Yes.I think it has to start with a digit for the parser's benefit; the leading zero is only necessary if the hex representation leads with an alpha character.It seems so. By the way, it is exactly how assemblers with Intel syntax parse hex numbers: 1000h - correct A000h - invalid 0A000h - correctThat's why it's in there <g>.
Apr 11 2002