package IDLStructure;
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 => {
name => '$', type => '$', extendedAttributes => '$' });
struct( domConstant => {
name => '$', type => '$', value => '$', });
$idlId = '[a-zA-Z0-9]'; $idlIdNs = '[a-zA-Z0-9:]'; $idlIdNsList = '[a-zA-Z0-9:,\ ]';
$idlType = '[a-zA-Z0-9_]'; $idlDataType = '[a-zA-Z0-9\ ]';
my $supportedTypes = "((?:unsigned )?(?:int|short|long)|(?:$idlIdNs*))";
$extendedAttributeSyntax = '\[[^]]*\]';
$moduleSelector = 'module\s*(' . $idlId . '*)\s*{';
$moduleNSSelector = 'module\s*(' . $idlId . '*)\s*\[ns\s*(' . $idlIdNs . '*)\s*(' . $idlIdNs . '*)\]\s*;';
$constantSelector = 'const\s*' . $supportedTypes . '\s*(' . $idlType . '*)\s*=\s*(' . $idlType . '*)';
$raisesSelector = 'raises\s*\((' . $idlIdNsList . '*)\s*\)';
$getterRaisesSelector = '\bgetter\s+raises\s*\((' . $idlIdNsList . '*)\s*\)';
$setterRaisesSelector = '\bsetter\s+raises\s*\((' . $idlIdNsList . '*)\s*\)';
$typeNamespaceSelector = '((?:' . $idlId . '*::)*)\s*(' . $idlDataType . '*)';
$exceptionSelector = 'exception\s*(' . $idlIdNs . '*)\s*([a-zA-Z\s{;]*};)';
$exceptionSubSelector = '{\s*' . $supportedTypes . '\s*(' . $idlType . '*)\s*;\s*}';
$interfaceSelector = 'interface\s*((?:' . $extendedAttributeSyntax . ' )?)(' . $idlIdNs . '*)\s*(?::(\s*[^{]*))?{([a-zA-Z0-9_=\s(),;:\[\]]*)';
$interfaceMethodSelector = '\s*((?:' . $extendedAttributeSyntax . ' )?)' . $supportedTypes . '\s*(' . $idlIdNs . '*)\s*\(\s*([a-zA-Z0-9:\s,=\[\]]*)';
$interfaceParameterSelector = 'in\s*((?:' . $extendedAttributeSyntax . ' )?)' . $supportedTypes . '\s*(' . $idlIdNs . '*)';
$interfaceAttributeSelector = '\s*(readonly attribute|attribute)\s*(' . $extendedAttributeSyntax . ' )?' . $supportedTypes . '\s*(' . $idlType . '*)';
1;