All pastes #2105980 Raw Edit

Mine

public text v1 · immutable
#2105980 ·published 2012-01-25 09:20 UTC
rendered paste body
#ifndef SPA_QUERY_TYPES_H
#define SPA_QUERY_TYPES_H

#include <string>
#include <vector>

enum ParameterType
{
	ANY, // _
	LINE, // line number
	NAME, // variable / procedure name in SIMPLE
	ENTITY, // stmt, prog_line variable names...
	BOOLEAN,
	ATTRIBUTE, // entity.attribute
	EXPRESSION, // "x + 1"
	SUBEXPRESSION // _"x + 1"_
};

struct query_declaration
{
	std::string type;
	std::string name;
};

struct query_parameter
{
	std::string value;
	ParameterType type;
};

struct query_relation
{
	std::string type;
	std::vector<query_parameter> parameters;
};

struct query_tree
{
	std::vector<query_declaration> variables;
	std::vector<query_parameter> targets;
	std::vector<query_relation> relations;
};

#endif