DGrok 0.6 released: enter Visitor
DGrok 0.6 is now available for download.
New in this version:
- All documented compiler directives are supported (plus one undocumented one,
{$VARSTRINGCHECKS}) - Added support for hard casts to the
filekeyword, e.g.,file(AUntypedVarParameter) - Changed PointerType to allow any type, not just QualifiedIdent. This allows things like
^string. - Fixed runtime cast error when a program or unit has a
begin…endblock orasmblock for its initialization section. For simplicity’s sake, all init sections are now represented by InitSectionNode. - Ignore .dproj files when you search for *.dpr.
- Ignore
{$DEFINE}and{$UNDEF}when they occur inside a false{$IF...}block. Oops. - Ignore unrecognized compiler directives if they’re inside a false
{$IF...}block. This lets me ignore, say, FreePascal compiler directives (since they usually occur inside{$IFDEF FPC}blocks). - Allow dotted names for packages (in the “
Package Name” line). - Contains clauses now support “
in filename” specifiers. (Actually, contains clauses are now handled by the same rule as uses clauses.) - Added support for
[assembly: Attribute(...)]syntax. Yes, mostly I’ve been focusing on parsing Win32, but I have some need to deal with .NET code as well. - Changed it so that not-yet-defined symbols are treated as false by
{$IFDEF}rather than explicitly raising an error. The error served its purpose earlier, but I reached the pain point and shut it off. - Added a Visitor class.
Whew. Not bad for one evening’s work.
I think Visitor will really be the way you put the parser to work. I was hoping to get some examples into today’s build, but I ran out of time. Play around if you like.
October 2nd, 2007 at 4:36 pm
> Not bad for one evening’s work.
Yeah, I’d say not…!
I haven’t downloaded this, I’ve just been reading your posts as you add features. What’s the intended purpose for this? Are you planning an IDE plugin that handles Delphi source, a compiler, …?