Permalink
Browse files

Fix parsing of ODL-style properties

Declaration of properties inside a dispinterface (ODL syntax) in IDL/ODL file is not parsed properly. Fix that.
  • Loading branch information...
rabindra-harlalka committed Dec 21, 2014
1 parent ac28c93 commit 6a8bef8852eb22558b3559ebe96d9e06e6cadfa7
Showing with 39 additions and 1 deletion.
  1. +39 −1 src/scanner.l
@@ -182,6 +182,7 @@ static char docBlockTerm;
static QCString idlAttr;
static QCString idlProp;
static bool odlProp;
static bool g_lexInit = FALSE;
static bool externC;
@@ -3398,6 +3399,15 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
idlAttr.resize(0);
idlProp.resize(0);
current->mtype = mtype;
if (Config_getBool("IDL_PROPERTY_SUPPORT") &&
current->mtype == Property)
{ // we are inside the properties section of a dispinterface
odlProp = true;
current->spec |= Entry::Gettable;
current->spec |= Entry::Settable;
}
BEGIN( IDLAttribute );
}
else if (insideCS &&
@@ -3452,7 +3462,14 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
current->spec |= Entry::Optional;
}
<IDLAttribute>"readonly" { // on UNO IDL attribute or property
current->spec |= Entry::Readonly;
if (Config_getBool("IDL_PROPERTY_SUPPORT") && odlProp)
{
current->spec ^= Entry::Settable;
}
else
{
current->spec |= Entry::Readonly;
}
}
<IDLAttribute>"bound" { // on UNO IDL attribute or property
current->spec |= Entry::Bound;
@@ -3479,6 +3496,11 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
<IDLPropName>{BN}*{ID}{BN}* {
// return type (probably HRESULT) - skip it
if (odlProp)
{ // property type
idlProp = yytext;
}
}
<IDLPropName>{ID}{BN}*"(" {
current->name = yytext;
@@ -3487,6 +3509,22 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
current->startColumn = yyColNr;
BEGIN( IDLProp );
}
<IDLPropName>{BN}*"("{BN}*{ID}{BN}*")"{BN}* {
if (odlProp)
{
idlProp += yytext;
}
}
<IDLPropName>{ID}{BN}*/";" {
if (odlProp)
{
current->name = yytext;
idlProp = idlProp.stripWhiteSpace();
odlProp = false;
BEGIN( IDLProp );
}
}
<IDLProp>{BN}*"["[^\]]*"]"{BN}* { // attribute of a parameter
idlAttr = yytext;
idlAttr=idlAttr.stripWhiteSpace();

0 comments on commit 6a8bef8

Please sign in to comment.