%%{
machine microscript;
action ClearNumber {
currentNumber = 0;
}
action RecordDigit {
uint8_t digit = (*p) - '0';
currentNumber = (currentNumber * 10) + digit;
}
number = ((digit @RecordDigit)+) >ClearNumber;
whitespace = space+;
main := number (whitespace number)*;
}%%
EDIT: Make me understand the meaning of this ">" operator. I have quoted its description from the ragel guide in a comment to @jcomeu
I understand ClearNumber action is called before RecordDigit, if so, currentNumber is initialised to zero, what is the use of multiplying it by 10.
And lastly, the definition of number. What does number=((digit @RecordDigit)+) >ClearNumber
mean?
This is the source of code: here
EDIT :
*Specifically how does RecordDigit work? What is p? A Pointer? if so, what is it pointing to? What is digit =(*p)- '0';
mean? [solved]