1
#include "CristallGrammar.h"
4
using namespace Cristall;
6
void CristallGrammar::addGrammar(std::string Label, std::string Char)
8
CristallGrammarModel OperationElement(RuleType::SingleRule, Rules::None, Label, Char, "",RunRuleInside::No, 0);
9
OperationList.push_back(OperationElement);
12
void CristallGrammar::addGrammarByGroup(int GroupID, std::string Char)
14
string GroupName = getGroup(GroupID);
15
if (GroupName != "[empty]")
16
addGrammar(GroupName, Char);
19
void CristallGrammar::addGrammarTo(std::string Label, std::string StartChar, std::string EndChar, Cristall::RunRuleInside Rule)
21
CristallGrammarModel OperationElement(RuleType::MultiRule, Rules::None, Label, StartChar, EndChar, Rule, 0);
22
OperationList.push_back(OperationElement);
25
void CristallGrammar::addGrammarToByGroup(int GroupID , std::string StartChar, std::string EndChar, Cristall::RunRuleInside Rule)
27
string GroupName = getGroup(GroupID);
28
if (GroupName != "[empty]")
29
addGrammarTo(GroupName , StartChar, EndChar, Rule);
32
void CristallGrammar::addRule(std::string const& YourName, Cristall::Rules Rule, int Limit)
34
CristallGrammarModel OperationElement(RuleType::SpecialRule, Rule, YourName, "", "", RunRuleInside::No, Limit);
35
OperationList.push_back(OperationElement);