From: helly Date: Sat, 15 Apr 2006 19:31:26 +0000 (+0000) Subject: - Add docu X-Git-Tag: 0.13.6~389 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=857026f7f06cc07f00786c08e86f82980f4d0a84;p=re2c - Add docu --- diff --git a/lessons/001_upn_calculator/calc_006.s.re b/lessons/001_upn_calculator/calc_006.s.re index 8e16b25d..d7947ccf 100755 --- a/lessons/001_upn_calculator/calc_006.s.re +++ b/lessons/001_upn_calculator/calc_006.s.re @@ -29,6 +29,12 @@ arise when the second last character is a "0" and the last is any digit. if (l > 1 && s[l-2] == '0' && s[l-1] >= '0' && s[l-1] <= '9') return 2; + + However in this example the above check is only necessary if the input is + not terminated by a trailing zero check. In other words it would be used + when reading from a file and directly working on the read buffers. For + zero terminated string input the generated scanner will always find the + terminating zero. - optimizing the generated code by using -s command line switch of re2c . This tells re2c to generate code that uses if statements rather