CORBA-XPIDL
view release on metacpan or search on metacpan
lib/CORBA/XPIDL/CheckVisitor.pm view on Meta::CPAN
if ( ! $type->hasProperty('nsid')
and ! $type->hasProperty('domstring')
and ! $type->hasProperty('utf8string')
and ! $type->hasProperty('cstring')
and ! $type->hasProperty('astring') ) {
$self->{parser}->Error(
"attributes in [scriptable] interfaces that are " .
"non-scriptable because they refer to native " .
"types must be marked [noscript].\n"
);
}
}
# We currently don't support properties of type nsid that aren't
# pointers or references, unless they are marked [notxpcom] and
# must be read-only
if ( ! $node->hasProperty('notxpcom')
or !exists $node->{modifier}) { # readonly
if ( $type->hasProperty('nsid')
and ! $type->hasProperty('ptr')
and ! $type->hasProperty('ref') ) {
$self->{parser}->Error(
"Feature not currently supported: " .
"attributes with a type of nsid must be marked " .
"either [ptr] or [ref], or " .
"else must be marked [notxpcom] " .
"and must be read-only.\n"
);
}
}
# Run additional error checks on the attribute type if targetting an
# older version of XPConnect.
$self->_verify_type_fits_version($type, $node);
}
#
# 3.15 Repository Identity Related Declarations
#
sub visitTypeId {
# empty
}
sub visitTypePrefix {
# empty
}
#
# XPIDL
#
sub visitCodeFragment {
my $self = shift;
my ($node, $parent) = @_;
$self->{parser}->YYData->{filename} = $node->{filename};
$self->{parser}->YYData->{lineno} = $node->{lineno};
if ($parent->isa('BaseInterface')) {
$self->{parser}->Warning(
"\%\%{ .. \%\%} code fragment within interface " .
"ignored when generating NS_DECL_$parent->{idf} macro; " .
"if the code fragment contains method declarations, " .
"the macro probably isn't complete.\n"
);
}
if ($self->{mode} eq 'header') {
my @code = split /\n/, $node->{value};
my $lang = shift @code;
unless ($lang =~ /^\s*C\+\+/) {
$self->{parser}->YYData->{filename} = $node->{filename};
$self->{parser}->YYData->{lineno} = $node->{lineno};
$self->{parser}->Warning(
"ignoring '\%\%{$lang' escape. " .
"(Use '\%\%{C++' to escape verbatim C++ code).\n"
);
}
}
}
1;
( run in 0.938 second using v1.01-cache-2.11-cpan-b16cb0d3907 )