]> granicus.if.org Git - re2c/commitdiff
- Add docu
authorhelly <helly@642ea486-5414-0410-9d7f-a0204ed87703>
Sat, 15 Apr 2006 19:31:26 +0000 (19:31 +0000)
committerhelly <helly@642ea486-5414-0410-9d7f-a0204ed87703>
Sat, 15 Apr 2006 19:31:26 +0000 (19:31 +0000)
lessons/001_upn_calculator/calc_006.s.re

index 8e16b25d187482ad0f5d069d34fef88c6e542619..d7947ccf8e6da0ec23d5a41fa19b46acb00ff115 100755 (executable)
     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