summaryrefslogtreecommitdiffstats
path: root/umbrello/umbrello/codeimport/adaimport.h
blob: 7c66f0cdfed8532cfd2b3a871a18315b9246ea83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   copyright (C) 2005-2007                                               *
 *   Umbrello UML Modeller Authors <uml-devel@uml.sf.net>                  *
 ***************************************************************************/

#ifndef ADAIMPORT_H
#define ADAIMPORT_H

#include <tqmap.h>
#include <tqstringlist.h>

#include "nativeimportbase.h"
#include "../umlobjectlist.h"

/**
 * Ada code import
 * @author Oliver Kellogg
 * Bugs and comments to uml-devel@lists.sf.net or http://bugs.trinitydesktop.org
 */
class AdaImport : public NativeImportBase {
public:
    AdaImport();
    virtual ~AdaImport();

protected:
    /**
     * Reimplement operation from NativeImportBase.
     */
    void initVars();

    /**
     * Implement abstract operation from NativeImportBase.
     */
    bool parseStmt();

    /**
     * Split the line so that a string is returned as a single element of the list.
     * When not in a string then split at white space.
     * Reimplementation of method from NativeImportBase is required because of
     * Ada's tic which is liable to be confused with the beginning of a character
     * constant.
     */
    TQStringList split(const TQString& line);

    /**
     * Implement abstract operation from NativeImportBase.
     */
    void fillSource(const TQString& word);

    /**
     * Apply package renamings to the given name.
     *
     * @return  expanded name
     */
    TQString expand(const TQString& name);

    /**
     * Parse all files that can be formed by concatenation of the given stems.
     */
    void parseStems(const TQStringList& stems);

    bool m_inGenericFormalPart; ///< auxiliary variable

    /**
     * List for keeping track of tagged objects declared in the current scope.
     * This is required for distinguishing primitive from non primitive
     * methods.
     */
    UMLObjectList m_classesDefinedInThisScope;

    typedef TQMap<TQString, TQString> StringMap;

    /**
     * Map of package renamings.
     * Keyed by the renaming. Value returns the expanded name.
     */
    StringMap m_renaming;

};

#endif