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 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133
|
/*
SPDX-FileCopyrightText: 2007 Andreas Pakulat <apaku@gmx.de>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef QMAKEAST_H
#define QMAKEAST_H
#include <QString>
#include <QList>
#include "parser_export.h"
namespace KDevelop
{
class DUContext;
}
namespace QMake
{
class ValueAST;
class KDEVQMAKEPARSER_EXPORT AST
{
public:
enum Type
{
Project = 0,
ScopeBody = 1,
Assignment = 2,
FunctionCall = 3,
SimpleScope = 4,
Or = 5,
Value = 6,
Invalid = 7
};
AST( AST* parent, AST::Type type );
virtual ~AST();
AST::Type type;
int startLine;
int endLine;
int startColumn;
int endColumn;
int start;
int end;
AST* parent;
KDevelop::DUContext* context;
};
class KDEVQMAKEPARSER_EXPORT StatementAST : public AST
{
public:
StatementAST( AST* parent, AST::Type type );
~StatementAST() override;
};
class KDEVQMAKEPARSER_EXPORT ScopeBodyAST: public AST
{
public:
explicit ScopeBodyAST( AST* parent, AST::Type type = AST::ScopeBody );
~ScopeBodyAST() override;
QList<StatementAST*> ifStatements;
QList<StatementAST*> elseStatements;
};
class KDEVQMAKEPARSER_EXPORT ProjectAST : public AST
{
public:
explicit ProjectAST();
~ProjectAST() override;
QString filename;
QList<StatementAST*> statements;
};
class KDEVQMAKEPARSER_EXPORT AssignmentAST : public StatementAST
{
public:
explicit AssignmentAST( AST* parent );
~AssignmentAST() override;
ValueAST* identifier;
ValueAST* op;
QList<ValueAST*> values;
};
class KDEVQMAKEPARSER_EXPORT ScopeAST : public StatementAST
{
public:
explicit ScopeAST( AST* parent, AST::Type type);
~ScopeAST() override;
ScopeBodyAST* body;
};
class KDEVQMAKEPARSER_EXPORT FunctionCallAST : public ScopeAST
{
public:
explicit FunctionCallAST( AST* parent );
~FunctionCallAST() override;
ValueAST* identifier;
QList<ValueAST*> args;
};
class KDEVQMAKEPARSER_EXPORT SimpleScopeAST : public ScopeAST
{
public:
explicit SimpleScopeAST( AST* parent );
~SimpleScopeAST() override;
ValueAST* identifier;
};
class KDEVQMAKEPARSER_EXPORT OrAST : public ScopeAST
{
public:
explicit OrAST( AST* parent );
~OrAST() override;
QList<ScopeAST*> scopes;
};
class KDEVQMAKEPARSER_EXPORT ValueAST : public AST
{
public:
explicit ValueAST( AST* parent );
QString value;
};
}
#endif
|