DESCIPTION

Format production from Parse::QTEDI into more binding-make-specific look. This will both strip unrelevant entry and renew the structure of other interested entries.

NOTE: All new hash keys inserted here will be uppercase to differentiate with QTEDI output, except meta field such as 'subtype'.

ELEMENTS

Format functions.

$FUNCTION_PROPERTIES

Keep all known C++ function and QT-specific property keywords.

Function format will firstly filter out them from prototype line.

NOTE: Some properties are stored inside 'PROPERTY' field array for futher reference.

NOTE: Q_DECL_EXPORT == __attribute((visibility(default)))__ in gcc.

__format_macro

Keep Q_OBJECT and Q_PROPERTY for further consideration.

Each property field inside a Q_PROPERTY will be stored as a new key/value pair.

# spec of Q_PROPERTY

---
name : [from_QTEDI]
type : macro
NAME : [name]
TYPE : [type]
READ : [read function]
WRITE: [write function]
...
__format_class

Extract class name string and store as new field. Recursively process class body, strip private part.

Format inheritance line if has.

# spec 

---
type     : class
PROPERTY : 
   - [class property1]
   ...
NAME     : [name]
ISA      : 
   - NAME         : [parent class name]
     RELATIONSHIP : public/private/protected
   ...
BODY     : 
   ...
VARIABLE : 
   - [variable1]
   ...
__format_struct

Similar as __format_class.

NOTE: As defined in C++, top entries not covered by any public/private/protected keyword will be treated private.

See __format_class above regarding output spec.

__format_struct

Similar as __format_struct.

See __format_class above regarding output spec.

__format_function

Format a function entry. Extract return type, function name and all parameters from function prototype line from QTEDI.

# spec 

---
type      : function
subtype   : 1/0 [is operator or not]
PROPERTY  : 
   - [function property1]
   ...
NAME      : [name]
RETURN    : [return type]
PARAMETER : 
   - TYPE          : [param1 type]
                     [NOTE: could be '...' in ansi]
     NAME          : [param1 name]
     DEFAULT_VALUE : [param1 default value]
   ...
__format_enum

Format enum, normalize name, property and enum value entries.

# spec 

---
type     : enum
NAME     : [name]
PROPERTY : 
   - [enum property1]
   ...
VALUE    : 
   - [enum value1]
   ...
VARIABLE : 
   - [variable1]
   ...
__format_accessibility

Format accessibility, normalize value entries.

NOTE: private type should not appear here since being stripped.

# spec 

---
type     : accessibility
VALUE    : 
   - [accessibility keyword1]
   ...
__format_typedef

Format typedef, normalize value entry.

Value entry could be of type:

1. typedef simple type C<< typedef A B; >>
2. typedef (anonymous) class/struct/enum/union C<< typdef enum A { } B; >> 
3. typedef function pointer C<< typedef void (*P)(int, uint); >>

# spec 

---
type    : typedef
subtype : 1/2/3
FROM    : [from type name]
TO      : [to type name]
EXTRA   : [subtype 2, formatted class/struct/enum/union entry   ] 
          [subtype 3, raw typedef line without leading 'typedef']
__format_extern

Format extern type body.

# spec 

---
type    : extern
subtype : C/function/expression/class/struct/union/enum
BODY    : 
   ...

NOTE: For subtype C, there will be more than one entry in BODY field array. For others, just one.

__format_namespace

Format namespace code block. Normalize name and recursively format body entries.

# spec 

---
type     : namespace
NAME     : [namespace name]
PROPERTY : 
   - [property1]
   ...
BODY     : 
   ...
__format_expression

Format expression.

# spec 

---
type  : expression
value : [expression line]

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 http://dev.perl.org/licenses/artistic.html