Added a calculator test program.
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
rule:
|
||||
|
||||
number [0-9]+
|
||||
plus \+
|
||||
minus \-
|
||||
multiply \*
|
||||
divide \/
|
||||
lparen \(
|
||||
rparen \)
|
||||
whitespace [ \t\r\n]+
|
||||
|
||||
mapping:
|
||||
|
||||
number number
|
||||
plus plus
|
||||
minus minus
|
||||
multiply multiply
|
||||
divide divide
|
||||
lparen lparen
|
||||
rparen rparen
|
||||
|
||||
code:
|
||||
|
||||
%c%
|
||||
%post_processor
|
||||
if (input->tag == slex_tag_whitespace) {
|
||||
return slex_skip;
|
||||
}
|
||||
*output = input;
|
||||
return slex_continue;
|
||||
post_processor%
|
||||
|
||||
%c#%
|
||||
%post_processor
|
||||
if (Input.Tag == SegmentTag.whitespace)
|
||||
{
|
||||
Output = null!;
|
||||
return PostProcessResult.Skip;
|
||||
}
|
||||
Output = Input;
|
||||
return PostProcessResult.Continue;
|
||||
post_processor%
|
||||
Reference in New Issue
Block a user