1
#include "numbersgrammar.h"
3
NumbersGrammar::NumbersGrammar(std::string Label, int Limit = 0){
8
bool NumbersGrammar::isRule(std::string& Text){
9
return (isdigit(Text[0]) == true || Text[0] == '-' );
12
void NumbersGrammar::parse(std::string& Text, std::vector<CristallStack>& LocalStack){
15
if (isdigit(Char) || Char == '-')
20
if (Limit == Element || (Limit == 0)){
21
LocalStack.push_back(this->getResult(boost::lexical_cast<int>(Text.substr(0,Element) ) ));
22
Text.erase(0,Element);
26
CristallStack NumbersGrammar::getResult(int Value){
27
CristallStack ResultRule;
28
ResultRule.Label = this->Label;
29
ResultRule.Type = CristallTypes::Number;
30
ResultRule.Value = Value;