Jump to page: 1 24  
Page
Thread overview
DScanner is ready for use
Jul 27, 2013
Brian Schott
Jul 28, 2013
Nick Sabalausky
Jul 28, 2013
qznc
Jul 28, 2013
Dicebot
Jul 28, 2013
Jacob Carlborg
Jul 28, 2013
Dicebot
Jul 28, 2013
Kagamin
Jul 28, 2013
Kagamin
Jul 28, 2013
Kagamin
Jul 28, 2013
Kagamin
Jul 28, 2013
Kagamin
Jul 28, 2013
Kagamin
Jul 28, 2013
dennis luehring
Jul 29, 2013
qznc
Jul 31, 2013
Rory McGuire
Jul 31, 2013
Justin Whear
Jul 31, 2013
Brian Schott
Aug 01, 2013
Rory McGuire
Aug 01, 2013
Dejan Lekic
Aug 02, 2013
Nick Sabalausky
Aug 02, 2013
Nick Sabalausky
Aug 02, 2013
Tofu Ninja
Aug 02, 2013
Brian Schott
Aug 02, 2013
Tofu Ninja
Aug 02, 2013
Brian Schott
Apr 23, 2014
bearophile
Apr 24, 2014
Brian Schott
Apr 24, 2014
bearophile
Apr 24, 2014
Brian Schott
Apr 24, 2014
Dicebot
Apr 24, 2014
bearophile
Apr 24, 2014
Jos van Uden
July 27, 2013
DScanner is a tool for analyzing D source code. It has the following features:

* Prints out a complete AST of a source file in XML format.
* Syntax checks code and prints warning/error messages
* Prints a listing of modules imported by a source file
* Syntax highlights code in HTML format
* Provides more meaningful "line of code" count than wc
* Counts tokens in a source file

The lexer/parser/AST are located in the "std/d" directory in the repository. These files should prove useful to anyone else working on D tooling.

https://github.com/Hackerpilot/Dscanner

Aside: the D grammar that I reverse-engineered can be located here: https://rawgithub.com/Hackerpilot/DGrammar/master/grammar.html
July 28, 2013
On Sun, 28 Jul 2013 00:27:34 +0200
"Brian Schott" <briancschott@gmail.com> wrote:

> DScanner is a tool for analyzing D source code. It has the following features:
> 
> * Prints out a complete AST of a source file in XML format.
> * Syntax checks code and prints warning/error messages
> * Prints a listing of modules imported by a source file
> * Syntax highlights code in HTML format
> * Provides more meaningful "line of code" count than wc
> * Counts tokens in a source file
> 
> The lexer/parser/AST are located in the "std/d" directory in the repository. These files should prove useful to anyone else working on D tooling.
> 
> https://github.com/Hackerpilot/Dscanner
> 
> Aside: the D grammar that I reverse-engineered can be located here: https://rawgithub.com/Hackerpilot/DGrammar/master/grammar.html

Sweet, I was *just* thinking about writing a D -> HTML syntax highlighter no more than about five minutes ago. Glad to see I won't have to :) I'll definitely be checking this out.
July 28, 2013
On Saturday, 27 July 2013 at 22:27:35 UTC, Brian Schott wrote:
> DScanner is a tool for analyzing D source code. It has the following features:
>
> * Prints out a complete AST of a source file in XML format.
> * Syntax checks code and prints warning/error messages
> * Prints a listing of modules imported by a source file
> * Syntax highlights code in HTML format
> * Provides more meaningful "line of code" count than wc
> * Counts tokens in a source file
>
> The lexer/parser/AST are located in the "std/d" directory in the repository. These files should prove useful to anyone else working on D tooling.
>
> https://github.com/Hackerpilot/Dscanner
>
> Aside: the D grammar that I reverse-engineered can be located here: https://rawgithub.com/Hackerpilot/DGrammar/master/grammar.html

Great! :)

I do not understand the LoC count, though. The description sounds like "Number of Statements"?
July 28, 2013
On Saturday, 27 July 2013 at 22:27:35 UTC, Brian Schott wrote:
> DScanner is a tool for analyzing D source code. It has the following features:
>
> * Prints out a complete AST of a source file in XML format.
> * Syntax checks code and prints warning/error messages
> * Prints a listing of modules imported by a source file
> * Syntax highlights code in HTML format
> * Provides more meaningful "line of code" count than wc
> * Counts tokens in a source file
>
> The lexer/parser/AST are located in the "std/d" directory in the repository. These files should prove useful to anyone else working on D tooling.
>
> https://github.com/Hackerpilot/Dscanner
>
> Aside: the D grammar that I reverse-engineered can be located here: https://rawgithub.com/Hackerpilot/DGrammar/master/grammar.html

Awesome! I hope it won't be forgotten by the time I need it :)

By the way, how far is that "std.d.*" stuff from ongoing Phobos inclusion review?

I suppose currently it does not do any semantical analysis? How hard it would be to implement dmd warnings on top of dscanner instead?
July 28, 2013
On Sunday, 28 July 2013 at 12:49:34 UTC, Dicebot wrote:

> Awesome! I hope it won't be forgotten by the time I need it :)
>
> By the way, how far is that "std.d.*" stuff from ongoing Phobos inclusion review?
>
> I suppose currently it does not do any semantical analysis? How hard it would be to implement dmd warnings on top of dscanner instead?

I don't think it's necessary for semantic analysis to be included in Phobos. It's enough to start with a lexer, then later add a parser and semantic analysis.

--
/Jacob Carlborg
July 28, 2013
On Saturday, 27 July 2013 at 22:27:35 UTC, Brian Schott wrote:
> Aside: the D grammar that I reverse-engineered can be located here: https://rawgithub.com/Hackerpilot/DGrammar/master/grammar.html

Does arrayLiteral support stray comma?
July 28, 2013
Also looks like enumBody supports multiple commas with nothing between them, but dmd doesn't support it. Sould be
'{' enumMember (',' enumMember)* ','? '}'
July 28, 2013
And arrayLiteral should be
'[' (assignExpression (',' assignExpression)* ','?)? ']'
July 28, 2013
The same for arrayInitializer:
'[' (arrayMemberInitialization (',' arrayMemberInitialization)* ','?)? ']'
July 28, 2013
Like typedef alias supports multiple declarators.
aliasDeclaration:
'alias' (aliasInitializer (',' aliasInitializer)* | type declarator (',' declarator)*) ';'

Also declarator supports initializer, but alias doesn't.
declarator:
    Identifier ('=' initializer)?
    ;

alias int a=1;
Error: alias cannot have initializer
« First   ‹ Prev
1 2 3 4