mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-08 17:48:46 -10:00
This also includes the necessary setup work for using "position" and "direction" in action expressions.
33 lines
835 B
C++
33 lines
835 B
C++
#pragma once
|
|
|
|
#include "AbstractExpression.h"
|
|
|
|
namespace actions {
|
|
namespace expression {
|
|
namespace nodes {
|
|
|
|
class VariableReferenceExpression : public AbstractExpression {
|
|
public:
|
|
VariableReferenceExpression(const SCP_vector<SCP_string> references,
|
|
SCP_vector<antlr4::Token*> referenceTokens);
|
|
~VariableReferenceExpression() override;
|
|
|
|
Value execute(const ProgramVariables& variables) const override;
|
|
bool validate(antlr4::Parser* parser, const ParseContext& context) override;
|
|
void validationDone() override;
|
|
|
|
protected:
|
|
ValueType determineReturnType() const override;
|
|
|
|
private:
|
|
ValueType m_variableType = ValueType::Invalid;
|
|
SCP_string m_fullVariablePath;
|
|
|
|
SCP_vector<SCP_string> m_references;
|
|
SCP_vector<antlr4::Token*> m_referenceTokens;
|
|
};
|
|
|
|
} // namespace nodes
|
|
} // namespace expression
|
|
} // namespace actions
|