=pod

=head1 NAME

Parse::QTEDI - Parse QT/KDE preprocessed headers

=head1 SYNOPSIS

  use Parse::QTEDI qw($parser);
  defined $parser->begin($in) or warn "parse failed";

=head1 COMMANDLINE USAGE

  $cp header.h header.h.bak                                 # backup
  $sed -i -e 's/#include/ d' -e 's/#error/ d' header.h      # strip
  $gcc -E -imacros config.h -DBLAH_BLAH header.h > header.i # pre-process
  $parse_qtedi_header header.i                              # parse

=head1 DESCRIPTION

Parse QT/KDE preprocessed headers to generate interface information.

=head1 WHAT IS INPUT

input stream should be the output of a preprocessor like `gcc -E
-DBLAH_BLAH'.  

B<NOTE>: Normally one should strip #include and #error directives
before invoking preprocessor, or else preprocessor will expand all
include directives encountered and croak on error progma.

=head1 WHAT IS OUTPUT

YAML-ish output to STDOUT; 
debug info to STDERR if $DEBUG defined.

=head1 WHY IS PREPROCESSED

To solve macro, basically. There are both arch-specific and
feature-specific macros. One should decide which feature-specific ones
to enable. Besides, modern libtool normally records compile-time
commandline options for later reference. 

=head1 HOW TO DEBUG

Defining $Parse::QTEDI::DEBUG to true will enable parse-level debug
information to STDERR.

B<NOTE>: set at the BEGIN section of your code before using this
module. 

=head1 WHAT ABOUT THE NAME

QTEDI is QT and QT-basEd Desktop environment Interface ;-)

=head1 EXPORT

An instance of Parse::RecDescent on demand

=head1 BUG AND TODO

1. handle of __attribute__ pragma in expression

=head1 SEE ALSO

output spec and other dev info
L<http://dongxu.googlecode.com/wiki/QTEDI> 

svn repos L<http://dongxu.googlecode.com/svn/trunk/Parse-QTEDI/> 

Also check my Perl QT4 binding project page 
L<http://code.google.com/p/dongxu/wiki/PerlQT> 

=head1 AUTHOR

Dongxu Ma, E<lt>dongxu.ma@gmail.comE<gt>

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2007 by Dongxu Ma <dongxu@cpan.org>

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.

See L<http://dev.perl.org/licenses/artistic.html>

=cut