Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*
3 : : * This file is part of the LibreOffice project.
4 : : *
5 : : * This Source Code Form is subject to the terms of the Mozilla Public
6 : : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : : *
9 : : * This file incorporates work covered by the following license notice:
10 : : *
11 : : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : : * contributor license agreements. See the NOTICE file distributed
13 : : * with this work for additional information regarding copyright
14 : : * ownership. The ASF licenses this file to you under the Apache
15 : : * License, Version 2.0 (the "License"); you may not use this file
16 : : * except in compliance with the License. You may obtain a copy of
17 : : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : : */
19 : : #ifndef _IDLC_FEHELPER_HXX_
20 : : #define _IDLC_FEHELPER_HXX_
21 : :
22 : : #include <idlc/asttype.hxx>
23 : : #include <idlc/astinterface.hxx>
24 : :
25 : : #include <vector>
26 : :
27 : : class FeDeclarator
28 : : {
29 : : public:
30 : : // Enum to denote types of declarators
31 : : enum DeclaratorType
32 : : {
33 : : FD_simple, // Simple declarator
34 : : FD_complex // Complex declarator (complex_part field used)
35 : : };
36 : :
37 : : FeDeclarator(const ::rtl::OString& name, DeclaratorType declType, AstDeclaration* pComplPart);
38 : : virtual ~FeDeclarator();
39 : :
40 : : AstDeclaration* getComplexPart()
41 : : { return m_pComplexPart; }
42 : 185619 : const ::rtl::OString& getName()
43 : 185619 : { return m_name; }
44 : : DeclaratorType getDeclType()
45 : : { return m_declType; }
46 : :
47 : : sal_Bool checkType(AstDeclaration const * pType);
48 : : AstType const * compose(AstDeclaration const * pDecl);
49 : : private:
50 : : AstDeclaration* m_pComplexPart;
51 : : ::rtl::OString m_name;
52 : : DeclaratorType m_declType;
53 : : };
54 : :
55 : : typedef ::std::list< FeDeclarator* > FeDeclList;
56 : :
57 : : class FeInheritanceHeader
58 : : {
59 : : public:
60 : : FeInheritanceHeader(
61 : : NodeType nodeType, ::rtl::OString* pName, ::rtl::OString* pInherits,
62 : : std::vector< rtl::OString > * typeParameters);
63 : :
64 : 114396 : virtual ~FeInheritanceHeader()
65 : 57198 : {
66 [ + - ]: 57198 : if ( m_pName )
67 [ + - ]: 57198 : delete m_pName;
68 [ - + ]: 114396 : }
69 : :
70 : 38214 : NodeType getNodeType()
71 : 38214 : { return m_nodeType; }
72 : 57198 : ::rtl::OString* getName()
73 : 57198 : { return m_pName; }
74 : 57198 : AstDeclaration* getInherits()
75 : 57198 : { return m_pInherits; }
76 : :
77 : 13686 : std::vector< rtl::OString > const & getTypeParameters() const
78 : 13686 : { return m_typeParameters; }
79 : :
80 : : private:
81 : : void initializeInherits(::rtl::OString* pinherits);
82 : :
83 : : NodeType m_nodeType;
84 : : ::rtl::OString* m_pName;
85 : : AstDeclaration* m_pInherits;
86 : : std::vector< rtl::OString > m_typeParameters;
87 : : };
88 : :
89 : : #endif // _IDLC_FEHELPER_HXX_
90 : :
91 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|