Finished implementing completion (unit tests to follow).
This commit is contained in:
41
include/anthem/ASTUtils.h
Normal file
41
include/anthem/ASTUtils.h
Normal file
@@ -0,0 +1,41 @@
|
||||
#ifndef __ANTHEM__AST_UTILS_H
|
||||
#define __ANTHEM__AST_UTILS_H
|
||||
|
||||
#include <anthem/AST.h>
|
||||
|
||||
namespace anthem
|
||||
{
|
||||
namespace ast
|
||||
{
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// AST Utils
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class VariableStack
|
||||
{
|
||||
public:
|
||||
using Layer = const std::vector<ast::Variable> *;
|
||||
|
||||
public:
|
||||
void push(Layer layer);
|
||||
void pop();
|
||||
|
||||
bool contains(const ast::Variable &variable) const;
|
||||
|
||||
private:
|
||||
std::vector<Layer> m_layers;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
std::vector<ast::Variable> collectFreeVariables(const ast::Formula &formula, ast::VariableStack &variableStack);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user