1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_IDLC_INC_ASTDECLARATION_HXX
20 #define INCLUDED_IDLC_INC_ASTDECLARATION_HXX
23 #include <registry/registry.hxx>
27 // Enum defining the different kinds of Ast nodes
30 NT_service
, // Denotes a service
31 NT_interface_member
, // Denotes an interface which is exported from object
32 NT_service_member
, // Denotes a service which is exported from object
33 NT_observes
, // Denotes an observed interface
34 NT_needs
, // Denotes a needed service
35 NT_module
, // Denotes a module
36 NT_root
, // Denotes the root of AST
37 NT_interface
, // Denotes an interface
38 NT_constants
, // Denotes a constant group
39 NT_const
, // Denotes a constant
40 NT_exception
, // Denotes an exception
41 NT_attribute
, // Denotes an attribute
42 NT_property
, // Denotes a property
43 NT_operation
, // Denotes an operation
44 NT_parameter
, // Denotes an op. parameter
45 NT_struct
, // Denotes either a plain struct type, or a
46 // polymorphic struct type template
47 NT_type_parameter
, // Denotes a type parameter of a polymorphic struct
49 NT_instantiated_struct
, // Denotes an instantiated polymorphic struct type
50 NT_member
, // Denotes a member in structure, exception
51 NT_enum
, // Denotes an enumeration
52 NT_enum_val
, // Denotes an enum. value
53 NT_sequence
, // Denotes an IDL sequence
54 NT_typedef
, // Denotes a typedef
55 NT_predefined
, // Denotes a predefined type
56 NT_singleton
// Denotes a singleton
63 AstDeclaration(NodeType type
, const OString
& name
, AstScope
* pScope
);
64 virtual ~AstDeclaration();
66 AstDeclaration(AstDeclaration
const &) = default;
67 AstDeclaration(AstDeclaration
&&) = default;
68 AstDeclaration
& operator =(AstDeclaration
const &) = default;
69 AstDeclaration
& operator =(AstDeclaration
&&) = default;
72 const OString
& getLocalName() const
73 { return m_localName
; }
74 const OString
& getScopedName() const
75 { return m_scopedName
; }
76 const OString
& getFullName() const
77 { return m_fullName
; }
78 virtual const char* getRelativName() const
79 { return m_fullName
.getStr()+1; }
82 const AstScope
* getScope() const
84 NodeType
getNodeType() const
85 { return m_nodeType
; }
86 bool isInMainfile() const
87 { return m_bInMainFile
; }
88 void setInMainfile(bool bInMainfile
)
89 { m_bInMainFile
= bInMainfile
; }
90 bool isImported() const
91 { return m_bImported
; }
92 void setImported(bool bImported
)
93 { m_bImported
= bImported
; }
94 sal_Int32
getLineNumber() const
95 { return m_lineNumber
; }
96 void setLineNumber(sal_Int32 lineNumber
)
97 { m_lineNumber
= lineNumber
; }
98 const OString
& getFileName() const
99 { return m_fileName
; }
100 void setFileName(const OString
& rFileName
)
101 { m_fileName
= rFileName
; }
102 const OUString
& getDocumentation() const
103 { return m_documentation
; }
104 void setDocumentation(const OUString
& rDocumentation
)
105 { m_documentation
= rDocumentation
; }
107 virtual bool isType() const;
109 bool hasAncestor(AstDeclaration
* pDecl
);
111 void setPublished() { m_bPublished
= true; }
112 bool isPublished() const { return m_bPublished
; }
114 virtual bool dump(RegistryKey
& rKey
);
116 bool isPredefined() const { return m_bPredefined
; }
117 void setPredefined(bool bPredefined
);
121 OString m_scopedName
; // full qualified name
122 OString m_fullName
; // full qualified name with '/' as separator
125 bool m_bImported
; // imported ?
126 bool m_bInMainFile
; // defined in main file
129 sal_Int32 m_lineNumber
; // line number defined in
130 OString m_fileName
; // fileName defined in
131 OUString m_documentation
; // fileName defined in
134 #endif // INCLUDED_IDLC_INC_ASTDECLARATION_HXX
136 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */