patrick
/
plasp
Archived
1
0
Fork 0
This repository has been archived on 2023-07-19. You can view files and clone it, but cannot push or open issues or pull requests.
plasp/lib/pddl/include/pddl/detail/VariableStack.h

39 lines
861 B
C++

#ifndef __PDDL__DETAIL__VARIABLE_STACK_H
#define __PDDL__DETAIL__VARIABLE_STACK_H
#include <pddl/ASTForward.h>
namespace pddl
{
namespace detail
{
////////////////////////////////////////////////////////////////////////////////////////////////////
//
// VariableStack
//
////////////////////////////////////////////////////////////////////////////////////////////////////
class VariableStack
{
public:
using Layer = ast::VariableDeclarations *;
public:
void push(Layer layer);
void pop();
std::experimental::optional<ast::VariableDeclaration *> findVariableDeclaration(const std::string &variableName) const;
bool contains(const ast::VariableDeclaration &variableDeclaration) const;
private:
std::vector<Layer> m_layers;
};
////////////////////////////////////////////////////////////////////////////////////////////////////
}
}
#endif