45 lines
612 B
C
45 lines
612 B
C
|
#ifndef DOMAIN_LIBRARY_RULE_H
|
||
|
#define DOMAIN_LIBRARY_RULE_H
|
||
|
|
||
|
#include "value.h"
|
||
|
|
||
|
#include <string>
|
||
|
#include <vector>
|
||
|
|
||
|
class Action;
|
||
|
class Condition;
|
||
|
class IfStmt;
|
||
|
|
||
|
class Rule: AstNode
|
||
|
{
|
||
|
public:
|
||
|
std::vector<IfStmt> statements;
|
||
|
Rule();
|
||
|
};
|
||
|
|
||
|
class Action: AstNode {
|
||
|
public:
|
||
|
enum ActionType {
|
||
|
ERROR,
|
||
|
WARNING
|
||
|
};
|
||
|
|
||
|
ActionType type;
|
||
|
StringNode message;
|
||
|
};
|
||
|
|
||
|
class Condition {
|
||
|
public:
|
||
|
bool negated;
|
||
|
IdentifierNode functionName;
|
||
|
std::vector<Value> params;
|
||
|
};
|
||
|
|
||
|
class IfStmt: AstNode {
|
||
|
public:
|
||
|
Condition condition;
|
||
|
Action action;
|
||
|
};
|
||
|
|
||
|
#endif // DOMAIN_LIBRARY_RULE_H
|