]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/common/rbbirpt.txt
ICU-64252.0.1.tar.gz
[apple/icu.git] / icuSources / common / rbbirpt.txt
index fa0dd35928d7014ffa0e91f7ee964fbb518b14ff..c27857eb2957f33636615d6f812e0fe1d443e606 100644 (file)
@@ -1,7 +1,13 @@
 
 #*****************************************************************************
 #
-#   Copyright (C) 2002, International Business Machines Corporation and others.
+#   Copyright (C) 2016 and later: Unicode, Inc. and others.
+#   License & terms of use: http://www.unicode.org/copyright.html#License
+#
+#*****************************************************************************
+#*****************************************************************************
+#
+#   Copyright (C) 2002-2016, International Business Machines Corporation and others.
 #   All Rights Reserved.
 #
 #*****************************************************************************
@@ -19,6 +25,7 @@
 #     This file is processed by a perl script "rbbicst.pl" to produce initialized C arrays
 #     that are then built with the rule parser.
 #
+#    perl rbbicst.pl    < rbbirpt.txt > rbbirpt.h
 
 #
 # Here is the syntax of the state definitions in this file:
@@ -57,8 +64,9 @@
 start:
     escaped                term                  ^break-rule-end    doExprStart                       
     white_space          n start                     
+    '^'                  n start-after-caret     ^break-rule-end    doNoChain
     '$'                    scan-var-name         ^assign-or-rule    doExprStart
-    '!'                  n reverse-rule                             doReverseDir
+    '!'                  n rev-option                             
     ';'                  n start                                                  # ignore empty rules.
     eof                    exit              
     default                term                  ^break-rule-end    doExprStart
@@ -71,11 +79,43 @@ break-rule-end:
     white_space          n break-rule-end
     default                errorDeath                               doRuleError
      
-
-#
-#   Reverse Rule    We've just scanned a '!', indicating a reverse direction rule.
-#                   A rule expression must follow.
 #
+# start of a rule, after having seen a '^' (inhibits rule chain in).
+#     Similar to the main 'start' state in most respects, except
+#          - empty rule is an error.
+#          - A second '^' is an error.
+#
+start-after-caret:
+    escaped                term                                     doExprStart
+    white_space          n start-after-caret
+    '^'                    errorDeath                               doRuleError    # two '^'s
+    '$'                    scan-var-name         ^term-var-ref      doExprStart
+    ';'                    errorDeath                               doRuleError    # ^ ;
+    eof                    errorDeath                               doRuleError
+    default                term                                     doExprStart
+#
+#   !               We've just scanned a '!', indicating either a !!key word flag or a
+#                   !Reverse rule.
+#
+rev-option:
+    '!'                  n option-scan1   
+    default                reverse-rule           ^break-rule-end   doReverseDir
+    
+option-scan1:
+    name_start_char      n option-scan2                             doOptionStart
+    default                errorDeath                               doRuleError
+    
+option-scan2:
+    name_char            n option-scan2
+    default                option-scan3                             doOptionEnd
+    
+option-scan3:
+    ';'                  n start 
+    white_space          n option-scan3 
+    default                errorDeath                               doRuleError 
+    
+
 reverse-rule:
     default                term                   ^break-rule-end   doExprStart