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_ASTSCOPE_HXX
20 #define INCLUDED_IDLC_INC_ASTSCOPE_HXX
25 #include "astdeclaration.hxx"
26 #include "astexpression.hxx"
31 AstScope(NodeType nodeType
);
34 NodeType
getScopeNodeType() const
35 { return m_nodeType
; }
37 AstDeclaration
* addDeclaration(AstDeclaration
* pDecl
);
39 sal_uInt32
nMembers() const
40 { return static_cast<sal_uInt32
>(m_declarations
.size()); }
41 DeclList::const_iterator
getIteratorBegin() const
42 { return m_declarations
.begin(); }
43 DeclList::const_iterator
getIteratorEnd() const
44 { return m_declarations
.end(); }
45 sal_uInt16
getNodeCount(NodeType nType
) const;
47 // Name look up mechanism
48 AstDeclaration
* lookupByName(const OString
& scopedName
);
49 // Look up the identifier 'name' specified only in the local scope
50 AstDeclaration
* lookupByNameLocal(const OString
& name
) const;
52 AstDeclaration
* lookupInInherited(const OString
& scopedName
) const;
54 // Look up a predefined type by its ExprType
55 AstDeclaration
* lookupPrimitiveType(ExprType type
);
57 AstDeclaration
* lookupForAdd(AstDeclaration
const * pDecl
) const;
60 AstDeclaration
const * getLast() const
61 { return m_declarations
.back(); }
64 DeclList m_declarations
;
68 #endif // INCLUDED_IDLC_INC_ASTSCOPE_HXX
70 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */