diff options
author | Noel Grandin <noel@peralex.com> | 2016-02-16 13:15:43 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-02-17 11:22:26 +0200 |
commit | 0f8f733eaf54c00f79d086c2b2867c7a8b1bcc6c (patch) | |
tree | 42dbab67e739afe303532df4b6377ff1ad2bfda6 /idl | |
parent | 291a10ec557a765a4d3090330964fd1cb7a82f6b (diff) |
move parsing of method ags into SvIdlParser
Change-Id: I2fb969529c0670ae93c3cba69bf207d2c87887dc
Diffstat (limited to 'idl')
-rw-r--r-- | idl/inc/lex.hxx | 8 | ||||
-rw-r--r-- | idl/inc/types.hxx | 3 | ||||
-rw-r--r-- | idl/source/prj/parser.cxx | 24 |
3 files changed, 23 insertions, 12 deletions
diff --git a/idl/inc/lex.hxx b/idl/inc/lex.hxx index 7780a36a49ec..f513e9ec68fb 100644 --- a/idl/inc/lex.hxx +++ b/idl/inc/lex.hxx @@ -166,7 +166,7 @@ public: return *(*pRetToken).get(); } - SvToken& GetToken_NextAll() + SvToken& GetToken_Next() { std::vector<std::unique_ptr<SvToken> >::iterator pRetToken = pCurToken++; @@ -178,12 +178,6 @@ public: return *(*pRetToken).get(); } - SvToken& GetToken_Next() - { - // comments get removed initially - return GetToken_NextAll(); - } - SvToken& GetToken() const { return *(*pCurToken).get(); } bool ReadIf( char cChar ) diff --git a/idl/inc/types.hxx b/idl/inc/types.hxx index ec7a0de281ee..167e902947de 100644 --- a/idl/inc/types.hxx +++ b/idl/inc/types.hxx @@ -62,7 +62,6 @@ class SvMetaType : public SvMetaReference SvStream & rOutStm ); protected: bool ReadNamesSvIdl( SvTokenStream & rInStm ); - virtual void ReadContextSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ) override; bool ReadHeaderSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ); public: @@ -71,6 +70,8 @@ public: virtual ~SvMetaType(); + virtual void ReadContextSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ) override; + SvRefMemberList<SvMetaAttribute *>& GetAttrList() { return aAttrList; } sal_uLong GetAttrCount() const { return aAttrList.size(); } diff --git a/idl/source/prj/parser.cxx b/idl/source/prj/parser.cxx index 9d77a3682c5a..d1793c89de2b 100644 --- a/idl/source/prj/parser.cxx +++ b/idl/source/prj/parser.cxx @@ -404,11 +404,27 @@ bool SvIdlParser::ReadInterfaceOrShellMethodOrAttribute( SvMetaAttribute& rAttr rAttr.aSlotId.SetValue(n); bOk = true; - SvToken& rTok = rInStm.GetToken(); - if( rTok.IsChar() && rTok.GetChar() == '(' ) + if( rInStm.ReadIf( '(' ) ) { - bOk = rAttr.aType->ReadMethodArgs( rBase, rInStm ); - } + // read method arguments + tools::SvRef<SvMetaType> xT(new SvMetaType() ); + xT->SetRef(rAttr.GetType() ); + rAttr.aType = xT; + sal_uInt32 nBeginPos = 0; // can not happen with Tell + while( nBeginPos != rInStm.Tell() ) + { + nBeginPos = rInStm.Tell(); + tools::SvRef<SvMetaAttribute> xAttr( new SvMetaAttribute() ); + if( xAttr->ReadSvIdl( rBase, rInStm ) ) + { + if( xAttr->Test( rInStm ) ) + rAttr.aType->GetAttrList().push_back( xAttr ); + } + rInStm.ReadIfDelimiter(); + } + ReadChar( ')' ); + rAttr.aType->SetType( MetaTypeType::Method ); + } if( bOk && rInStm.ReadIf( '[' ) ) { ReadChar( ']' ); |