| SM Ryan 2007-04-21, 4:13 am |
| \f7\i parameter
\f3\i0 , 0, 0);\
\f2\b
\f3\b0 \}\
\f2\b if
\f3\b0 (
\f7\i inputByte
\f3\i0 ==' ') shiftInputByte;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0 \{\
\f7\i tag
\f3\i0 [0] = '/';
\f7\i tag
\f3\i0 [1] =
\f7\i inputByte
\f3\i0 ;
\f7\i tag
\f3\i0 [2] = 0; shiftInputByte;\
\f2\b
\f3\b0 \}\
\f2\b if
\f3\b0 ('c2
\f7\i group
\f3\i0 ) \{\
\f2\b
\f3\b0 error("keyword is outside of any group: %s",
\f7\i tag
\f3\i0 );
\f2\b continue
\f3\b0 ;\
\f2\b
\f3\b0 \}
\f2\b else if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/deff")==0) \{\
\f2\b
\f7\i\b0 deff
\f3\i0 =
\f7\i param
\f3\i0 ;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/ansi")==0) \{\
\f2\b
\f3\b0 put("cpg", 0); put("#cpg", 0);\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/mac")==0) \{\
put("cpg", 10000); put("#cpg", 10000);\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/pc")==0) \{\
\f2\b
\f3\b0 put("cpg", 437); put("#cpg", 437);\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/pca")==0) \{\
\f2\b
\f3\b0 put("cpg", 850); put("#cpg", 850);\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/ansicpg")==0) \{\
\f2\b
\f3\b0 put("cpg",
\f7\i param
\f3\i0 ); put("#cpg",
\f7\i param
\f3\i0 );\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/cpg")==0) \{\
\f2\b
\f3\b0 put("cpg",
\f7\i param
\f3\i0 ); put("#cpg",
\f7\i param
\f3\i0 );\
\f2\b \
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/upr")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/ud")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/u")==0) \{\
\f2\b switch
\f3\b0 (
\f7\i param
\f3\i0 ) \{\
\f2\b case
\f3\b0 0x2028:
\f7\i param
\f3\i0 = '\\n';
\f2\b break
\f3\b0 ;\
\f2\b case
\f3\b0 0x2029:
\f7\i param
\f3\i0 = '\\n';
\f2\b break
\f3\b0 ;\
\f2\b case
\f3\b0 0x202A:
\f7\i param
\f3\i0 = ' ';
\f2\b break
\f3\b0 ;\
\f2\b case
\f3\b0 0x202B:
\f7\i param
\f3\i0 = ' ';
\f2\b break
\f3\b0 ;\
\f2\b case
\f3\b0 0x202C:
\f7\i param
\f3\i0 = ' ';
\f2\b break
\f3\b0 ;\
\f2\b case
\f3\b0 0x202D:
\f7\i param
\f3\i0 = ' ';
\f2\b break
\f3\b0 ;\
\f2\b case
\f3\b0 0x202E:
\f7\i param
\f3\i0 = ' ';
\f2\b break
\f3\b0 ;\
\f2\b case
\f3\b0 0x202F:
\f7\i param
\f3\i0 = ' ';
\f2\b break
\f3\b0 ;\
\f2\b
\f3\b0 \}\
\f2\b
\f7\i\b0 character
\f3\i0 =
\f7\i param
\f3\i0 ;
\f7\i unicode
\f3\i0 =
\f2\b true
\f3\b0 ;\
\f2\b int
\f3\b0
\f7\i skip
\f3\i0 = get("uc");\
\f2\b while
\f3\b0 (
\f7\i skip
\f3\i0 -->0) \{\
\f2\b if
\f3\b0 (
\f7\i inputByte
\f3\i0 ==EOS
\f6 \uc0\u8744
\f3
\f7\i inputByte
\f3\i0 ==EOI) \{\
\f2\b
\f3\b0 error("end of file in \\\\u skipped characters.");\
\f2\b break
\f3\b0 ;\
\f2\b
\f3\b0 \}\
\f2\b
\f3\b0 shiftInputByte;\
\f2\b
\f3\b0 \}\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/uc")==0) \{\
\f2\b
\f3\b0 put("uc",
\f7\i param
\f3\i0 ); put("#uc",
\f7\i param
\f3\i0 );\
\f2\b \
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/fonttbl")==0) \{\
put("f", -1); destinationControlWord;\
\f2\b \
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/colortbl")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/red")==0) \{\
\f2\b
\f3\b0 put("red",
\f7\i param
\f3\i0 );\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/green")==0) \{\
\f2\b
\f3\b0 put("green",
\f7\i param
\f3\i0 );\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/blue")==0) \{\
\f2\b
\f3\b0 put("blue",
\f7\i param
\f3\i0 );\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/cf")==0) \{\
\f2\b
\f3\b0 put("cf",
\f7\i param
\f3\i0 );\
\f2\b Colour
\f3\b0
\f7\i c
\f3\i0 = colour(
\f7\i param
\f3\i0 );\
\f2\b
\f3\b0 put("cf-red",
\f7\i c
\f6\i0 \uc0\u8594
\f7\i red
\f3\i0 );\
put("cf-green",
\f7\i c
\f6\i0 \uc0\u8594
\f7\i green
\f3\i0 );\
put("cf-blue",
\f7\i c
\f6\i0 \uc0\u8594
\f7\i blue
\f3\i0 ); \
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/cb")==0) \{\
\f2\b
\f3\b0 put("cb",
\f7\i param
\f3\i0 );\
\f2\b Colour
\f3\b0
\f7\i c
\f3\i0 = colour(
\f7\i param
\f3\i0 );\
\f2\b
\f3\b0 put("cb-red",
\f7\i c
\f6\i0 \uc0\u8594
\f7\i red
\f3\i0 );\
put("cb-green",
\f7\i c
\f6\i0 \uc0\u8594
\f7\i green
\f3\i0 );\
put("cb-blue",
\f7\i c
\f6\i0 \uc0\u8594
\f7\i blue
\f3\i0 ); \
\f2\b \
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/stylesheet")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b \
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/info")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/title")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/subject")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/author")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/manager")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/company")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/operator")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/category")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/keywords")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/comment")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/doccomm")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/hlinkbase")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/copyright")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/creatim")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/buptim")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/printim")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/revtim")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b \
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/propname")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b \
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/private")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b \
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/ftnsep")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/ftnsepc")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/ftncn")==0) \{ \
\f2\b
\f3\b0 destinationControlWord;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/aftnsep")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/aftnsepc")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/aftncn")==0) \{ \
\f2\b
\f3\b0 destinationControlWord;\
\f2\b \
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/header")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/footer")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/headerl")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/headerr")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/headerf")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/footerl")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/footerr")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/footerf")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b \
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/ql")==0) \{\
\f2\b
\f3\b0 put("q", 'l');\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/qr")==0) \{\
\f2\b
\f3\b0 put("q", 'r');\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/qj")==0) \{\
\f2\b
\f3\b0 put("q", 'j');\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/qc")==0) \{\
\f2\b
\f3\b0 put("q", 'c');\
\f2\b \
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/fi")==0) \{\
\f2\b
\f3\b0 put("fi",
\f7\i param
\f3\i0 );\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/li")==0) \{\
\f2\b
\f3\b0 put("li",
\f7\i param
\f3\i0 );\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/ri")==0) \{\
\f2\b
\f3\b0 put("ri",
\f7\i param
\f3\i0 );\
\f2\b \
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/sb")==0) \{\
\f2\b
\f3\b0 put("sb",
\f7\i param
\f3\i0 );\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/sa")==0) \{\
\f2\b
\f3\b0 put("sa",
\f7\i param
\f3\i0 );\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/sl")==0) \{\
\f2\b
\f3\b0 put("sl",
\f7\i param
\f3\i0 );\
\f2\b \
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/pntext")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/pntxb")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/pntxa")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/pntext")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/pn")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b \
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/plain")==0) \{\
\f2\b
\f3\b0 put("b", 0); put("i", 0);\
put("uc", 0); put("cpg", 0);\
\f2\b
\f3\b0 put("#b", 0); put("#i", 0);\
put("#uc", 0); put("#cpg", 0);\
\f2\b
\f3\b0 put("<baseline>", 0);\
\f2\b
\f3\b0 put("f", -1);\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/b")==0) \{\
\f2\b
\f3\b0 put("b",
\f7\i hasparam
\f3\i0 ?
\f7\i param
\f3\i0 : 1); put("#b",
\f7\i hasparam
\f3\i0 ?
\f7\i param
\f3\i0 : 1);\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/caps")==0) \{\
\f2\b
\f3\b0 put("caps",
\f7\i hasparam
\f3\i0 ?
\f7\i param
\f3\i0 : 1);\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/charscalex")==0) \{\
\f2\b
\f3\b0 put("charscalex",
\f7\i param
\f3\i0 );\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/deleted")==0) \{\
\f2\b
\f3\b0 put("deleted",
\f7\i hasparam
\f3\i0 ?
\f7\i param
\f3\i0 : 1);\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/dn")==0) \{\
\f2\b
\f3\b0 put("dn",
\f7\i param
\f3\i0 );\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/embo")==0) \{\
\f2\b
\f3\b0 put("embo",
\f7\i hasparam
\f3\i0 ?
\f7\i param
\f3\i0 : 1);\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/impr")==0) \{\
\f2\b
\f3\b0 put("impr",
\f7\i hasparam
\f3\i0 ?
\f7\i param
\f3\i0 : 1);\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/sub")==0) \{\
\f2\b
\f3\b0 put("<baseline>",
\f7\i hasparam
\f3\i0 ? -
\f7\i param
\f3\i0 : -1);\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/nosupersub")==0) \{\
\f2\b
\f3\b0 put("<baseline>", 0);\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/expnd")==0) \{\
\f2\b
\f3\b0 put("expnd",
\f7\i param
\f3\i0 );\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/expndtw")==0) \{\
\f2\b
\f3\b0 put("expndtw",
\f7\i param
\f3\i0 );\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/kerning")==0) \{\
\f2\b
\f3\b0 put("kerning",
\f7\i param
\f3\i0 );\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/f")==0) \{\
\f2\b if
\f3\b0 (strcmp(
\f7\i groupdest
\f3\i0 , "fonttbl")==0) \{\
\f2\b
\f3\b0 put("f",
\f7\i param
\f3\i0 );\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0 \{\
\f2\b if
\f3\b0 (
\f7\i param
\f3\i0 <0)
\f7\i param
\f3\i0 =
\f7\i deff
\f3\i0 ;\
put("f",
\f7\i param
\f3\i0 );\
\f2\b Font
\f7\i\b0 f
\f3\i0 = font(param);\
mergeGroupAndFontProperties;\
\pard\tx360\tx720\tx1080\tx1440\tx1800\t
x2160\tx2520\tx2880\tx3240\tx3600\tx3960
\tx4320\tx4680\tx5040\tx5400\tx5760\tx61
20\tx6480\tx6840\tx7200\tx7560\tx7920\tx
8280\tx8640\ql\qnatural\pardirnatural
\f7\i \cf0
\f3\i0 put("<codefont>",
\f7\i f
\f6\i0 \uc0\u8594
\f7\i codefont
\f3\i0 );\
\pard\tx360\tx720\tx1080\tx1440\tx1800\t
x2160\tx2520\tx2880\tx3240\tx3600\tx3960
\tx4320\tx4680\tx5040\tx5400\tx5760\tx61
20\tx6480\tx6840\tx7200\tx7560\tx7920\tx
8280\tx8640\ql\qnatural\pardirnatural
\f2\b \cf0
\f3\b0 \}\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/fs")==0) \{\
\f2\b
\f3\b0 put("fs",
\f7\i param
\f3\i0 );\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/i")==0) \{\
\f2\b
\f3\b0 put("i",
\f7\i hasparam
\f3\i0 ?
\f7\i param
\f3\i0 : 1); put("#i",
\f7\i hasparam
\f3\i0 ?
\f7\i param
\f3\i0 : 1);\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/outl")==0) \{\
\f2\b
\f3\b0 put("outl",
\f7\i hasparam
\f3\i0 ?
\f7\i param
\f3\i0 : 1);\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/scaps")==0) \{\
\f2\b
\f3\b0 put("scaps",
\f7\i hasparam
\f3\i0 ?
\f7\i param
\f3\i0 : 1);\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/shad")==0) \{\
\f2\b
\f3\b0 put("shad",
\f7\i hasparam
\f3\i0 ?
\f7\i param
\f3\i0 : 1);\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/strike")==0) \{\
\f2\b
\f3\b0 put("strike",
\f7\i hasparam
\f3\i0 ?
\f7\i param
\f3\i0 : 1);\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/strikedl")==0) \{\
\f2\b
\f3\b0 put("strikedl",
\f7\i hasparam
\f3\i0 ?
\f7\i param
\f3\i0 : 1);\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/ul")==0) \{\
\f2\b
\f3\b0 put("ul",
\f7\i hasparam
\f3\i0 ?
\f7\i param
\f3\i0 : 1);\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/uld")==0) \{\
\f2\b
\f3\b0 put("ul", 2);\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/uldash")==0) \{\
\f2\b
\f3\b0 put("ul", 3);\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/uldashd")==0) \{\
\f2\b
\f3\b0 put("ul", 4);\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/uldashdd")==0) \{\
\f2\b
\f3\b0 put("ul", 5);\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/uldb")==0) \{\
\f2\b
\f3\b0 put("ul", 6);\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/ulnone")==0) \{\
\f2\b
\f3\b0 put("ul", 0);\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/ulth")==0) \{\
\f2\b
\f3\b0 put("ul", 7);\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/ulw")==0) \{\
\f2\b
\f3\b0 put("ul", 8);\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/ulwave")==0) \{\
\f2\b
\f3\b0 put("ul", 9);\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/up")==0) \{\
\f2\b
\f3\b0 put("up",
\f7\i param
\f3\i0 );\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/super")==0) \{\
\f2\b
\f3\b0 put("<baseline>",
\f7\i hasparam
\f3\i0 ?
\f7\i param
\f3\i0 : 1);\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/v")==0) \{\
\f2\b
\f3\b0 put("v",
\f7\i hasparam
\f3\i0 ?
\f7\i param
\f3\i0 : 1);\
\f2\b \
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/tab")==0) \{\
\f2\b
\f7\i\b0 character
\f3\i0 = 0x09;
\f7\i unicode
\f3\i0 =
\f2\b true
\f3\b0 ;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/emdash")==0) \{\
\f2\b
\f7\i\b0 character
\f3\i0 = 0x2014;
\f7\i unicode
\f3\i0 =
\f2\b true
\f3\b0 ;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/endash")==0) \{\
\f2\b
\f7\i\b0 character
\f3\i0 = 0x2013;
\f7\i unicode
\f3\i0 =
\f2\b true
\f3\b0 ;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/emspace")==0) \{\
\f2\b
\f7\i\b0 character
\f3\i0 = 0x2003;
\f7\i unicode
\f3\i0 =
\f2\b true
\f3\b0 ;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/enspace")==0) \{\
\f2\b
\f7\i\b0 character
\f3\i0 = 0x2002;
\f7\i unicode
\f3\i0 =
\f2\b true
\f3\b0 ;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/bullet")==0) \{\
\f2\b
\f7\i\b0 character
\f3\i0 = 0x2022;
\f7\i unicode
\f3\i0 =
\f2\b true
\f3\b0 ;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/lquote")==0) \{\
\f2\b
\f7\i\b0 character
\f3\i0 = 0x2018;
\f7\i unicode
\f3\i0 =
\f2\b true
\f3\b0 ;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/rquote")==0) \{\
\f2\b
\f7\i\b0 character
\f3\i0 = 0x2019;
\f7\i unicode
\f3\i0 =
\f2\b true
\f3\b0 ;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/ldblquote")==0) \{\
\f2\b
\f7\i\b0 character
\f3\i0 = 0x201C;
\f7\i unicode
\f3\i0 =
\f2\b true
\f3\b0 ;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/rdblquote")==0) \{\
\f2\b
\f7\i\b0 character
\f3\i0 = 0x201D;
\f7\i unicode
\f3\i0 =
\f2\b true
\f3\b0 ;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/~")==0) \{\
\f2\b
\f7\i\b0 character
\f3\i0 = 0x00A0;
\f7\i unicode
\f3\i0 =
\f2\b true
\f3\b0 ;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/-")==0) \{\
\f2\b
\f7\i\b0 character
\f3\i0 = '-';
\f7\i unicode
\f3\i0 =
\f2\b true
\f3\b0 ;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/_")==0) \{\
\f2\b
\f7\i\b0 character
\f3\i0 = '-';
\f7\i unicode
\f3\i0 =
\f2\b true
\f3\b0 ;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/'")==0) \{\
\f2\b int
\f3\b0
\f7\i x1
\f3\i0 =
\f7\i inputByte
\f3\i0 ; shiftInputByte;\
\f2\b int
\f3\b0
\f7\i x2
\f3\i0 = isxdigit(
\f7\i x1
\f3\i0 ) ?
\f7\i inputByte
\f3\i0 : 0; shiftInputByte;\
\f2\b char
\f3\b0
\f7\i x
\f3\i0 [3] = \{
\f7\i x1
\f3\i0 ,
\f7\i x2
\f3\i0 , 0\};\
\f2\b
\f3\b0 shiftInputByte;\
\f2\b if
\f3\b0 (isxdigit(
\f7\i x1
\f3\i0 )
\f6 \uc0\u8743
\f3 isxdigit(
\f7\i x2
\f3\i0 )) \{\
\f2\b
\f7\i\b0 character
\f3\i0 = strtol(
\f7\i x
\f3\i0 , 0, 16);
\f7\i unicode
\f3\i0 =
\f2\b false
\f3\b0 ;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0 \{\
\f2\b
\f3\b0 error("bad hexidecimal: %s.",
\f7\i x
\f3\i0 );\
\f2\b
\f3\b0 \}\
\f2\b \
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/pict")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/bin")==0) \{\
\f2\b int
\f3\b0
\f7\i i
\f3\i0 ;
\f2\b for
\f3\b0 (
\f7\i i
\f3\i0 =0;
\f7\i i
\f3\i0 <
\f7\i param
\f3\i0 ;
\f7\i i
\f3\i0 ++) \{\
\f2\b if
\f3\b0 (
\f7\i inputByte
\f3\i0 ==EOS
\f6 \uc0\u8744
\f3
\f7\i inputByte
\f3\i0 ==EOI) \{\
\f2\b
\f3\b0 error("end of file in binary text.");\
\f2\b break
\f3\b0 ;\
\f2\b
\f3\b0 \}\
\f2\b
\f3\b0 shiftInputByte;\
\f2\b
\f3\b0 \}\
\f2\b \
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/object")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/result")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b \
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/shp")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/shptxt")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/shpgrp")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b \
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/footnote")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b \
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/field")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/fldrslt")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b \
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/xe")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/txe")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/rxe")==0) \{\
\f2\b
\f3\b0 destinationControlWord;\
\f2\b \
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/tc")==0) \{ \
\f2\b
\f3\b0 destinationControlWord;\
\f2\b \
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/\\n")==0) \{\
strcpy(
\f7\i tag
\f3\i0 , "/LF");\
\f2\b
\f7\i\b0 character
\f3\i0 = '\\n';
\f7\i unicode
\f3\i0 =
\f2\b true
\f3\b0 ;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/\\r")==0) \{ \
strcpy(
\f7\i tag
\f3\i0 , "/CR");\
\f2\b
\f7\i\b0 character
\f3\i0 = 0;
\f7\i unicode
\f3\i0 =
\f2\b false
\f3\b0 ;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/\\x7b")==0) \{\
strcpy(
\f7\i tag
\f3\i0 , "/LB");\
\f2\b
\f7\i\b0 character
\f3\i0 = '\{';
\f7\i unicode
\f3\i0 =
\f2\b true
\f3\b0 ;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/\\x7d")==0) \{\
strcpy(
\f7\i tag
\f3\i0 , "/RB");\
\f2\b
\f7\i\b0 character
\f3\i0 = '\}';
\f7\i unicode
\f3\i0 =
\f2\b true
\f3\b0 ;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/\\\\")==0) \{\
strcpy(
\f7\i tag
\f3\i0 , "/BS");\
\f2\b
\f7\i\b0 character
\f3\i0 = '\\\';
\f7\i unicode
\f3\i0 =
\f2\b true
\f3\b0 ;\
\f2\b \
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/NeXTGraphic")==0) \{\
destinationControlWord;\
if (group
\f6 \uc0\u8594
\f3 link) strcpy(
\f7\i group
\f6\i0 \uc0\u8594
\f3 link
\f6 \uc0\u8594
\f7\i dest
\f3\i0 , "NeXTGraphicAC");\
\f2\b \
\f3\b0 \}
\f2\b else
\f3\b0 groupDestinationAfterAsterisk\
\f2\b
\f3\b0 \}
\f2\b break
\f3\b0 ;\
\f2\b case
\f3\b0 '\\n':\
strcpy(tag, "LF");\
\f7\i character
\f3\i0 = 0;\
\f2\b
\f7\i\b0 unicode
\f3\i0 =
\f2\b false
\f3\b0 ;\
\f2\b
\f3\b0 shiftInputByte;\
\f2\b break
\f3\b0 ;\
\f2\b case
\f3\b0 '\\r':\
strcpy(tag, "CR");\
\f7\i character
\f3\i0 = 0;\
\f2\b
\f7\i\b0 unicode
\f3\i0 =
\f2\b false
\f3\b0 ;\
\f2\b
\f3\b0 shiftInputByte;\
\f2\b break
\f3\b0 ;\
\f2\b case
\f3\b0 ';':\
\f2\b if
\f3\b0 (strcmp(
\f7\i groupdest
\f3\i0 , "fonttbl")==0) \{\
strcpy(tag, "SEMI");\
\f2\b
\f3\b0 fontCreate();\
\f2\b
\f3\b0 shiftInputByte;\
\f2\b break
\f3\b0 ;\
\f2\b
\f3\b0 \}
\f2\b else
\f3\b0
\f2\b if
\f3\b0 (strcmp(
\f7\i groupdest
\f3\i0 , "colortbl")==0) \{\
strcpy(tag, "SEMI");\
\f2\b
\f3\b0 colourCreate();\
\f2\b
\f3\b0 shiftInputByte;\
\f2\b break
\f3\b0 ;\
\f2\b
\f3\b0 \}\
\f2\b default
\f3\b0 :\
strcpy(tag, "CHAR");\
\f2\b
\f7\i\b0 character
\f3\i0 =
\f7\i inputByte
\f3\i0 ;\
\f2\b
\f7\i\b0 unicode
\f3\i0 =
\f2\b false
\f3\b0 ;\
\f2\b
\f3\b0 shiftInputByte;\
\f2\b break
\f3\b0 ;\
\f2\b
\f3\b0 \}\
ignoreMisplacedAsteriskDestination;\
RTFParseTrace;\
RTFDeconstructor;\
\f2\b
\f3\b0 \}\
\f2\b <>
\f3\b0 \
\pard\tx1080\tx1440\tx1800\tx2160\tx2520
\tx2880\tx3240\tx3600\tx3960\tx4320\tx46
80\tx5040\tx5400\tx5760\tx6120\tx6480\tx
6840\tx7200\tx7560\tx7920\tx8280\tx8640\
li720\ql\qnatural\pardirnatural
\f1 \cf0 \
\pard\tx360\tx720\tx1080\tx1440\tx1800\t
x2160\tx2520\tx2880\tx3240\tx3600\tx3960
\tx4320\tx4680\tx5040\tx5400\tx5760\tx61
20\tx6480\tx6840\tx7200\tx7560\tx7920\tx
8280\tx8640\ql\qnatural\pardirnatural
\f2\b \cf0 <
\f3\b0 RTFParseTraceVariables
\f2\b >\
\f3\b0
\f2\b char
\f3\b0
\f7\i tag
\f3\i0 [50];
\f2\b bool
\f3\b0
\f7\i hasparam
\f3\i0 =
\f2\b false
\f3\b0 ;
\f2\b long
\f3\b0
\f7\i param
\f3\i0 = 0\
\f2\b <>\
<
\f3\b0 RTFParseTrace
\f2\b >\
\f3\b0 trace("r[%s:%d] %s param=%d %d %04X %c%c %c dest=%s"\
" b%d i%d baseline%+d uc%d f%d",\
\f7\i currdoc
\f3\i0 ,
\f7\i lp
\f3\i0 ,\
\f7\i tag
\f3\i0 ,\
\f7\i hasparam
\f3\i0 ,
\f7\i param
\f3\i0 ,\
\f7\i character
\f3\i0 ,
\f7\i unicode
\f3\i0 ?'U':'E',\
get("<codefont>")?'C':'F',\
' ''b2
\f7\i character
\f3\i0
\f6 \uc0\u8743
\f3
\f7\i character
\f3\i0 <127 ?
\f7\i character
\f3\i0 : '.',\
\f7\i groupdest
\f3\i0 , get("b"), get("i"),\
get("<baseline>"), get("uc"), get("f"));\
\f2\b <>\
\pard\tx1080\tx1440\tx1800\tx2160\tx2520
\tx2880\tx3240\tx3600\tx3960\tx4320\tx46
80\tx5040\tx5400\tx5760\tx6120\tx6480\tx
6840\tx7200\tx7560\tx7920\tx8280\tx8640\
li720\ql\qnatural\pardirnatural
\f1\b0 \cf0 \
\pard\tx360\tx720\tx1080\tx1440\tx1800\t
x2160\tx2520\tx2880\tx3240\tx3600\tx3960
\tx4320\tx4680\tx5040\tx5400\tx5760\tx61
20\tx6480\tx6840\tx7200\tx7560\tx7920\tx
8280\tx8640\qr\pardirnatural
\f0\b\fs26 \cf0 3.8 RTF Deconstruction\
\pard\tx360\tx720\tx1080\tx1440\tx1800\t
x2160\tx2520\tx2880\tx3240\tx3600\tx3960
\tx4320\tx4680\tx5040\tx5400\tx5760\tx61
20\tx6480\tx6840\tx7200\tx7560\tx7920\tx
8280\tx8640\ql\qnatural\pardirnatural
\f1\b0\fs24 \cf0 \
\pard\tx1080\tx1440\tx1800\tx2160\tx2520
\tx2880\tx3240\tx3600\tx3960\tx4320\tx46
80\tx5040\tx5400\tx5760\tx6120\tx6480\tx
6840\tx7200\tx7560\tx7920\tx8280\tx8640\
li720\ql\qnatural\pardirnatural
\cf0 Write RTF on stdout as control words and attributed text. Each line is a name/value pairs list (such as the return value of
\f0\b array get
\f1\b0 ):\
\pard\tx4320\li4320\fi-2880\ql\qnatural\pardirnatural
\cf0 <tag> EOS 'd1'caend of source document\
BEGIN 'd1'cabegin a group "\{".\
END 'd1'caend a group "\}".\
/
\f4\i word
\f1\i0 'd1'cacontrol word \\
\f4\i controlword.
\f1\i0 \
/
\f4\i X
\f1\i0 'd1'cacontrol symbol for non-letter case
\f4\i X.\
\f1\i0 /LF 'd1 Literal linefeed.\
/CR 'd1 Literal carriage return.\
/LB 'd1 Literal left brace "\{".\
/RB 'd1 Literal right brace "\}".\
/BS 'd1 Literal back slash "\\".\
LF 'd1 Ignored linefeed.\
CR 'd1 Ignored carriage return.\
SEMI 'd1 Semicolon used to separate group declarations.\
CHAR 'd1 Text character.\
<bytecode> Text character code (as an integer) if CHAR or \'
\f4\i xx
\f1\i0 .\
<unicode> Unicode character code (as an integer). This appears for CHAR and any other tag that stands for one character (/LF, /CR, /LB, /RB, /RS, some /
\f4\i word
\f1\i0 or /
\f4\i X
\f1\i0 ). The list will not have <bytecode> or <unicode> if it has no visible character. <bytecode> is the original RTF character code in its codepage; <unicode> is present if <bytecode> is present, but a character can also have <unicode> alone.\
<hasparam> 1 if the RTF tag had a parameter (\\
\f4\i wordN
\f1\i0 ), otherwise 0.\
<param> Parameter value as a long integer. This may be nonzero even if not <hasparam>.\
<document> Source document path.\
<lp> Source document line number.\
<dest> Group destination.\
<longname> Long font name for the current font.\
<familyname> Abbreviated font family name for the current font.\
<fontname> Abbreviated font name for the current font.\
<baseline> 0 for at baseline; +
\f4\i n
\f1\i0 for
\f4\i n
\f1\i0 th level superscript; and -
\f4\i n
\f1\i0 for
\f4\i n
\f1\i0 th level subscript.\
<codefont> 1 if the font is a code font, otherwise 0.\
cf-red Red component of \\cf
\f4\i N
\f1\i0 .\
cf-green Green component of \\cf
\f4\i N
\f1\i0 .\
cf-blue Blue component of \\cf
\f4\i N
\f1\i0 .\
cb-red Red component of \\cb
\f4\i N
\f1\i0 .\
cb-green Green component of \\cb
\f4\i N
\f1\i0 .\
cb-blue Blue component of \\cb
\f4\i N
\f1\i0 .\
q Character code of "l", "r", "j", or "c".\
\f4\i word
\f1\i0 Value of \\
\f4\i word
\f1\i0 for this or an enclosing group.\
\pard\tx360\tx720\tx1080\tx1440\tx1800\t
x2160\tx2520\tx2880\tx3240\tx3600\tx3960
\tx4320\tx4680\tx5040\tx5400\tx5760\tx61
20\tx6480\tx6840\tx7200\tx7560\tx7920\tx
8280\tx8640\ql\qnatural\pardirnatural
\f2\b \cf0 \
<
\f3\b0 RTFDeconstructor
\f2\b >\
\f3\b0
\f2\b if
\f3\b0 (
\f7\i process
\f3\i0 =='r') \{\
\f2\b if
\f3\b0 (
\f7\i character
\f3\i0 ==EOI) \{\
\f7\i s
\f3\i0 = FINAL;\
\f2\b continue
\f3\b0 ;\
\}\
\f2\b Obj
\f3\b0
\f7\i L
\f3\i0 [] = \{\
Tcl_NewStringObj("<tag>",-1),\
Tcl_NewStringObj(
\f7\i tag
\f3\i0 ,-1),\
Tcl_NewStringObj("<hasparam>",-1),\
Tcl_NewBooleanObj(
\f7\i hasparam
\f3\i0 ),\
Tcl_NewStringObj("<param>",-1),\
Tcl_NewLongObj(
\f7\i param
\f3\i0 ),\
Tcl_NewStringObj("<document>",-1),\
Tcl_NewStringObj(currdoc,-1),\
Tcl_NewStringObj("<lp>",-1),\
Tcl_NewLongObj(
\f7\i lp
\f3\i0 ),\
\};\
\f2\b Obj
\f3\b0
\f7\i cons
\f3\i0 = incr(Tcl_NewListObj(10,
\f7\i L
\f3\i0 ));\
\f2\b if
\f3\b0 (
\f7\i character
\f3\i0 ) \{\
\f2\b if
\f3\b0 (
\f7\i unicode
\f3\i0 ) \{\
Tcl_ListObjAppendElement(0,
\f7\i cons
\f3\i0 , Tcl_NewStringObj("<unicode>", -1));\
Tcl_ListObjAppendElement(0,
\f7\i cons
\f3\i0 , Tcl_NewIntObj(
\f7\i character
\f3\i0 ));\
\}
\f2\b else
\f3\b0 \{\
Tcl_ListObjAppendElement(0,
\f7\i cons
\f3\i0 , Tcl_NewStringObj("<bytecode>", -1));\
Tcl_ListObjAppendElement(0,
\f7\i cons
\f3\i0 , Tcl_NewIntObj(
\f7\i character
\f3\i0 ));\
translateCharacterIntoUnicode;\
Tcl_ListObjAppendElement(0,
\f7\i cons
\f3\i0 , Tcl_NewStringObj("<unicode>", -1));\
Tcl_ListObjAppendElement(0,
\f7\i cons
\f3\i0 , Tcl_NewIntObj(
\f7\i character
\f3\i0 ));\
\}\
\}\
\f2\b if
\f3\b0 (
\f7\i group
\f3\i0 ) \{\
Tcl_ListObjAppendElement(0,
\f7\i cons
\f3\i0 , Tcl_NewStringObj("<dest>", -1));\
Tcl_ListObjAppendElement(0,
\f7\i cons
\f3\i0 , Tcl_NewStringObj(
\f7\i groupdest
\f3\i0 , -1));\
\f2\b Tcl_HashSearch
\f3\b0
\f7\i S
\f3\i0 ;
\f2\b Tcl_HashEntry
\f3\b0 *
\f7\i e
\f3\i0 ;\
\f2\b for
\f3\b0 (
\f7\i e
\f3\i0 =Tcl_FirstHashEntry(&
\f7\i group
\f6\i0 \uc0\u8594
\f7\i dict
\f3\i0 , &
\f7\i S
\f3\i0 );
\f7\i e
\f3\i0 ;
\f7\i e
\f3\i0 =Tcl_NextHashEntry(&
\f7\i S
\f3\i0 )) \{\
\f2\b chars
\f3\b0
\f7\i key
\f3\i0 = Tcl_GetHashKey(&
\f7\i group
\f6\i0 \uc0\u8594
\f7\i dict
\f3\i0 ,
\f7\i e
\f3\i0 );\
\f2\b long
\f3\b0
\f7\i value
\f3\i0 = (
\f2\b long
\f3\b0 )Tcl_GetHashValue(
\f7\i e
\f3\i0 );\
\f2\b if
\f3\b0 (*
\f7\i key
\f3\i0 'ad'#') \{\
Tcl_ListObjAppendElement(0,
\f7\i cons
\f3\i0 , Tcl_NewStringObj(
\f7\i key
\f3\i0 , -1));\
Tcl_ListObjAppendElement(0,
\f7\i cons
\f3\i0 , Tcl_NewLongObj(
\f7\i value
\f3\i0 ));\
\}\
\}\
\f2\b Font
\f3\b0
\f7\i f
\f3\i0 = font(get("f"));\
Tcl_ListObjAppendElement(0,
\f7\i cons
\f3\i0 , Tcl_NewStringObj("<longname>", -1));\
Tcl_ListObjAppendElement(0,
\f7\i cons
\f3\i0 , Tcl_NewStringObj(
\f7\i f
\f6\i0 \uc0\u8594
\f7\i longname
\f3\i0 , -1));\
Tcl_ListObjAppendElement(0,
\f7\i cons
\f3\i0 , Tcl_NewStringObj("<familyname>", -1));\
Tcl_ListObjAppendElement(0,
\f7\i cons
\f3\i0 , Tcl_NewStringObj(
\f7\i f
\f6\i0 \uc0\u8594
\f7\i familyname
\f3\i0 , -1));\
Tcl_ListObjAppendElement(0,
\f7\i cons
\f3\i0 , Tcl_NewStringObj("<fontname>", -1));\
Tcl_ListObjAppendElement(0,
\f7\i cons
\f3\i0 , Tcl_NewStringObj(
\f7\i f
\f6\i0 \uc0\u8594
\f7\i fontname
\f3\i0 , -1));\
\}\
cprintf(
\f7\i chstdout
\f3\i0 ,"%s\\n", Tcl_GetString(
\f7\i cons
\f3\i0 )); decr(
\f7\i cons
\f3\i0 );
\f2\b \
\f3\b0
\f2\b if
\f3\b0 (
\f7\i character
\f3\i0 ==EOS) \{\
endDocument;\
\}\
\}\
\f2\b <>\
\pard\tx360\tx720\tx1080\tx1440\tx1800\t
x2160\tx2520\tx2880\tx3240\tx3600\tx3960
\tx4320\tx4680\tx5040\tx5400\tx5760\tx61
20\tx6480\tx6840\tx7200\tx7560\tx7920\tx
8280\tx8640\ql\qnatural\pardirnatural
\f0\fs28 \cf0 \
\pard\tx360\tx720\tx1080\tx1440\tx1800\t
x2160\tx2520\tx2880\tx3240\tx3600\tx3960
\tx4320\tx4680\tx5040\tx5400\tx5760\tx61
20\tx6480\tx6840\tx7200\tx7560\tx7920\tx
8280\tx8640\qr\pardirnatural
\fs26 \cf0 3.9 RTF Reconstruction\
\pard\tx360\tx720\tx1080\tx1440\tx1800\t
x2160\tx2520\tx2880\tx3240\tx3600\tx3960
\tx4320\tx4680\tx5040\tx5400\tx5760\tx61
20\tx6480\tx6840\tx7200\tx7560\tx7920\tx
8280\tx8640\ql\qnatural\pardirnatural
\f1\b0\fs24 \cf0 \
\pard\tx1080\tx1440\tx1800\tx2160\tx2520
\tx2880\tx3240\tx3600\tx3960\tx4320\tx46
80\tx5040\tx5400\tx5760\tx6120\tx6480\tx
6840\tx7200\tx7560\tx7920\tx8280\tx8640\
li720\ql\qnatural\pardirnatural
\cf0 Construct RTF on stdout, reading an
\f0\b renee
\f1\b0
\f0\b -r
\f1\b0 parse (possibly editted) from stdin. RTF reconstruction only considers the attributes: <tag>, <hasparam>, <param>, and <bytecode>.\
\pard\tx360\tx720\tx1080\tx1440\tx1800\t
x2160\tx2520\tx2880\tx3240\tx3600\tx3960
\tx4320\tx4680\tx5040\tx5400\tx5760\tx61
20\tx6480\tx6840\tx7200\tx7560\tx7920\tx
8280\tx8640\ql\qnatural\pardirnatural
\f2\b \cf0 \
<
\f3\b0 RTFReconstructor
\f2\b >\
Obj
\f7\i\b0 line
\f3\i0 = incr(Tcl_NewObj());
\f2\b bool
\f3\b0
\f7\i tagged
\f3\i0 =
\f2\b false
\f3\b0 ;\
\f2\b while
\f3\b0 (Tcl_SetObjLength(
\f7\i line
\f3\i0 , 0), Tcl_GetsObj(
\f7\i chstdin
\f3\i0 ,
\f7\i line
\f3\i0 )'b30) \{\
\f2\b int
\f3\b0
\f7\i N
\f3\i0 ;
\f2\b Obj
\f3\b0 *
\f7\i P
\f3\i0 ;\
\f2\b if
\f3\b0 (Tcl_ListObjGetElements(0, line, &N, &P)==TCL_OK) \{\
\f2\b chars
\f3\b0
\f7\i tag
\f3\i0 = 0;
\f2\b int
\f3\b0
\f7\i hasparam
\f3\i0 =
\f2\b false
\f3\b0 ;
\f2\b long
\f3\b0
\f7\i param
\f3\i0 = 0;
\f2\b int
\f3\b0
\f7\i character
\f3\i0 = 0;
\f2\b \
int
\f3\b0
\f7\i i
\f3\i0 ;
\f2\b for
\f3\b0 (i=0; i+1<N; i+=2) \{\
\f2\b chars
\f3\b0
\f7\i p
\f3\i0 = Tcl_GetString(
\f7\i P
\f3\i0 [
\f7\i i
\f3\i0 ]);
\f2\b Obj
\f3\b0
\f7\i v
\f3\i0 =
\f7\i P
\f3\i0 [
\f7\i i
\f3\i0 +1];\
\f2\b if
\f3\b0 (strcmp(
\f7\i p
\f3\i0 , "<tag>")==0) \{\
\f7\i tag
\f3\i0 = Tcl_GetString(
\f7\i v
\f3\i0 );\
\}
\f2\b else if
\f3\b0 (strcmp(
\f7\i p
\f3\i0 , "<hasparam>")==0) \{\
\f2\b if
\f3\b0 (Tcl_GetBooleanFromObj(0,
\f7\i v
\f3\i0 , &
\f7\i hasparam
\f3\i0 )'adTCL_OK) \{\
cprintf(
\f7\i chstderr
\f3\i0 ,"bad hasparam: %s: %s\\n",\
Tcl_GetString(
\f7\i v
\f3\i0 ), Tcl_GetString(
\f7\i line
\f3\i0 ));\
\}\
\}
\f2\b else if
\f3\b0 (strcmp(
\f7\i p
\f3\i0 , "<param>")==0) \{\
\f2\b if
\f3\b0 (Tcl_GetLongFromObj(0,
\f7\i v
\f3\i0 , &
\f7\i param
\f3\i0 )'adTCL_OK) \{\
cprintf(
\f7\i chstderr
\f3\i0 ,"bad param: %s: %s\\n",\
Tcl_GetString(
\f7\i v
\f3\i0 ), Tcl_GetString(
\f7\i line
\f3\i0 ));\
\}\
\}
\f2\b else if
\f3\b0 (strcmp(
\f7\i p
\f3\i0 , "<bytecode>")==0) \{\
\f2\b if
\f3\b0 (Tcl_GetIntFromObj(0,
\f7\i v
\f3\i0 , &
\f7\i character
\f3\i0 )'adTCL_OK) \{\
cprintf(
\f7\i chstderr
\f3\i0 ,"bad character bytecode: %s: %s\\n",\
Tcl_GetString(
\f7\i v
\f3\i0 ), Tcl_GetString(
\f7\i line
\f3\i0 ));\
\}\
\}\
\}\
\f2\b if
\f3\b0 ('c2tag) \{\
cprintf(
\f7\i chstderr
\f3\i0 ,"missing tag: %s\\n", Tcl_GetString(
\f7\i line
\f3\i0 ));\
\}
\f2\b else if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "CHAR")==0) \{\
\f2\b if
\f3\b0 (
\f7\i tagged
\f3\i0
\f6 \uc0\u8743
\f3 (isspace(
\f7\i character
\f3\i0 )
\f6 \uc0\u8744
\f3 isalnum(
\f7\i character
\f3\i0 ))) cprintf(
\f7\i chstdout
\f3\i0 ," ");\
cprintf(
\f7\i chstdout
\f3\i0 , "%c",
\f7\i character
\f3\i0 );\
\f7\i tagged
\f3\i0 =
\f2\b false
\f3\b0 ;\
\}
\f2\b else if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "EOS")==0) \{\
\f7\i tagged
\f3\i0 =
\f2\b false
\f3\b0 ;\
\}
\f2\b else if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "EOI")==0) \{\
\f7\i tagged
\f3\i0 =
\f2\b false
\f3\b0 ;\
\}
\f2\b else if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "BEGIN")==0) \{\
cprintf(
\f7\i chstdout
\f3\i0 , "\{");\
\f7\i tagged
\f3\i0 =
\f2\b false
\f3\b0 ;\
\}
\f2\b else if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/LB")==0) \{\
cprintf(
\f7\i chstdout
\f3\i0 , "\\\\\{");\
\f7\i tagged
\f3\i0 =
\f2\b false
\f3\b0 ;\
\}
\f2\b else if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "END")==0) \{\
cprintf(
\f7\i chstdout
\f3\i0 , "\}");\
\f7\i tagged
\f3\i0 =
\f2\b false
\f3\b0 ;\
\}
\f2\b else if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "RB")==0) \{\
cprintf(
\f7\i chstdout
\f3\i0 , "\\\\\}");\
\f7\i tagged
\f3\i0 =
\f2\b false
\f3\b0 ;\
\}
\f2\b else if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/LF")==0) \{\
cprintf(
\f7\i chstdout
\f3\i0 , "\\\\\\n");\
\f7\i tagged
\f3\i0 =
\f2\b false
\f3\b0 ;\
\}
\f2\b else if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "LF")==0) \{\
cprintf(
\f7\i chstdout
\f3\i0 , "\\n");\
\f7\i tagged
\f3\i0 =
\f2\b false
\f3\b0 ;\
\}
\f2\b else if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/CR")==0) \{\
cprintf(
\f7\i chstdout
\f3\i0 , "\\\\\\r");\
\f7\i tagged
\f3\i0 =
\f2\b false
\f3\b0 ;\
\}
\f2\b else if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "CR")==0) \{\
cprintf(
\f7\i chstdout
\f3\i0 , "\\r");\
\f7\i tagged
\f3\i0 =
\f2\b false
\f3\b0 ;\
\}
\f2\b else if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/BS")==0) \{\
cprintf(
\f7\i chstdout
\f3\i0 , "\\\\\\\\");\
\f7\i tagged
\f3\i0 =
\f2\b false
\f3\b0 ;\
\}
\f2\b else if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "SEMI")==0) \{\
cprintf(
\f7\i chstdout
\f3\i0 , ";");\
\f7\i tagged
\f3\i0 =
\f2\b false
\f3\b0 ;\
\}
\f2\b else if
\f3\b0 (strcmp(
\f7\i tag
\f3\i0 , "/'")==0) \{\
cprintf(
\f7\i chstdout
\f3\i0 , "\\\'%02x",
\f7\i character
\f3\i0 );\
\f7\i tagged
\f3\i0 =
\f2\b false
\f3\b0 ;\
\}
\f2\b else if
\f3\b0 (
\f7\i tag
\f3\i0 [0]=='/'
\f6 \uc0\u8743
\f3 islower(
\f7\i tag
\f3\i0 [1])) \{\
cprintf(
\f7\i chstdout
\f3\i0 , "\\\\%s",
\f7\i tag
\f3\i0 +1);\
\f2\b if
\f3\b0 (
\f7\i hasparam
\f3\i0 ) cprintf(
\f7\i chstdout
\f3\i0 , "%ld",
\f7\i param
\f3\i0 );\
\f7\i tagged
\f3\i0 =
\f2\b true
\f3\b0 ;\
\}
\f2\b else if
\f3\b0 (
\f7\i tag
\f3\i0 [0]=='/') \{\
cprintf(
\f7\i chstdout
\f3\i0 , "\\\\%s",
\f7\i tag
\f3\i0 +1);\
\f7\i tagged
\f3\i0 =
\f2\b false
\f3\b0 ;\
\}
\f2\b else
\f3\b0 \{\
cprintf(
\f7\i chstderr
\f3\i0 ,"unrecognised tag: %s: %s\\n",\
\f7\i tag
\f3\i0 , Tcl_GetString(
\f7\i line
\f3\i0 ));\
\}\
\}
\f2\b else
\f3\b0 \{\
cprintf(
\f7\i chstderr
\f3\i0 ,"input line is not a list: %s\\n",Tcl_GetString(
\f7\i line
\f3\i0 ));\
\}\
\}\
Tcl_Flush(
\f7\i chstdout
\f3\i0 );
\f2\b \
\f3\b0 Tcl_Flush(
\f7\i chstderr
\f3\i0 );
\f2\b \
<>
\f3\b0 \
\
\pard\tx360\tx720\tx1080\tx1440\tx1800\t
x2160\tx2520\tx2880\tx3240\tx3600\tx3960
\tx4320\tx4680\tx5040\tx5400\tx5760\tx61
20\tx6480\tx6840\tx7200\tx7560\tx7920\tx
8280\tx8640\qr\pardirnatural
\f0\b\fs28 \cf0 4 Macro Language\
\pard\tx360\tx720\tx1080\tx1440\tx1800\t
x2160\tx2520\tx2880\tx3240\tx3600\tx3960
\tx4320\tx4680\tx5040\tx5400\tx5760\tx61
20\tx6480\tx6840\tx7200\tx7560\tx7920\tx
8280\tx8640\qr\pardirnatural
\fs26 \cf0 4.1 Declarations\
\pard\tx360\tx720\tx1080\tx1440\tx1800\t
x2160\tx2520\tx2880\tx3240\tx3600\tx3960
\tx4320\tx4680\tx5040\tx5400\tx5760\tx61
20\tx6480\tx6840\tx7200\tx7560\tx7920\tx
8280\tx8640\ql\qnatural\pardirnatural
\f1\b0\fs24 \cf0 \
\pard\tx1080\tx1440\tx1800\tx2160\tx2520
\tx2880\tx3240\tx3600\tx3960\tx4320\tx46
80\tx5040\tx5400\tx5760\tx6120\tx6480\tx
6840\tx7200\tx7560\tx7920\tx8280\tx8640\
li720\ql\qnatural\pardirnatural
\cf0 defineMacroParserStates is a bit of silliness due to order of macro evaluation. It uses a variable defined in macroParser, so it has to be deferred until the macroParser is completely expanded. It is defined here inside a macro; this macro is then ex
panded near the bottom of this file. Then, thanks to the magic of output regions, it will migrate to near the top of the source file.\
\
\pard\tx360\tx720\tx1080\tx1440\tx1800\t
x2160\tx2520\tx2880\tx3240\tx3600\tx3960
\tx4320\tx4680\tx5040\tx5400\tx5760\tx61
20\tx6480\tx6840\tx7200\tx7560\tx7920\tx
8280\tx8640\ql\qnatural\pardirnatural
\f2\b \cf0 <
\f3\b0 #set macroParserStates ""
\f2\b >\
<
\f3\b0 defineMacroParserStates
\f2\b >\
priv type enum
\f3\b0 \{
\f2\b <$
\f3\b0 ::macroParserStates
\f2\b >
\f3\b0 FINAL = -1\}
\f2\b MacroStates
\f3\b0 ;\
\f2\b <>
\f3\b0 \
\pard\tx1080\tx1440\tx1800\tx2160\tx2520
\tx2880\tx3240\tx3600\tx3960\tx4320\tx46
80\tx5040\tx5400\tx5760\tx6120\tx6480\tx
6840\tx7200\tx7560\tx7920\tx8280\tx8640\
li720\ql\qnatural\pardirnatural
\f1 \cf0 \
\pard\tx360\tx720\tx1080\tx1440\tx1800\t
x2160\tx2520\tx2880\tx3240\tx3600\tx3960
\tx4320\tx4680\tx5040\tx5400\tx5760\tx61
20\tx6480\tx6840\tx7200\tx7560\tx7920\tx
8280\tx8640\ql\qnatural\pardirnatural
\f3 \cf0
\f2\b <
\f3\b0 macroParserVariables
\f2\b >
\f3\b0 \
\f2\b static
\f3\b0
\f2\b chars
\f7\i\b0 rtfmacro
\f3\i0 [] = \{\
\
\f4\i These are the predefined RTF macros. The
\f11\b <->
\f4\b0 keeps these strings from triggerring\
macro expanson when renee.rtf is converted into renee.c by renee.\
\f3\i0 \
"RTF_
\f2\b <->
\f3\b0 superscript(", ")", "RTF_
\f2\b <->
\f3\b0 subscript(", ")", \
\};\
\f2\b Obj
\f7\i\b0 X
\f3\i0 = oprintf(0,\
\
\f4\i X is the translation so far of the RTF input into the Tcl script.\
It is the final output of the RTF parser which is then interpretted\
by Tcl to do the actual macro definition and expansion.
\f3\i0 \
\
"macro define RTF_
\f2\b <->
\f3\b0 subscript(expr) \{\\n"\
"if \{[string length [string trim $\{expr-strip\}]]\} \{\\n"\
"macro emit \\\\[$expr\\\\]\\n"\
"\}\\n"\
"\}\\n"\
"macro define RTF_
\f2\b <->
\f3\b0 superscript(expr) \{\\n"\
"macro emit $expr\\n"\
"\}\\n"\
);\
\f2\b int
\f3\b0
\f7\i s
\f3\i0 = TEXT;
\f4\i Current state in macroParser finite transducer.
\f3\i0 \
\f2\b int
\f7\i\b0 c
\f3\i0 ;
\f4\i Current input character in macroParser finite transducer.
\f3\i0 \
\f2\b int
\f7\i\b0 m
\f3\i0 ;
\f4\i Current input styles.
\f3\i0 \
\f2\b int
\f7\i\b0 pos
\f3\i0 ;
\f4\i Current position cookie.
\f3\i0 \
\f2\b int
\f7\i\b0 macrostyle
\f3\i0 ;
\f4\i Style of first character of macro name.
\f3\i0 \
\f2\b int
\f7\i\b0 emitstyle
\f3\i0 ;
\f4\i Style of first character of emission.
\f3\i0 \
\f2\b int
\f7\i\b0 cq
\f3\i0 ;
\f4\i Close quote'd1terminating character of a macro parameter pack.
\f3\i0 \
\f2\b char
\f3\b0
\f7\i utf
\f3\i0 [TCL_UTF_MAX+1];
\f4\i UTF-8 version of c.
\f3\i0 \
\f2\b <>\
\pard\tx1080\tx1440\tx1800\tx2160\tx2520
\tx2880\tx3240\tx3600\tx3960\tx4320\tx46
80\tx5040\tx5400\tx5760\tx6120\tx6480\tx
6840\tx7200\tx7560\tx7920\tx8280\tx8640\
li720\ql\qnatural\pardirnatural
\f1\b0 \cf0 \
\pard\tx360\tx720\tx1080\tx1440\tx1800\t
x2160\tx2520\tx2880\tx3240\tx3600\tx3960
\tx4320\tx4680\tx5040\tx5400\tx5760\tx61
20\tx6480\tx6840\tx7200\tx7560\tx7920\tx
8280\tx8640\qr\pardirnatural
\f0\b\fs26 \cf0 4.2 State Table Syntax Extensions\
\pard\tx1080\tx1440\tx1800\tx2160\tx2520
\tx2880\tx3240\tx3600\tx3960\tx4320\tx46
80\tx5040\tx5400\tx5760\tx6120\tx6480\tx
6840\tx7200\tx7560\tx7920\tx8280\tx8640\
li720\ql\qnatural\pardirnatural
\f1\b0\fs24 \cf0 \
Define additional syntax for macroParser finite state transducer.\
\pard\tx1080\tx1440\tx1800\tx2160\tx2520
\tx2880\tx3240\tx3600\tx3960\tx4320\tx46
80\tx5040\tx5400\tx5760\tx6120\tx6480\tx
6840\tx7200\tx7560\tx7920\tx8280\tx8640\
li720\ql\qnatural\pardirnatural
\f2\b \cf0 \
\pard\tx360\tx720\tx1080\tx1440\tx1800\t
x2160\tx2520\tx2880\tx3240\tx3600\tx3960
\tx4320\tx4680\tx5040\tx5400\tx5760\tx61
20\tx6480\tx6840\tx7200\tx7560\tx7920\tx
8280\tx8640\ql\qnatural\pardirnatural
\cf0 <state>
\f3\b0 SZ_state\{
\f2\b <>\
\f3\b0
\f2\b <
\f3\b0 SZ_state\{state\}
\f2\b >\
<
\f3\b0 #set state [macro clean -break $state]
\f2\b >\
<
\f3\b0 #regsub -all \{\\s+\} $state \{\} state
\f2\b >\
<
\f3\b0 #append ::macroParserStates $
\f7\i state
\f3\i0 ,
\f2\b >\
\f3\b0
\f2\b case
\f3\b0
\f2\b <$
\f3\b0 state
\f2\b >
\f3\b0 : trace("m
\f2\b <$
\f3\b0 state
\f2\b >
\f3\b0 :%x/%s [%d]",
\f7\i m, utf, lp
\f3\i0 );
\f2\b \
\f3\b0
\f2\b <>\
<wh>
\f3\b0 SZ_edge\{
\f2\b <> <th>
\f3\b0 ;
\f2\b <> <hw>
\f3\b0 \}
\f2\b <>\
<
\f3\b0 SZ_edge\{selector;actor\}
\f2\b >\
<
\f3\b0 #set actor [macro clean -break $actor]
\f2\b >\
<
\f3\b0 #set selector [macro clean -break $selector]
\f2\b >\
<#\
\f3\b0 if
\f2\b
\f3\b0 \{![regexp \{^(.*?)([A-Z]+)\\s*$\} $actor - stmt
\f7\i
\f3\i0 ns]\} \{\
regsub -all \{\\s+\} $selector \{ \} s\
if \{[string length $s]>40\} \{set s ...[string range $s end-37 end]\}\
\f2\b
\f3\b0 error "missing next state name: $s"\
\f2\b
\f3\b0 \}\
\f2\b >\
if
\f3\b0 (
\f2\b <$
\f3\b0 selector
\f2\b >
\f3\b0 ) \{
\f2\b <$
\f3\b0 stmt
\f2\b >
\f3\b0 ;
\f7\i s
\f3\i0 =
\f2\b <$
\f3\b0 ns
\f2\b >
\f3\b0 ;
\f2\b goto
\f3\b0 translator;\}
\f2\b \
<>\
<eq>
\f7\i\b0 c
\f3\i0 ==
\f2\b <> <any>
\f3\b0 1
\f2\b <>\
<
\f3\b0 isOpen
\f2\b >
\f3\b0 (
\f7\i c
\f3\i0 =='<'
\f6 \uc0\u8743
\f3 (
\f7\i m
\f3\i0 &styleBold))
\f2\b <>
\f3\b0
\f2\b <
\f3\b0 isClose
\f2\b >
\f3\b0 (
\f7\i c
\f3\i0 =='>'
\f6 \uc0\u8743
\f3 (
\f7\i m
\f3\i0 &styleBold))
\f2\b <>
\f3\b0 \
\f2\b <
\f3\b0 isSpace
\f2\b >
\f3\b0 Tcl_UniCharIsSpace(
\f7\i c
\f3\i0 )
\f2\b <>\
<
\f3\b0 isLetter
\f2\b >
\f3\b0 Tcl_UniCharIsAlpha(
\f7\i c
\f3\i0 )
\f6 \uc0\u8744
\f3
\f7\i c
\f3\i0 =='_'
\f2\b <>
\f3\b0 \
\f2\b <
\f3\b0 isName
\f2\b >
\f3\b0 Tcl_UniCharIsAlnum(
\f7\i c
\f3\i0 )
\f6 \uc0\u8744
\f3
\f7\i c
\f3\i0 =='_'
\f2\b <>
\f3\b0 \
\f2\b <
\f3\b0 isMeta
\f2\b >
\f3\b0 (((
\f7\i c
\f3\i0 )&0xFF00)==0xE000)
\f2\b <>
\f3\b0 \
\f2\b <
\f3\b0 isTcl
\f2\b >
\f3\b0 ((
\f7\i c
\f3\i0 )=='\{'
\f6 \uc0\u8744
\f3 (
\f7\i c
\f3\i0 )=='\}'
\f6 \uc0\u8744
\f3 (
\f7\i c
\f3\i0 )=='['
\f6 \uc0\u8744
\f3 (
\f7\i c
\f3\i0 )==']'
\f6 \uc0\u8744
\f3 (
\f7\i c
\f3\i0 )=='\\\'
\f6 \uc0\u8744
\f3 (
\f7\i c
\f3\i0 )=='$'
\f6 \uc0\u8744
\f3 (
\f7\i c
\f3\i0 )=='\\"')
\f2\b <>
\f3\b0 \
\f2\b <take
\f3\b0 (fmtlist)
\f2\b >\
<
\f3\b0 #set fmtlist [macro clean -break $fmtlist]
\f2\b >\
<
\f3\b0 #if \{[regexp \{^\\s*"\} $fmtlist]\} \{
\f2\b >\
\f7\i\b0 X
\f3\i0 = oprintf(
\f7\i X
\f3\i0 ,
\f2\b <$
\f3\b0 fmtlist
\f2\b >
\f3\b0 );\
\f2\b <
\f3\b0 #\}
\f2\b else
\f3\b0 \{
\f2\b >\
\f7\i\b0 X
\f3\i0 = oprintf(
\f7\i X
\f3\i0 , "%U",
\f2\b <$
\f3\b0 fmtlist
\f2\b >
\f3\b0 );\
\f2\b <
\f3\b0 #\}
\f2\b >\
\f3\b0
\f2\b <>\
<shift>
\f7\i\b0 c
\f3\i0 = 0;
\f2\b <>\
\
\pard\tx360\tx720\tx1080\tx1440\tx1800\t
x2160\tx2520\tx2880\tx3240\tx3600\tx3960
\tx4320\tx4680\tx5040\tx5400\tx5760\tx61
20\tx6480\tx6840\tx7200\tx7560\tx7920\tx
8280\tx8640\qr\pardirnatural
\f0\fs26 \cf0 4.3 Macro Language Finite Transducer\
\pard\tx1080\tx1440\tx1800\tx2160\tx2520
\tx2880\tx3240\tx3600\tx3960\tx4320\tx46
80\tx5040\tx5400\tx5760\tx6120\tx6480\tx
6840\tx7200\tx7560\tx7920\tx8280\tx8640\
li720\ql\qnatural\pardirnatural
\f1\b0\fs24 \cf0 \
This the finite transducer which translates the RTF styled character stream into the Tcl script that defines and expands the macros.\
\pard\tx1080\tx1440\tx1800\tx2160\tx2520
\tx2880\tx3240\tx3600\tx3960\tx4320\tx46
80\tx5040\tx5400\tx5760\tx6120\tx6480\tx
6840\tx7200\tx7560\tx7920\tx8280\tx8640\
li720\ql\qnatural\pardirnatural
\f2\b \cf0 \
\pard\tx360\tx720\tx1080\tx1440\tx1800\t
x2160\tx2520\tx2880\tx3240\tx3600\tx3960
\tx4320\tx4680\tx5040\tx5400\tx5760\tx61
20\tx6480\tx6840\tx7200\tx7560\tx7920\tx
8280\tx8640\ql\qnatural\pardirnatural
\f3\b0 \cf0
\f2\b <
\f3\b0 macroParser
\f2\b >\
\f3\b0 translator:
\f2\b if
\f3\b0 ('c2
\f7\i c
\f3\i0 )
\f2\b continue
\f3\b0 ;
\f7\i utf
\f3\i0 [Tcl_UniCharToUtf(
\f7\i c
\f3\i0 ,
\f7\i utf
\f3\i0 )] = 0;
\f2\b switch
\f3\b0 (
\f7\i s
\f3\i0 ) \{\
\pard\tx1080\tx1440\tx1800\tx2160\tx2520
\tx2880\tx3240\tx3600\tx3960\tx4320\tx46
80\tx5040\tx5400\tx5760\tx6120\tx6480\tx
6840\tx7200\tx7560\tx7920\tx8280\tx8640\
li720\ql\qnatural\pardirnatural
\f8\b \cf0 \
Macro language.\
\pard\tx1440\tx1800\tx2160\tx2520\tx2880
\tx3240\tx3600\tx3960\tx4320\tx4680\tx50
40\tx5400\tx5760\tx6120\tx6480\tx6840\tx
7200\tx7560\tx7920\tx8280\tx8640\li1460\
fi-740\ql\qnatural\pardirnatural
\f10\i\b0 \cf0 macro-stream
\f9\i0
\f8\b ::=
\f10\i\b0 macro-piece
\f9\i0
\f8\b |
\f9\b0
\f10\i macro-stream macro-piece
\f9\i0 \
\f10\i macro-piece
\f9\i0
\f8\b ::=
\f10\i\b0 macro-definition
\f9\i0
\f8\b |
\f9\b0
\f10\i subst-definition
\f9\i0
\f8\b |
\f9\b0
\f10\i tcl-command
\f9\i0
\f8\b |
\f9\b0
\f10\i break
\f9\i0
\f8\b |
\f9\b0
\f10\i empty
\f9\i0
\f8\b |
\f9\b0
\f10\i emission\
\pard\tx2880\tx3240\tx3600\tx3960\tx4320
\tx4680\tx5040\tx5400\tx5760\tx6120\tx64
80\tx6840\tx7200\tx7560\tx7920\tx8280\tx
8640\li2180\fi-20\ri20\ql\qnatural\pardirnatural
\f9\i0 \cf0 All macro constructs are surrounded by bold angles (
\f8\b <
\f9\b0 ) and (
\f8\b >
\f9\b0 ). Other text is emitted during the Tcl interpretation.\
\pard\tx360\tx720\tx1080\tx1440\tx1800\t
x2160\tx2520\tx2880\tx3240\tx3600\tx3960
\tx4320\tx4680\tx5040\tx5400\tx5760\tx61
20\tx6480\tx6840\tx7200\tx7560\tx7920\tx
8280\tx8640\ql\qnatural\pardirnatural
\f3 \cf0 \
\f2\b state
\f3\b0 TEXT
\f2\b is
\f3\b0 \
\f2\b wh eq
\f3\b0 EOI
\f2\b th
\f3\b0
\f2\b shift
\f3\b0 FINAL
\f2\b hw
\f3\b0 \
\f2\b wh eq
\f3\b0 EOS
\f2\b th
\f3\b0
\f2\b shift
\f3\b0 TEXT
\f2\b hw
\f3\b0 \
\f2\b wh
\f3\b0 isOpen
\f2\b th
\f3\b0
\f2\b shift
\f3\b0 TEXTMETA
\f2\b hw
\f3\b0 \
\f2\b wh eq
\f3\b0 '\\n'
\f2\b th\
\f3\b0
\f7\i emitstyle
\f3\i0 =
\f7\i m
\f3\i0 ;\
\f2\b take
\f3\b0 ("macro emit -map -style %d -position %d \\"",
\f7\i m
\f3\i0 ,
\f7\i pos
\f3\i0 -xcLpIncr)\
TEXTEMIT\
\f2\b hw\
\f3\b0
\f2\b wh
\f3\b0 isSpace
\f2\b th shift
\f3\b0 TEXTSPACE
\f2\b hw
\f3\b0 \
\f2\b wh any th\
\f3\b0
\f7\i emitstyle
\f3\i0 =
\f7\i m
\f3\i0 ;\
\f2\b take
\f3\b0 ("macro emit -map -style %d -position %d \\"",
\f7\i m
\f3\i0 ,
\f7\i pos
\f3\i0 )\
TEXTEMIT\
\f2\b hw\
\f3\b0
\f2\b state
\f3\b0 TEXTSPACE
\f2\b is
\f3\b0 \
\f2\b wh eq
\f3\b0 EOI
\f2\b th
\f3\b0
\f2\b shift
\f3\b0 FINAL
\f2\b hw
\f3\b0 \
\f2\b wh eq
\f3\b0 EOS
\f2\b th
\f3\b0
\f2\b shift
\f3\b0 TEXT
\f2\b hw
\f3\b0 \
\f2\b wh eq
\f3\b0 '\\n'
\f2\b th\
\f3\b0
\f7\i emitstyle
\f3\i0 =
\f7\i m
\f3\i0 ;\
\f2\b take
\f3\b0 ("macro emit -map -style %d -position %d \\"",
\f7\i m
\f3\i0 ,
\f7\i pos
\f3\i0 -xcLpIncr)\
TEXTEMIT\
\f2\b hw\
\f3\b0
\f2\b wh
\f3\b0 isSpace
\f2\b th
\f3\b0
\f2\b shift
\f3\b0 TEXTSPACE
\f2\b hw
\f3\b0 \
\f2\b wh
\f3\b0 isOpen
\f2\b th
\f3\b0
\f2\b shift
\f3\b0 TEXTMETA
\f2\b hw
\f3\b0 \
\f2\b wh any th
\f3\b0 \
\f7\i emitstyle
\f3\i0 =
\f7\i m
\f3\i0 ;\
\f2\b take
\f3\b0 ("macro emit -map -style %d -position %d \\" ",
\f7\i m
\f3\i0 ,
\f7\i pos
\f3\i0 )\
TEXTEMIT\
\f2\b hw\
\f3\b0
\f2\b state
\f3\b0 TEXTMETA
\f2\b is
\f3\b0 \
\f2\b wh eq
\f3\b0 EOI
\f2\b th
\f3\b0 error("end of file in meta-text");
\f2\b shift
\f3\b0 FINAL
\f2\b hw
\f3\b0 \
\f2\b wh eq
\f3\b0 EOS
\f2\b th
\f3\b0 error("end of file in meta-text");
\f2\b shift
\f3\b0 TEXT
\f2\b hw
\f3\b0 \
\f2\b wh
\f3\b0 isSpace
\f2\b th
\f3\b0
\f2\b shift
\f3\b0 TEXTMETA
\f2\b hw
\f3\b0 \
\f2\b wh
\f3\b0 isClose
\f2\b th
\f3\b0
\f2\b shift
\f3\b0 TEXT
\f2\b hw
\f3\b0 \
\f2\b wh eq
\f3\b0 '-'
\f2\b th
\f3\b0
\f2\b shift
\f3\b0 DASHMETA
\f2\b hw
\f3\b0 \
\f2\b wh eq
\f3\b0 '#'
\f2\b th
\f3\b0
\f2\b shift
\f3\b0 TEXTTCL
\f2\b hw
\f3\b0 \
\f2\b wh eq
\f3\b0 '='
\f2\b th
\f3\b0
\f2\b shift
\f3\b0 SUBSTPREMATCH
\f2\b hw
\f3\b0 \
\f2\b wh
\f7\i\b0 c
\f3\i0 =='$'
\f6 \uc0\u8744
\f7\i c
\f3\i0 =='\\x5b'
\f2\b th
\f3\b0 \
\f2\b take
\f3\b0 ("macro emit -style %d -position %d %c",
\f7\i m
\f3\i0 ,
\f7\i pos
\f3\i0 ,
\f7\i c
\f3\i0 )\
\f2\b shift
\f3\b0 TEXTEXPR\
\f2\b hw
\f3\b0 \
\f2\b wh
\f3\b0 isLetter
\f2\b th\
\f3\b0
\f7\i macrostyle
\f3\i0 =
\f7\i m
\f3\i0 ;\
\f2\b take
\f3\b0 ("macro define -style %d \\x7b",
\f7\i m
\f3\i0 )\
MACRONAME\
\f2\b hw
\f3\b0 \
\f2\b wh
\f3\b0 isMeta
\f2\b th
\f3\b0
\f2\b shift
\f3\b0 TEXTMETA
\f2\b hw
\f3\b0 \
\f2\b wh any th
\f3\b0
\f2\b take
\f3\b0 ("macro subst \\"") SUBSTMATCH
\f2\b hw
\f3\b0 \
\
\pard\tx1440\tx1800\tx2160\tx2520\tx2880
\tx3240\tx3600\tx3960\tx4320\tx4680\tx50
40\tx5400\tx5760\tx6120\tx6480\tx6840\tx
7200\tx7560\tx7920\tx8280\tx8640\li1460\
fi-740\ql\qnatural\pardirnatural
\f10\i \cf0 macro-definition
\f9\i0
\f8\b ::= <
\f10\i\b0 macro-name macro-parameter-pack
\f9\i0
\f10\i plus
\f8\i0\b >
\f10\i\b0 macro-body
\f8\i0\b <>
\f9\b0 \
\f10\i macro-name
\f9\i0
\f8\b ::=
\f10\i\b0 letters-digits-and-underscores\
\pard\tx360\tx720\tx1080\tx1440\tx1800\t
x2160\tx2520\tx2880\tx3240\tx3600\tx3960
\tx4320\tx4680\tx5040\tx5400\tx5760\tx61
20\tx6480\tx6840\tx7200\tx7560\tx7920\tx
8280\tx8640\ql\qnatural\pardirnatural
\f3\i0 \cf0 \
\f2\b state
\f3\b0 MACRONAME
\f2\b is
\f3\b0 \
\f2\b wh
\f3\b0 isMeta
\f2\b th
\f3\b0
\f2\b shift
\f3\b0 MACRONAME
\f2\b hw
\f3\b0 \
\f2\b wh
\f3\b0 isName
\f2\b th\
if
\f3\b0 (
\f7\i m
\f3\i0 'ad
\f7\i macrostyle
\f3\i0 ) error("style change in macro name");\
\f2\b take
\f3\b0 (c)
\f2\b shift
\f3\b0 MACRONAME\
\f2\b hw
\f3\b0 \
\f2\b wh any th
\f3\b0 MACRONAMEEND
\f2\b hw
\f3\b0 \
\f2\b state
\f3\b0 MACRONAMEEND
\f2\b is
\f3\b0 \
\f2\b wh
\f3\b0 isMeta
\f2\b th
\f3\b0
\f2\b shift
\f3\b0 MACRONAMEEND
\f2\b hw
\f3\b0 \
\f2\b wh
\f3\b0 isSpace
\f2\b th
\f3\b0
\f2\b shift
\f3\b0 MACRONAMEEND
|