[fpc-devel] Extended($FFFFFFFFFFFFFFFF) = -1?

Ewald ewald at yellowcouch.org
Tue Mar 4 13:08:47 CET 2014

On 03 Mar 2014, at 21:44, Hans-Peter Diettrich wrote:

> Ewald schrieb:
>> On 03 Mar 2014, at 12:49, Hans-Peter Diettrich wrote:
>>> How (which data type) does *your* parser store untyped numerical
>>> constants?
>> Roughly like this (syntax may be a bit awry, but you get the point):
>> TIntegerNumber = Record Case SignedNess: TSignedNess of snPositive:
>> UValue: QWord; snNegative:  SValue: Int64; End;
>> The parser detects wether there is a `-` in front of the constant and
>> stores the right sign in the SignedNess field.
> A parser doesn't work like that - too many possible cases with unary minus.

Perhaps yours doesn't, I didn't say what kind of syntax `my parser` parses... Quite frankly I don't care how my parser, your parser or fpc's parser work in detail, as long as something gets parsed. Hey, that's the purpose of a parser after all ;-)

> If you need an datatype for integers with more bits than provided by the compiler, you must roll your own datatype.

Of coure. But nobody stipulated that I can't use native pascal types (like qword, int64, byte, ...) for storing this.


More information about the fpc-devel mailing list