\s*[{;]\s*$/xs ) {
print "Typedef: <$1 $3> <$2>\n" if $debug;
- $newNode = newTypedef( $1.$3, $2 );
+ $newNode = newTypedef( $1, $3, $2 );
}
# Enum
print "Var: [$name] type: [$type$arr] val: [$val]\n"
if $debug;
- $newNode = newVar( $type.$arr, $name, $val );
+ $newNode = newVar( $type, $arr, $name, $val );
$skipBlock = 1 if $end eq '{';
print "Split: type: [$type$ptr$arr] ",
" name: [$name] val: [$val] \n" if $debug;
- my $node = newVar( $type.$ptr.$arr, $name, $val );
+ my $node = newVar( $type.$ptr, $arr, $name, $val );
$docNode = $doc; # reuse docNode for each
postInitNode( $node ) unless !defined $node;
=head2 newTypedef
- Parameters: realtype, name
+ Parameters: realtype, array specification, name
Handles a type definition.
sub newTypedef
{
- my ( $realtype, $name ) = @_;
+ my ( $realtype, $array, $name ) = @_;
my ( $node ) = Ast::New( $name );
$node->AddProp( "NodeType", "typedef" );
$node->AddProp( "Type", $realtype );
+ $node->AddProp( "Array", $array );
kdocAstUtil::attachChild( $cNode, $node );
=head2 newVar
- Parameters: type, name, value
+ Parameters: type, array, name, value
New variable. Value is ignored if undef
sub newVar
{
- my ( $type, $name, $val ) = @_;
+ my ( $type, $array, $name, $val ) = @_;
my $node = Ast::New( $name );
$node->AddProp( "NodeType", "var" );
$node->AddProp( "Type", $type );
$node->AddProp( "Flags", 's' ) if $static;
$node->AddProp( "Value", $val ) if defined $val;
+ $node->AddProp( "Array", $array);
kdocAstUtil::attachChild( $cNode, $node );
return $node;
my $pname = tblk( "Emphasis", $name );
if( $type eq "var" ) {
- print DOC tblk( "Literal", esc($m->{Type}) ), " $pname\n";
+ print DOC tblk( "Literal", esc($m->{Type}) ), " $pname",
+ tblk( "Literal", esc($m->{Array}) ), "\n";
}
elsif( $type eq "method" ) {
my $flags = $m->{Flags};
}
elsif( $type eq "typedef" ) {
print DOC tblk( "Literal", "typedef " ), esc($m->{Type}),
- tblk( "Emphasis", $name );
+ tblk( "Emphasis", $name ),
+ esc($m->{Array});
}
else {
# unknown type
my $pname = tblk( "Emphasis", $name );
if( $type eq "var" ) {
- print DOC tblk( "Literal", esc($mem->{Type}) ), " $pname\n";
+ print DOC tblk( "Literal", esc($mem->{Type}) ), " $pname",
+ tblk( "Literal", esc($mem->{Array}) ), "\n";
}
elsif( $type eq "method" ) {
my $flags = $mem->{Flags};
" $n\{ ",tblk("Literal",esc($mem->{Params}))," }";
}
elsif( $type eq "typedef" ) {
- print DOC tblk( "Literal", "typedef" ), " ", esc($mem->{Type}), $pname;
+ print DOC tblk( "Literal", "typedef" ), " ", esc($mem->{Type}), $pname, esc($mem->{Array});
}
# TODO nested compounds
else {
print CLASS "<LI>";
if( $type eq "var" ) {
- print CLASS esc( $m->{Type}), B( "b", $name );
+ print CLASS esc( $m->{Type}), B( "b", $name ), esc( $m->{Array});
}
elsif( $type eq "method" ) {
my $flags = $m->{Flags};
print CLASS "enum $name {", esc($m->{Params}),"}\n";
}
elsif( $type eq "typedef" ) {
- print CLASS "typedef ", esc($m->{Type}), " $name\n";
+ print CLASS "typedef ", esc($m->{Type}), " $name", esc($m->{Array}), "\n";
}
else {
# unknown type
print CLASS "<LI>\n";
if( $type eq "var" ) {
- print CLASS esc( $m->{Type}), " $name\n";
+ print CLASS esc( $m->{Type}), " $name", esc( $m->{Array}), "\n";
}
elsif( $type eq "method" ) {
$flags = $m->{Flags};
print CLASS "enum $name {", esc($m->{Params}),"}\n";
}
elsif( $type eq "typedef" ) {
- print CLASS "typedef ", esc($m->{Type}), " $name";
+ print CLASS "typedef ", esc($m->{Type}), " $name", esc($m->{Array});
}
else {
# unknown type
print CLASS '<table width="100%"><tr bgcolor="#eeeeee"><td><strong>';
if( $type eq "var" ) {
- print CLASS textRef($m->{Type}, $rootnode ), " $name\n";
+ print CLASS textRef($m->{Type}, $rootnode ), " $name", textRef( $m->{Array}, $rootnode), "\n";
}
elsif( $type eq "method" ) {
$flags = $m->{Flags};
}
elsif( $type eq "typedef" ) {
print CLASS "typedef ",
- textRef($m->{Type}, $rootnode ), " $name";
+ textRef($m->{Type}, $rootnode ), " $name", textRef( $m->{Array}, $rootnode);
}
else {
print CLASS $name, " ", B( "small", "(", esc($type), ")" );
print CLASS "</strong></td></tr></table><p>";
-# extra attributes
+ # extra attributes
my @extra = ();
if( !exists $m->{Access} ) {
if( $type eq "var" ) {
print CLASS esc( $m->{Type}),
- " \\textbf{", $name,"}\n";
+ " \\textbf{", $name,"}", esc( $m->{Array}), "\n";
}
elsif( $type eq "method" ) {
$flags = $m->{Flags};
elsif( $type eq "typedef" ) {
print CLASS "typedef ",
esc($m->{Type}), " \\textbf{",
- $name,"}";
+ $name,"}", esc($m->{Array});
}
else {
# unknown type
if( $type eq "var" ) {
print CLASS textRef($m->{Type}, $rootnode ),
- " \\texttt{", $name,"} ";
+ " \\texttt{", $name,"} ", textRef($m->{Array}, $rootnode );
}
elsif( $type eq "method" ) {
$flags = $m->{Flags};
elsif( $type eq "typedef" ) {
print CLASS "typedef ",
textRef($m->{Type}, $rootnode ), " \\texttt{",
- $name,"} ";
+ $name,"} ", textRef($m->{Array}, $rootnode );
}
else {
print CLASS $name, " {\\small (",
if( $type eq "var" ) {
print CLASS esc( $m->{Type}),
- " <b>", $name,"</b>\n";
+ " <b>", $name,"</b>", esc( $m->{Array} ), "\n";
}
elsif( $type eq "method" ) {
$flags = $m->{Flags};
elsif( $type eq "typedef" ) {
print CLASS "typedef ",
esc($m->{Type}), " <b>",
- $name,"</b>";
+ $name,"</b>", esc($m->{Array});
}
else {
# unknown type
if( $type eq "var" ) {
print CLASS textRef($m->{Type}, $rootnode ),
- " <b>", $name,"</b>\n";
+ " <b>", $name,"</b>", textRef($m->{Array}, $rootnode ), "\n";
}
elsif( $type eq "method" ) {
$flags = $m->{Flags};
elsif( $type eq "typedef" ) {
print CLASS "typedef ",
textRef($m->{Type}, $rootnode ), " <b>",
- $name,"</b>";
+ $name,"</b>",
+ textRef($m->{Array}, $rootnode );
}
else {
print CLASS $name, " <small>(",
if ( /^var/ ) {
my $type = $member->{Type};
- print TEX "\@deftypevar ", escape($type), " $escName\n";
+ my $escArray= escape( $member->{Array} );
+ print TEX "\@deftypevar ", escape($type), " $escName$escArray\n";
writeMemberInfo( $member->{DocNode} );
print TEX "\@end deftypevar\n";
last SWITCH;
if( /^typedef/ ) {
my $escType = escape( $member->{Type} );
- print TEX "\@deftp {typedef} {$escType} $escName\n";
+ my $escArray= escape( $member->{Array} );
+ print TEX "\@deftp {typedef} {$escType} $escName$escArray\n";
writeMemberInfo( $member->{DocNode} );
print TEX "\@end deftp\n";
last SWITCH;