Compiling DMD parser?
Markus Koskimies
markus at reaaliaika.net
Tue Jul 15 13:40:21 PDT 2008
On Tue, 15 Jul 2008 08:44:25 +0000, Markus Koskimies wrote:
> I'll put the full sources available somewhere (to my home pages, at
> least), and continue developing walking & warning thing.
Sources are available:
http://reaaliaika.net/showarea.php/download/dwalk
dwalk.tar.ge opens to directory named dwalk. dwalk/dparser should contain
link to DParser sources (you may also upload them to dwalk/ directory
with svn etc).
Package contains:
- Sources: dwalk/src/
- Test files: dwalk/testfiles
About sources: You probably first take a look to main.d. Then you may
want to look at the scanners (ScanXXXModule.d). Finally, you might want
to take a look at the ASTWalk (ASTWalking.d).
If you get the thing compiled, you should have executable named dwalk,
which can:
- Detect unused things; there may still be some false reporting, as well
as it can surely undetect some unused things. imports are not checked at
all. Nor templates (or they may be, if they go with the defaults).
- Detect expression result discarding, i.e. unused return values. There
are some pecularities with "void main(...)" functions, which cause false
alarms.
- Detect constant conditions, in for/while/do and if/switch; take a look
at the testfiles/TestInfLoop1.d for seeing, which kind of infinite or
dead loops are scanned.
Any reports, comments & suggestions are welcome :D
More information about the Digitalmars-d
mailing list