nss: upgrade to release 3.73
[LibreOffice.git] / idlc / inc / astscope.hxx
blob5f6ed53f8df162c226672d33a1cb40a42c62decd
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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
22 #include "idlc.hxx"
24 class AstExpression;
25 #include "astdeclaration.hxx"
26 #include "astexpression.hxx"
28 class AstScope
30 public:
31 AstScope(NodeType nodeType);
32 virtual ~AstScope();
34 NodeType getScopeNodeType() const { return m_nodeType; }
36 AstDeclaration* addDeclaration(AstDeclaration* pDecl);
38 sal_uInt32 nMembers() const { return static_cast<sal_uInt32>(m_declarations.size()); }
39 DeclList::const_iterator getIteratorBegin() const { return m_declarations.begin(); }
40 DeclList::const_iterator getIteratorEnd() const { return m_declarations.end(); }
41 sal_uInt16 getNodeCount(NodeType nType) const;
43 // Name look up mechanism
44 AstDeclaration* lookupByName(const OString& scopedName);
45 // Look up the identifier 'name' specified only in the local scope
46 AstDeclaration* lookupByNameLocal(const OString& name) const;
48 AstDeclaration* lookupInInherited(const OString& scopedName) const;
50 // Look up a predefined type by its ExprType
51 AstDeclaration* lookupPrimitiveType(ExprType type);
53 AstDeclaration* lookupForAdd(AstDeclaration const* pDecl) const;
55 protected:
56 AstDeclaration const* getLast() const { return m_declarations.back(); }
58 private:
59 DeclList m_declarations;
60 NodeType m_nodeType;
63 #endif // INCLUDED_IDLC_INC_ASTSCOPE_HXX
65 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */