<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Bit fields are already done in D using a library solution:<br>
<br>
<a class="moz-txt-link-freetext" href="http://d.digitalmars.com/2.0/phobos/std_bitmanip.html">http://d.digitalmars.com/2.0/phobos/std_bitmanip.html</a><br>
<br>
On 1/8/2012 7:49 AM, Sandeep Datta wrote:
<blockquote
cite="mid:CABMMkDPKnguz2qW5aGH8Re9M2+OkvA_fjPo1_QrBth4edUWK_g@mail.gmail.com"
type="cite">
<div>[Cross post from the D news group]</div>
<div><br>
</div>
<div>Hi All,</div>
<div><br>
</div>
<div>To gain a better understanding of how the D compiler works I
am</div>
<div>trying to implement support for bit fields in structures. I
have</div>
<div>modified the parser code to admit the following syntax (for
now)...</div>
<div><br>
</div>
<div>struct A{</div>
<div> uint:8 a;</div>
<div> uint:5 b;</div>
<div> uint:* unused; //Takes up the remaining space.</div>
<div> //Raise an error when the computed size is zero.</div>
<div>}</div>
<div><br>
</div>
<div>You can see my changes here...<a moz-do-not-send="true"
href="https://github.com/SDX2000/dmd" target="_blank">https://github.com/SDX2000/dmd</a></div>
<div><br>
</div>
<div>I have been trying to work out a strategy for modifying the
compiler</div>
<div>code generation for quite some time now but haven't been able
to</div>
<div>make much headway in this direction.</div>
<div><br>
</div>
<div>
I would appreciate any help at this point.</div>
<div><br>
</div>
<div>Regards,</div>
<div>Sandeep Datta.</div>
<div><br>
</div>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
dmd-internals mailing list
<a class="moz-txt-link-abbreviated" href="mailto:dmd-internals@puremagic.com">dmd-internals@puremagic.com</a>
<a class="moz-txt-link-freetext" href="http://lists.puremagic.com/mailman/listinfo/dmd-internals">http://lists.puremagic.com/mailman/listinfo/dmd-internals</a></pre>
</blockquote>
</body>
</html>