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
|
/*
SPDX-FileCopyrightText: 2006 Andreas Pakulat <apaku@gmx.de>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "ast.h"
namespace QMake {
AST::AST(AST* parent, AST::Type type)
: type(type)
, startLine(-1)
, endLine(-1)
, startColumn(-1)
, endColumn(-1)
, start(-1)
, end(-1)
, parent(parent)
{
}
AST::~AST()
{
}
ValueAST::ValueAST(AST* parent)
: AST(parent, AST::Value)
{
}
StatementAST::StatementAST(AST* parent, AST::Type type)
: AST(parent, type)
{
}
StatementAST::~StatementAST()
{
}
AssignmentAST::AssignmentAST(AST* parent)
: StatementAST(parent, AST::Assignment)
, identifier(nullptr)
, op(nullptr)
{
}
AssignmentAST::~AssignmentAST()
{
delete identifier;
identifier = nullptr;
qDeleteAll(values);
values.clear();
delete op;
}
ScopeBodyAST::ScopeBodyAST(AST* parent, AST::Type type)
: AST(parent, type)
{
}
ScopeBodyAST::~ScopeBodyAST()
{
qDeleteAll(ifStatements);
ifStatements.clear();
qDeleteAll(elseStatements);
elseStatements.clear();
}
FunctionCallAST::FunctionCallAST(AST* parent)
: ScopeAST(parent, AST::FunctionCall)
, identifier(nullptr)
{
}
FunctionCallAST::~FunctionCallAST()
{
delete identifier;
identifier = nullptr;
qDeleteAll(args);
args.clear();
}
OrAST::OrAST(AST* parent)
: ScopeAST(parent, AST::Or)
{
}
OrAST::~OrAST()
{
qDeleteAll(scopes);
scopes.clear();
}
ProjectAST::ProjectAST()
: AST(nullptr, AST::Project)
{
}
ProjectAST::~ProjectAST()
{
qDeleteAll(statements);
statements.clear();
}
ScopeAST::ScopeAST(AST* parent, AST::Type type)
: StatementAST(parent, type)
, body(nullptr)
{
}
ScopeAST::~ScopeAST()
{
delete body;
body = nullptr;
}
SimpleScopeAST::SimpleScopeAST(AST* parent)
: ScopeAST(parent, AST::SimpleScope)
, identifier(nullptr)
{
}
SimpleScopeAST::~SimpleScopeAST()
{
delete identifier;
identifier = nullptr;
}
}
|