package IDLStructure;
use strict;
use Class::Struct;
struct( idlDocument => {
module => '$', classes => '@', fileName => '$' });
struct( domClass => {
name => '$', parents => '@', constants => '@', functions => '@', attributes => '@', extendedAttributes => '$', });
struct( domFunction => {
signature => '$', parameters => '@', raisesExceptions => '@', });
struct( domAttribute => {
type => '$', signature => '$', getterExceptions => '@', setterExceptions => '@', });
struct( domSignature => {
direction => '$', name => '$', type => '$', extendedAttributes => '$' });
struct( domConstant => {
name => '$', type => '$', value => '$', });
our $idlId = '[a-zA-Z0-9]'; our $idlIdNs = '[a-zA-Z0-9:]'; our $idlIdNsList = '[a-zA-Z0-9:,\ ]';
our $idlType = '[a-zA-Z0-9_]'; our $constValue = '("[^"\r\n]*")|(0[xX][a-fA-F0-9]+)|(-?[0-9]*)';
our $idlDataType = '[a-zA-Z0-9\ ]';
my $supportedTypes = "((?:unsigned )?(?:int|short|(?:long )?long)|(?:$idlIdNs*))";
our $extendedAttributeSyntax = '\[[^]]*\]';
our $moduleSelector = 'module\s*(' . $idlId . '*)\s*{';
our $moduleNSSelector = 'module\s*(' . $idlId . '*)\s*\[ns\s*(' . $idlIdNs . '*)\s*(' . $idlIdNs . '*)\]\s*;';
our $constantSelector = 'const\s*' . $supportedTypes . '\s*(' . $idlType . '*)\s*=\s*(' . $constValue . ')';
our $raisesSelector = 'raises\s*\((' . $idlIdNsList . '*)\s*\)';
our $getterRaisesSelector = '\bgetter\s+raises\s*\((' . $idlIdNsList . '*)\s*\)';
our $setterRaisesSelector = '\bsetter\s+raises\s*\((' . $idlIdNsList . '*)\s*\)';
our $typeNamespaceSelector = '((?:' . $idlId . '*::)*)\s*(' . $idlDataType . '*)';
our $exceptionSelector = 'exception\s*(' . $idlIdNs . '*)\s*([a-zA-Z\s{;]*};)';
our $exceptionSubSelector = '{\s*' . $supportedTypes . '\s*(' . $idlType . '*)\s*;\s*}';
our $interfaceSelector = 'interface\s*((?:' . $extendedAttributeSyntax . ' )?)(' . $idlIdNs . '*)\s*(?::(\s*[^{]*))?{([-a-zA-Z0-9_"=\s(),;:\[\]&\|]*)';
our $interfaceMethodSelector = '\s*((?:' . $extendedAttributeSyntax . ' )?)' . $supportedTypes . '\s*(' . $idlIdNs . '*)\s*\(\s*([a-zA-Z0-9:\s,=\[\]]*)';
our $interfaceParameterSelector = '(in|out)\s*((?:' . $extendedAttributeSyntax . ' )?)' . $supportedTypes . '\s*(' . $idlIdNs . '*)';
our $interfaceAttributeSelector = '\s*(readonly attribute|attribute)\s*(' . $extendedAttributeSyntax . ' )?' . $supportedTypes . '\s*(' . $idlType . '*)';
1;