From: Stefan S. <sse...@ar...> - 2004-09-27 13:10:56
|
Hi there, I'm working on a constant expression analyzer to assist the C++ parser. It's working nicely so far. Here is what it already can deal with: http://synopsis.fresco.org/viewsvn/synopsis-Synopsis/trunk/tests/OpenCxx/Con stEvaluator/ However, some cases are not as simple, and so I'd appreciate feedback: the 'sizeof' operator can be used in const expressions, and so I have to deal with it. AFAIK each compiler has its own memory layout, and thus there's no standard algorithm to determine the size of an arbitrary type. On the other hand, there is no requirement for Synopsis / OpenC++ to be binary compatible with any other compiler, so may be this is a non-issue. Still, I need to provide some numbers when asked for the size of an object. Any ideas how to approach this ? Any references are highly appreciated ! Regards, Stefan |