DGrok 0.6.5 released: fixed $IFNDEF
DGrok 0.6.5 is available. It’s a minor bugfix release, hence the half-version.
What’s new:
- FIX:
{$IFNDEF UnrecognizedSymbol}was ignoring its contents. That’s the right thing for{$IFDEF}but not for{$IFNDEF}. Fixed. - ENH: Allow attributes in package files.
- ENH: Add support for
{$INLINE}and{$STACKCHECKS}undocumented compiler directives.
Ordinarily I would have gotten more done in an evening. It’s all Sam’s fault for distracting me with his Erlang talk last night.
October 3rd, 2007 at 11:07 am
Do you have a description what these undocumented compiler directives do?
October 4th, 2007 at 12:54 am
Thanks! I’ve tested it with our code and found several things, for example:
{$IFOPT C+} "has not been defined as either true or false" (same for other compiler options like D-, R+, etc, etc.
DGrok demo.exe needs some way to specify search paths for *.inc files. Also maybe a checkbox to allow recursive folder search or not.
Delphi.Net packages allow attribute syntax using brackets, like:
[assembly: AssemblyTitle(’My assembly’)]
Grok error is "Expected EndKeyword but found OpenBracket"
Packages can also have options like:
{$SOPREFIX ‘abc’}
{$SOVERSION ‘123′}
String concat problem at this source code line:
writer.Write(imgStr+’SRC=\”+iGetFile+’?abc=’+fileRoot+’\’ ‘
error is: "Unrecognized character ‘?’"
regards, keep the good work!
October 4th, 2007 at 4:47 am
Ritsaert: Since they’re undocumented, I can’t be sure what they do. But I think I know what {$INLINE} does, since I was at the talk when Danny first demoed it. See http://www.excastle.com/blog/archive/2004/09/13/293.aspx
As I understand it, if you set {$INLINE OFF} on some code, then nothing will be inlined into that code. I.e., if you call Length(), the compiler will generate a CALL instruction, rather than inlining the instructions. {$INLINE ON} is, I believe, the default, which means "allow inlining to occur".
I’m not sure what {$STACKCHECKS} does. And the other undocumented compiler directive, {$VARPROPSETTER}, doesn’t seem to be documented much of anywhere. It’s some kind of COM thing, but that’s about all I know.
October 4th, 2007 at 5:09 am
David:
For the compiler options - that’s because you *haven’t* defined them as either true or false. There’s no GUI for that yet; you have to hack the source and call the methods on the CompilerDefines object to tell it what’s set. Sorry. There will be a GUI at some point.
Search paths for *.inc - You can always work around this by putting relative paths in your {$INCLUDE} directives. And given that {$INCLUDE}s *can* have relative paths, I’m not quite sure how a recursive search would work. ("Search recursively for ‘Common\Foo.inc’" — seems kind of weird. Might work; I haven’t tried.) But I probably will get this in at some point. Feel free to keep nagging me if I keep not getting it in and you keep thinking it’s important.
Assembly attributes: yes, I already support them, but only in the places where I’ve seen them show up: in the main body of .dpr files, and after the "requires" and "contains" clauses in .dpk files. I can add support for them in other places. Where do they show up in your code?
{$SOPREFIX} and {$SOVERSION} - ah, more undocumented directives. Looks like they’re just variations on {$LIBPREFIX} and {$LIBVERSION}. I’ll get those into the next version. Is there a {$SOSUFFIX} as well?
Re your code sample,
writer.Write(imgStr+’SRC=\”+iGetFile+’?abc=’+fileRoot+’\’ ‘
I get the same error from the Delphi compiler. "Illegal character in input file: ‘?’ (#$3F)" So if it’s not valid Delphi code, I’m not exactly sure what you want my parser to do with it!