home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume1 / 8708 / 32 < prev    next >
Encoding:
Internet Message Format  |  1990-07-13  |  63.0 KB

  1. From: dietz@zhmti.UUCP (Dieter H. Zebbedies)
  2. Newsgroups: comp.sources.misc
  3. Subject: "Producer" translates Smalltalk to Objective-C (Part 3 of 5)
  4. Message-ID: <4219@ncoast.UUCP>
  5. Date: 20 Aug 87 01:56:33 GMT
  6. Sender: allbery@ncoast.UUCP
  7. Organization: Zebb-Hoff Machine Tool Inc's Automated Mfg. Project, Cleve., OH
  8. Lines: 3036
  9. Approved: allbery@ncoast.UUCP
  10. X-Archive: comp.sources.misc/8708/32
  11.  
  12. "Producer", A package to translate Smalltalk-80 code to your favorite
  13. object oriented language, Objective-C.
  14.  
  15. #!/bin/sh
  16. # to extract, remove the header and type "sh filename"
  17. if `test ! -d ./src`
  18. then
  19.   mkdir ./src
  20.   echo "mkdir ./src"
  21. fi
  22. if `test ! -s ./src/Type.m`
  23. then
  24. echo "writting ./src/Type.m"
  25. cat > ./src/Type.m << '\Rogue\Monster\'
  26. #include "Producer.h"
  27.     TYPE types = { 0 };
  28.     LOCAL id knownTypes;
  29.     USE Set;
  30. = Type : Constant CATEGORIES()
  31. + initialize { static BOOL beenHere;
  32.     if (!beenHere) { beenHere = YES;
  33.         self = Type; knownTypes = [Set new];
  34.  
  35.         // C base types
  36.         types.ID = [self str:"id"];
  37.         types.CHAR = [self str:"char"];
  38.         types.SHORT = [self str:"short"];
  39.         types.INT = [self str:"int"];
  40.         types.LONG = [self str:"long"];
  41.         types.FLOAT = [self str:"float"];
  42.         types.DOUBLE = [self str:"double"];
  43.  
  44.         // Common derived types
  45.         types.CSTRING = [self str:"STR"];
  46.         types.POINT = [self str:"PT"];
  47.         types.RECTANGLE = [self str:"RT"];
  48.  
  49.         // Language types
  50.         types.BLOCK = [self str:"BLOCK"];
  51.         types.STMT = [self str:"STMT"];
  52.         types.SELECTOR = [self str:"SEL"];
  53.         types.SHARED = [self str:"SHR"];
  54.  
  55.         // Misc
  56.         types.UNKNOWN = [self str:"unknown"];
  57.         types.ANY = [self str:"any"];
  58.     }
  59.     return self;
  60. }
  61. - type
  62.     { return self; }
  63. =:
  64. \Rogue\Monster\
  65. else
  66.   echo "will not over write ./src/Type.m"
  67. fi
  68. if `test ! -s ./src/gen.m`
  69. then
  70. echo "writting ./src/gen.m"
  71. cat > ./src/gen.m << '\Rogue\Monster\'
  72. #include "Producer.h"
  73. #include "stdio.h"
  74. #include "ctype.h"
  75. = CATEGORIES()
  76.     LOCAL unsigned indent = 0;
  77.     LOCAL BOOL bol = YES;
  78.     LOCAL IOD genFD = stdout;
  79.     LOCAL STR yyfilename = "<stdin>";
  80.  
  81. // Debug option
  82. EXPORT void po(o) id o; 
  83.     { [o show]; }
  84. EXPORT void dbgo(o) id o; 
  85.     { IMPORT BOOL dbgFlag; if (dbgFlag) [o show]; }
  86. EXPORT int yywrap() 
  87.     { IMPORT unsigned yylineno; yylineno = 1; return 1; }
  88.  
  89. // stockpile the last n tokens for printing in error messages
  90. #define SIZ 30
  91.     LOCAL char minPt[SIZ+10] = "";    // slop
  92.     LOCAL STR inPt = &minPt[SIZ-1], maxPt = &minPt[SIZ-1];
  93. EXPORT void stockToken(s) STR s; {
  94.     if (!s) return;
  95.     if (isalnum(*inPt) && isalnum(*s)) {
  96.         if (inPt >= maxPt) inPt = minPt;
  97.         *inPt++ = ' ';
  98.     }
  99.     while(*s) {
  100.         if (inPt >= maxPt) inPt = minPt;
  101.         *inPt++ = *s++;
  102.     }
  103. }
  104. LOCAL printToken(iod) IOD iod; { STR outPt, stopPt;
  105.     if (inPt >= maxPt)    { outPt = minPt; stopPt = maxPt-1; }
  106.     else                 { outPt = inPt; stopPt = inPt-1; }
  107.     for(;;) {
  108.         if (outPt >= maxPt) outPt = minPt;
  109.         putc(*outPt ? *outPt : ' ', iod);
  110.         if (outPt++ == stopPt) break;
  111.     }
  112. }
  113. EXPORT IOD yyopen(file, mode, iod) STR file, mode; IOD iod; {
  114.     IMPORT IOD yyin; IMPORT unsigned yylineno;
  115.     yylineno = 1; return freopen(yyfilename = file, mode, yyin=stdin);
  116. }
  117.     EXPORT int errorCount = 0;
  118. EXPORT void wer(fmt, arg) STR fmt, arg; { IMPORT unsigned yylineno; 
  119.     fflush(stdout); fflush(genFD); fflush(stderr);
  120.     fprintf(stderr, "error: ");
  121.     _doprnt(fmt, &arg, stderr); fprintf(stderr, "\n");
  122.     fflush(stdout); fflush(genFD); fflush(stderr);
  123.     errorCount++;
  124. }
  125. EXPORT void yyerror(fmt, arg) STR fmt, arg; { IMPORT unsigned yylineno; 
  126.     fflush(stdout); fflush(genFD); fflush(stderr);
  127.     fprintf(stderr, "error %3d:%s: ", yylineno, yyfilename);
  128.     printToken(stderr); fprintf(stderr, " : ");
  129.     _doprnt(fmt, &arg, stderr); fprintf(stderr, "\n");
  130.     fflush(stdout); fflush(genFD); fflush(stderr);
  131.     errorCount++;
  132. }
  133.     EXPORT BOOL infoFlag = NO;
  134. EXPORT void info(fmt, arg) STR fmt, arg; { IMPORT unsigned yylineno; 
  135.     if (!infoFlag) return;
  136.     fflush(stdout); fflush(genFD); fflush(stderr);
  137.     fprintf(stderr, "fyi   %3d:%s: ", yylineno, yyfilename);
  138.     _doprnt(fmt, &arg, stderr); fflush(stderr);
  139. }
  140. // String copy
  141. EXPORT STR strCopy(s) STR s; { return (STR)strcpy(malloc(strlen(s)+1), s); }
  142.  
  143. // fopen(genFD)
  144. EXPORT void genOpen(className) STR className; {
  145.     if (genFD != stdout) fclose(genFD);
  146.     genFD = fopen(className, "w");
  147.     indent = 0; bol = YES;
  148.     if (!genFD) { fprintf(stderr, "cannot open %s for writing ", className);
  149.         perror("");
  150.         exit(-1);
  151.     }
  152. }
  153. EXPORT void genReset() { indent = 0; bol = YES; }
  154.  
  155. // Generate: formatted, string, newline, char
  156. EXPORT void gc(c) { BOOL eol = NO, discardSemi = NO;
  157.     switch(c) { 
  158.     case '\n': case '\r': case '\f': newline(); return;
  159.     case '{': eol = YES; discardSemi = NO; break;
  160.     case '}': indent--; eol = YES; discardSemi = YES; newline(); break;
  161.     case '(': indent++; discardSemi = NO; break;
  162.     case ')': indent--; discardSemi = NO; break;
  163.     case ';': if (discardSemi) return; eol = YES; discardSemi = YES; break;
  164.     default: discardSemi = NO; break;
  165.     }
  166.     if (bol) idn();
  167.     putc(c, genFD); 
  168.     if (eol) newline();
  169.     if (c == '{'/*}*/) indent++;
  170. }
  171. EXPORT void gf(s, arg) STR s, arg; { _doprnt(s, &arg, genFD); }
  172. EXPORT void gs(s) STR s; { while(*s) gc(*s++); }
  173. EXPORT void gn() { bol = NO; newline(); }
  174. LOCAL idn() { unsigned i;
  175.     for (i = indent; i-- != 0; ) putc('\t', genFD);
  176.     bol = NO;
  177. }
  178. LOCAL newline() {
  179.     if (!bol) putc('\n', genFD);
  180.     bol = YES;
  181. }
  182. \Rogue\Monster\
  183. else
  184.   echo "will not over write ./src/gen.m"
  185. fi
  186. if `test ! -s ./src/main.m`
  187. then
  188. echo "writting ./src/main.m"
  189. cat > ./src/main.m << '\Rogue\Monster\'
  190. #include "stdio.h"
  191. #include "Producer.h"
  192. = CATEGORIES()
  193.     LOCAL BOOL showMsgTranslationFlag, showIdTranslationFlag;
  194. STR *parseArguments(argc, argv) STR *argv; { unsigned i; USE Object;
  195.     IMPORT BOOL dbgFlag, msgFlag, allocFlag, printFlag, lexFlag, infoFlag,
  196.         autoFileFlag, stripCommentsFlag, infoFlag;
  197.     IMPORT IOD dbgIOD;
  198.     // settrap();    // trap interrupts
  199.     [Object self];    // trigger initializes now
  200.     dbgIOD = stderr;
  201.     for (i = 1; i < argc; i++) { STR arg = argv[i];
  202.         static char usage[]="usage: %s [-(dmaplgsci)] files ..";
  203.         if (*arg == '-') 
  204.             switch (*++arg) {
  205.             case 'd': dbgFlag = YES; break;
  206.             case 'm': msgFlag = YES; break;
  207.             case 'a': allocFlag = YES; break;
  208.             case 'p': printFlag = YES; break;
  209.             case 'l': lexFlag = YES; break;
  210.             case 'g': autoFileFlag = YES; break;
  211.             case 's': stripCommentsFlag = YES; break;
  212.             case 'c': stripCommentsFlag = NO; break;
  213.             case 'i': infoFlag = YES; break;
  214.             case 'M': showMsgTranslationFlag = YES; break;
  215.             case 'I': showIdTranslationFlag = YES; break;
  216.             default: fprintf(stderr, usage, argv[0]); bye(-2);
  217.             }
  218.         else return &argv[i];
  219.     }
  220.     return 0;
  221. }
  222. main(argc, argv) STR *argv; { USE Comment;
  223.     IMPORT unsigned errorCount;
  224.     STR *file = parseArguments(argc, argv);
  225.     if (file) for (; *file; file++) {
  226.             if (yyopen(*file, "r", stdin)) yyparse();
  227.             else wer("cannot open %s\n", *file);
  228.         }
  229.     else yyparse(); 
  230.     bye(errorCount != 0);
  231. }
  232. // Exit here.
  233. bye(n) { static BOOL beenHere = 0; 
  234.     IMPORT id msgTranslator, identifierTranslator;
  235.     if (beenHere++) exit(n);
  236.     if (showMsgTranslationFlag) {
  237.         printf("msgTranslator============================\n");
  238.         [msgTranslator show];
  239.     }
  240.     if (showIdTranslationFlag) {
  241.         printf("identifierTranslator============================\n");
  242.         [identifierTranslator show];
  243.     }
  244.     exit(n); 
  245. }
  246. @class(String, Block, ByteArray, Return, Selector, Comment, Stmt, AsciiFiler,
  247.     Expr, Msg, StArray, Method, List, IdArray, Sequence, Cltn,
  248.     Set, IntArray, Class, Identifier, MsgArgPattern, MsgNamePattern, 
  249.     MsgTranslator, AbstractTranslation, FunctionTranslation, 
  250.     MsgTranslation, StringTranslation, IdentifierTranslation,
  251.     CharConstant, Constant, NumberConstant, SelectorConstant, StringConstant,
  252.     Template, Type, ArgumentList, Scope)
  253. @phyla CATEGORIES()
  254. \Rogue\Monster\
  255. else
  256.   echo "will not over write ./src/main.m"
  257. fi
  258. if `test ! -s ./src/Producer.h`
  259. then
  260. echo "writting ./src/Producer.h"
  261. cat > ./src/Producer.h << '\Rogue\Monster\'
  262. #ifndef PRODUCER_H
  263. #    include "Substrate.h"
  264. #    undef CATEGORIES
  265. #ifndef COXLIB
  266. #    define CATEGORIES() (Producer, Collection, Primitive)
  267. #else
  268. #    define CATEGORIES() (Producer, Substrate, Primitive)
  269. #endif
  270. #    define ARYSIZ(x) (sizeof(x)/sizeof(*x))
  271. #    define strEq(a, b) (strcmp(a, b) == 0)
  272.     typedef struct _TYPES {
  273.         id DEFAULT, ID, CHAR, SHORT, INT, LONG, FLOAT, DOUBLE;
  274.         id CSTRING, POINT, RECTANGLE;
  275.         id BLOCK, STMT;
  276.         id SELECTOR, SHARED;
  277.         id UNKNOWN, ANY;
  278.     } TYPE;
  279.     IMPORT TYPE types;
  280.  
  281. #    define AbstractTranslation prAbstractTranslation
  282. #    define ArgumentList prArgumentList
  283. #    define Block prBlock
  284. #    define CharConstant prCharConstant
  285. #    define Class prClass
  286. #    define Comment prComment
  287. #    define Constant prConstant
  288. #    define Expr prExpr
  289. #    define FunctionTranslation prFunctionTranslation
  290. #    define Identifier prIdentifier
  291. #    define IdentifierTranslation prIdentifierTranslation
  292. #    define List prList
  293. #    define Method prMethod
  294. #    define Msg prMsg
  295. #    define MsgArgPattern prMsgArgPattern
  296. #    define MsgNamePattern prMsgNamePattern
  297. #    define MsgTranslation prMsgTranslation
  298. #    define MsgTranslator prMsgTranslator
  299. #    define Node prNode
  300. #    define NumberConstant prNumberConstant
  301. #    define Return prReturn
  302. #    define Scope prScope
  303. #    define Selector prSelector
  304. #    define SelectorConstant prSelectorConstant
  305. #    define StArray prStArray
  306. #    define Stmt prStmt
  307. #    define StringConstant prStringConstant
  308. #    define StringTranslation prStringTranslation
  309. #    define Template prTemplate
  310. #    define Type prType
  311.  
  312. #define PRODUCER_H
  313. #endif
  314. \Rogue\Monster\
  315. else
  316.   echo "will not over write ./src/Producer.h"
  317. fi
  318. if `test ! -s ./src/st80.h`
  319. then
  320. echo "writting ./src/st80.h"
  321. cat > ./src/st80.h << '\Rogue\Monster\'
  322. #ifndef PRODUCERTEST_H
  323. #    include "Layers.h"
  324. #    define ARYSIZ(x) (sizeof(x)/sizeof(*x))
  325. #    define strEq(a, b) (strcmp(a, b) == 0)
  326.  
  327. #    undef CATEGORIES()
  328. #    define CATEGORIES() (ProducerTest, Collecting, Primitive)
  329. #    define unknown id
  330. #    define PRODUCERTEST_H
  331. #endif
  332. \Rogue\Monster\
  333. else
  334.   echo "will not over write ./src/st80.h"
  335. fi
  336. if `test ! -s ./src/y.tab.h`
  337. then
  338. echo "writting ./src/y.tab.h"
  339. cat > ./src/y.tab.h << '\Rogue\Monster\'
  340.  
  341. typedef union     TYP { id O; char B; char *S; } YYSTYPE;
  342. extern YYSTYPE yylval;
  343. # define IDENTIFIER 257
  344. # define DIGITS 258
  345. # define KEYWORD 259
  346. # define STRING 260
  347. # define CHARCON 261
  348. # define DOUBLESPECIAL 262
  349. # define  _ 95
  350. # define VariableIdentifier 263
  351. \Rogue\Monster\
  352. else
  353.   echo "will not over write ./src/y.tab.h"
  354. fi
  355. if `test ! -s ./src/gram.y`
  356. then
  357. echo "writting ./src/gram.y"
  358. cat > ./src/gram.y << '\Rogue\Monster\'
  359. %{
  360. /* Grammar for Smalltalk-80
  361.  *        3 shift/reduce, 0 reduce/reduce conflicts
  362.  */
  363. #include <stdio.h>
  364. #include "objc.h"
  365. #include "Producer.h"
  366. = CATEGORIES()
  367.     USE Block, Expr, List, Array, Type, StArray, Msg, Method, Return,
  368.         Selector, Stmt, Identifier, IdentifierTranslation, StringTranslation,
  369.         FunctionTranslation, NumberConstant, SelectorConstant, CharConstant, 
  370.         StringConstant, MsgTranslation, Template, ArgumentList, Class, Comment;
  371.     EXPORT BOOL printFlag,
  372.         isFactory = NO;
  373.     IMPORT id findSymbol();
  374.     LOCAL id thisClass = nil;
  375.     IMPORT id msgTranslator;
  376. %}
  377. %union    TYP { id O; char B; char *S; }
  378. %type    <O> LocalVariables VarList PrimMarker Type Method MethodName Keyword
  379. %type    <O> KwdMethodDecl StmtList Expr AssignmentList Primary 
  380. %type    <O> UnaryObjDesc BinaryObjDesc SimpleMsgExpr UnaryExpr BinaryExpr
  381. %type    <O> KeywordExpr KeywordArgList CascadedMsgExpr CascadedMsg
  382. %type    <O> Literal ArrayMemberList ArrayMember Block BinarySelector
  383. %type    <O> VariableName UnarySelector Template BlockVarList KeywordList
  384. %type    <O> InferenceRule ObjcFunctionArgList ObjcFunctionPattern BlockVariables
  385. %type    <O> ObjcKeywordPattern ObjcMsgPattern OptionalType
  386. %type    <O> ParameterDesignator KeywordPattern PatternType TemplateType
  387. %type    <O> CharacterConstant NumberConstant StringConstant Keyword
  388. %type    <B> SpecialCharacter
  389. %token    <S> IDENTIFIER DIGITS KEYWORD STRING CHARCON DOUBLESPECIAL
  390. %token    <B> '%' '|' '&' '?' '#' '!' ',' '_'
  391. %token    <B> '+' '-' '/' '\\' '*' '~' '<' '>' '=' '@' 
  392.  
  393. %left '_' 
  394. %left IDENTIFIER STRING UnarySelector VariableIdentifier
  395. %right KEYWORD BinarySelector
  396. %start ChunkList
  397. %%
  398. ChunkList:
  399.     | ChunkList Chunk { USE Comment; [Comment gen]; }
  400.     ;
  401. Chunk: VariableName KEYWORD '#' VariableName
  402.         KEYWORD StringConstant KEYWORD StringConstant 
  403.         KEYWORD StringConstant KEYWORD StringConstant '!' {
  404.             [Comment gen];
  405.             if (thisClass) { [thisClass gen]; [thisClass free]; }
  406.             thisClass = [Class name:findSymbol($4)];
  407.             [thisClass superclass:findSymbol($1)];
  408.             [thisClass instanceVariableNames:$6];
  409.             [thisClass classVariableNames:$8];
  410.             [thisClass poolDictionaries:$10];
  411.             [thisClass category:$12];
  412.             [thisClass gen];
  413.         }
  414.     | VariableName KEYWORD STRING '!' 
  415.         {isFactory=NO;} Methods Sep
  416.     | VariableName VariableName KEYWORD STRING '!' 
  417.         {isFactory=YES;} Methods Sep
  418.     | '{' InferenceRule '}' 
  419.         { [Comment free]; }
  420.     | '{' error '}' 
  421.     | error '!'
  422.     ;
  423. Sep: '!'
  424.     | Sep '!'
  425.     ;
  426. Methods: 
  427.     | Methods Method '!' 
  428.         { [Comment gen]; [$2 gen]; [$2 free]; }
  429.     | Methods error '!' 
  430.         { [Comment gen]; }
  431.     ;
  432. /* Declare a new method */
  433. Method: MethodName LocalVariables 
  434.             { [$$=$1 variables:$2]; }
  435.         PrimMarker StmtList 
  436.             { [$$ primitive:$4]; [$$ statements:$5]; }
  437.     ;
  438. MethodName: UnarySelector
  439.         { $$ = [Method selector:$1 asFactory:isFactory]; }
  440.     | BinarySelector VariableName
  441.         { $$ = [Method selector:[$1 argument:$2] asFactory:isFactory]; }
  442.     | KwdMethodDecl 
  443.         { $$ = [Method selector:$1 asFactory:isFactory]; }
  444.     ;
  445. PrimMarker: { $$ = nil; }
  446.     | '<' KEYWORD NumberConstant '>'
  447.         { $$ = [NumberConstant sprintf:"primitive(%s);", [$3 str]]; [$3 free]; }
  448.     ;
  449. LocalVariables: { $$ = nil; }
  450.     | '|' VarList '|' 
  451.         { $$ = $2; }
  452.     ;
  453. VarList: { $$ = nil; }
  454.     | VarList VariableName 
  455.         { $$ = $1 ? $1 : [List new]; [$$ add:$2]; }
  456.     ;
  457. KwdMethodDecl: Keyword VariableName 
  458.     { [$$=$1 argument:$2]; }
  459.     | KwdMethodDecl Keyword VariableName 
  460.         { [$$=$1 add:[$2 argument:$3]]; }
  461.     ;
  462. /* Statements and expressions */
  463. StmtList: '^' Expr 
  464.     { $$ = [Return expr:$2]; }
  465.     | Expr 
  466.         { $$ = [Stmt expr:$1]; }
  467.     | Expr '.' 
  468.         { $$ = [Stmt expr:$1]; }
  469.     | Expr '.' StmtList 
  470.         { [$$=[Stmt expr:$1] successor:$3]; }
  471.     | error '.' 
  472.         { wer("erroneous statement ignored"); $$=nil; }
  473.     ;
  474. Expr: AssignmentList Primary 
  475.     { $$ = [Expr assign:$1 value:$2]; }
  476.     | AssignmentList SimpleMsgExpr 
  477.         { $$ = [Expr assign:$1 value:$2]; }
  478.     | AssignmentList SimpleMsgExpr CascadedMsgExpr
  479.         { [$$ = [Expr assign:$1 value:$2] cascade:$3]; }
  480.     ;
  481. AssignmentList: { $$ = nil; }
  482.     | AssignmentList VariableName '_'
  483.         { $$ = $1 ? $1 : [List new]; [$$ add:findSymbol($2)]; }
  484.     ;
  485. CascadedMsgExpr: CascadedMsg 
  486.     { $$=[Expr assign:nil value:$1]; }
  487.     | CascadedMsgExpr CascadedMsg 
  488.         { [$$=$1 add:[Expr assign:nil value:$2]]; }
  489.     ;
  490. CascadedMsg: ';' UnarySelector 
  491.     { $$ = [Msg selector:$2]; }
  492.     | ';' BinarySelector UnaryObjDesc 
  493.         { $$ = [Msg selector:[$2 argument:$3]]; }
  494.     | ';' KeywordArgList 
  495.         { $$ = [Msg selector:$2]; }
  496.     ;
  497. Primary: VariableName 
  498.     { $$ = findSymbol($1); }
  499.     | Literal | Block | '(' Expr ')' 
  500.         { $$ = $2; }
  501.     ;
  502. SimpleMsgExpr: UnaryExpr | BinaryExpr | KeywordExpr ;
  503. UnaryObjDesc: Primary | UnaryExpr ;
  504. UnaryExpr: UnaryObjDesc UnarySelector 
  505.     { $$ = [Msg receiver:$1 selector:$2]; } ;
  506. BinaryObjDesc: UnaryObjDesc | BinaryExpr ;
  507. BinaryExpr: BinaryObjDesc BinarySelector UnaryObjDesc
  508.         { $$ = [Msg receiver:$1 selector:[$2 argument:$3]]; } ;
  509. KeywordExpr: BinaryObjDesc KeywordArgList
  510.         { $$ = [Msg receiver:$1 selector:$2]; }
  511.     ;
  512. KeywordArgList: Keyword BinaryObjDesc    
  513.     { [$$=$1 argument:$2]; }
  514.     | KeywordArgList Keyword BinaryObjDesc 
  515.         { [$$=$1 add:[$2 argument:$3]]; }
  516.     ;
  517. Literal: CharacterConstant | StringConstant | NumberConstant
  518.     | '#' '(' ArrayMemberList ')' 
  519.         { $$ = $3; }
  520.     | '#' UnarySelector 
  521.         { $$=[SelectorConstant name:$2]; [$2 free]; }
  522.     | '#' BinarySelector 
  523.         { $$=[SelectorConstant name:$2]; [$2 free]; }
  524.     | '#' KeywordList 
  525.         { $$=[SelectorConstant name:$2]; [$2 free]; }
  526.     ;
  527. ArrayMemberList: { $$ = nil; }
  528.     | ArrayMemberList ArrayMember 
  529.         { [$$ = $1 ? $1 : [StArray new] add:$2]; }
  530.     ;
  531. ArrayMember: CharacterConstant | StringConstant | NumberConstant 
  532.     | UnarySelector | BinarySelector | KeywordList 
  533.     | '(' ArrayMemberList ')' 
  534.         { $$ = $2; }
  535.     ;
  536. Block: '[' BlockVariables StmtList ']' 
  537.     { $$ = [$2 statements:$3]; }
  538.     | '[' BlockVariables ']' 
  539.         { $$ = $2; }
  540.     ;
  541. BlockVariables: 
  542.     { $$ = [Block new]; }
  543.     | BlockVarList '|' 
  544.         { $$ = [[Block new] variables:$1]; }
  545.     ;
  546. BlockVarList: ':' VariableName 
  547.     { [$$ = [List new] add:$2]; }
  548.     | BlockVarList ':' VariableName 
  549.         { [$$=$1 add:$3]; }
  550.     ;
  551. /* Type inferencing rules */
  552. InferenceRule: '#' PatternType '[' ObjcMsgPattern ']'
  553.         { [msgTranslator install:[Template receiverType:[$4 receiverType]
  554.             selector:[$4 selector]] translation:[$4 type:$2]]; }
  555.     | Template '#' PatternType '[' ObjcMsgPattern ']'
  556.         { [msgTranslator install:$1 translation:[$5 type:$3]]; }
  557.     | Template '#' PatternType ObjcFunctionPattern
  558.         { [msgTranslator install:$1 translation:[$4 type:$3]]; }
  559.     | Template '#' PatternType StringConstant 
  560.         { [msgTranslator install:$1
  561.             translation:[StringTranslation type:$3 translation:$4]]; }
  562.     | '#' VariableName PatternType VariableName
  563.         { [IdentifierTranslation sourceName:$2 targetType:$3 targetName:$4]; }
  564.     ;
  565. Template: TemplateType UnarySelector
  566.         { $$ = [Template receiverType:$1 selector:$2]; }
  567.     | TemplateType BinarySelector TemplateType
  568.         { $$ = [Template receiverType:$1 selector:[$2 type:$3]]; }
  569.     | TemplateType KeywordPattern
  570.         { $$ = [Template receiverType:$1 selector:$2]; }
  571.     ;
  572. KeywordPattern: Keyword PatternType 
  573.     { [$$=$1 type:$2]; }
  574.     | KeywordPattern Keyword PatternType
  575.         { [$$=$1 add:$2]; [$2 type:$3]; }
  576.     ;
  577. ObjcFunctionPattern: VariableName '(' ObjcFunctionArgList ')'
  578.         { $$ = [FunctionTranslation name:$1 args:$3]; }
  579.     | VariableName '(' ')'
  580.         { $$ = [FunctionTranslation name:$1 args:0]; }
  581.     ;
  582. ObjcFunctionArgList: PatternType ParameterDesignator
  583.         { $$ = [ArgumentList type:$1 name:$2]; }
  584.     | ObjcFunctionArgList ',' PatternType ParameterDesignator
  585.         { [$$=$1 add:[ArgumentList type:$3 name:$4]]; }
  586.     ;
  587. ObjcMsgPattern: PatternType UnarySelector
  588.         { $$ = [MsgTranslation receiverType:$1 selector:$2]; }
  589.     | PatternType ObjcKeywordPattern
  590.         { $$ = [MsgTranslation receiverType:$1 selector:$2]; }
  591.     ;
  592. ObjcKeywordPattern: Keyword PatternType ParameterDesignator
  593.         { [$1 type:$2]; [$$=$1 argument:$3]; }
  594.     | ObjcKeywordPattern Keyword PatternType ParameterDesignator
  595.         { [$$=$1 add:$2]; [$2 type:$3]; [$2 argument:$3]; }
  596.     ;
  597. ParameterDesignator: VariableName
  598.     | '%' DIGITS { $$=[NumberConstant sprintf:"%%%s", $2]; }
  599.     ;
  600. /* Token Packaging */
  601. KeywordList: KEYWORD { $$ = [Selector str:$1]; }
  602.     | KeywordList KEYWORD { $$ = [$1 concatenateSTRAndFreeReceiver:$2]; }
  603.     ;
  604. BinarySelector: '-' { $$ = [Selector str:"-"]; }
  605.     | SpecialCharacter 
  606.         { char b[2]; b[0]=$1; b[1]=0; $$ = [Selector str:b]; }
  607.     | DOUBLESPECIAL { $$ = [Selector str:$1]; }
  608.     ;
  609. SpecialCharacter: '+' | '/' | '\\' | '*' | '~' | '<'
  610.     | '>' | '=' | '@' | '%' | '&' | '?' | ',' | '|'
  611.     ;
  612. PatternType: OptionalType { $$ = $1 ? $1 : types.ID; };
  613. TemplateType: OptionalType { $$ = $1 ? $1 : types.ANY; };
  614. OptionalType: { $$ = 0; } | '(' Type ')' { $$ = $2; };
  615. Type: IDENTIFIER { $$=[Type str:$1]; };
  616. VariableName: IDENTIFIER { $$=[Identifier str:$1]; };
  617. UnarySelector: IDENTIFIER { $$ = [Selector str:$1]; };
  618. CharacterConstant: CHARCON { $$ = [CharConstant str:$1]; };
  619. NumberConstant: DIGITS { $$ = [NumberConstant str:$1]; }
  620.     | '-' DIGITS %prec KEYWORD { $$ = [NumberConstant sprintf:"-%s", $2]; }
  621.     ;
  622. StringConstant: STRING { $$ = [StringConstant str:$1]; };
  623. Keyword: KEYWORD { $$ = [Selector str:$1]; };
  624. %%
  625.  
  626. \Rogue\Monster\
  627. else
  628.   echo "will not over write ./src/gram.y"
  629. fi
  630. if `test ! -s ./src/lex.l`
  631. then
  632. echo "writting ./src/lex.l"
  633. cat > ./src/lex.l << '\Rogue\Monster\'
  634. %{
  635. #include "Producer.h"
  636. #include "y.tab.h"
  637.     USE Comment;
  638.     LOCAL STR collect();
  639.     EXPORT BOOL lexFlag = NO;
  640.     IMPORT BOOL stripCommentsFlag;
  641. #ifndef OBJC_COX
  642. = CATEGORIES()
  643. #endif
  644. /* Intrudes between lexer and parser for token-level debugging */
  645. EXPORT int yylex() { STR typeStr, tokenValue; LOCAL char b[2]={0};
  646.     int type = rawlexer();
  647.     switch(type) {
  648.     case DIGITS: typeStr="DIGITS"; tokenValue = yylval.S; break;
  649.     case KEYWORD: typeStr="KEYWORD"; tokenValue = yylval.S; break;
  650.     case IDENTIFIER: typeStr="IDENTIFIER"; tokenValue = yylval.S; break;
  651.     case STRING: typeStr="STRING"; tokenValue = yylval.S; break;
  652.     case CHARCON: typeStr="CHARCON"; tokenValue = yylval.S; break;
  653.     default: b[0] = yylval.B; typeStr = tokenValue = b; break;
  654.     }
  655.     stockToken(tokenValue);
  656.     if (lexFlag) printf("::%3d=%10s: %s\n", type, typeStr, tokenValue);
  657.     return type;
  658. }
  659. LOCAL STR bitsToHex(s) STR s; { LOCAL char buf[80];
  660.     LOCAL char charToHex[]="0123456789abcdef";
  661.     unsigned short out = 0; STR p; int shiftBy;
  662.     p = buf; *p++ = '0'; *p++ = 'x';
  663.     for (shiftBy = 3; *s; shiftBy--,s++) {
  664.         out |= (unsigned)(*s != '0') << shiftBy;
  665.         if (shiftBy == 0) {
  666.             *p++ = charToHex[out];
  667.             out = 0;
  668.             shiftBy = 3;
  669.         }
  670.     }
  671.     *p = 0; return buf;
  672. }
  673. GETC(iod) IOD iod; { LOCAL char buf[BUFSIZ] = {0}; LOCAL STR p = buf;
  674.     if (*p == 0) { p = buf; *p = 0;
  675.         if (fgets(buf, sizeof(buf), iod) == NULL) { 
  676.             STR q = &buf[strlen(buf)];
  677.             *q++ = EOF; *q = 0;
  678.         }
  679.         if (!stripCommentsFlag) [Comment str:buf];
  680.     }
  681.     return *p++;
  682. }
  683. #      undef input
  684. #      define input() (((yytchar=yysptr>yysbuf?U(*--yysptr):GETC(yyin))==10?\
  685.     (yylineno++,yytchar):yytchar)==EOF?0:yytchar)
  686. #      define yylex rawlexer
  687. %}
  688. %%
  689. [ \t\n\f\r]+ { ; }
  690. "\"" { yylval.S = collect(yyleng); }
  691. "'" { yylval.S = collect(yyleng); return STRING; }
  692. [A-Za-z][A-Za-z0-9]* { yylval.S = yytext; return IDENTIFIER; }
  693. [A-Za-z][A-Za-z0-9]*: { yylval.S = yytext; return KEYWORD; }
  694. [+/\\*~<>=@%|&?][+/\\*~<>=@%|&?] { yylval.S = yytext; return DOUBLESPECIAL; }
  695. [0-9]+ |
  696. [0-9]*\.[0-9]+ { yylval.S = yytext; return DIGITS; }
  697. 2r[0-1]+ { yylval.S = bitsToHex(&yytext[2]); return DIGITS; }
  698. \$.  { yylval.S = &yytext[1]; return CHARCON; }
  699. \$!! { yylval.S = "!"; return CHARCON; }
  700. .  { return yylval.B = *yytext; }
  701. %%
  702. /* Collect a "String" 'CharacterConstant', #command or comment
  703.  *    The item to be collected is identified (in `what') from the
  704.  *    first character in yytext.
  705.  *
  706.  *    To save copying time, we collect as much as will fit directly in yytext[].
  707.  *    An instance of String is then created to hold any overflows. The str
  708.  *    returned from here will locate the result, whether held
  709.  *    in yytext or aString.
  710.  */
  711. LOCAL STR collect(len)
  712.     register short len;
  713. {
  714.     USE ByteArray; register short c;
  715.     LOCAL id overflow = 0; char what = *yytext;
  716.     if (overflow) overflow = [overflow free]; /* from last time around */
  717.     for(;;) {
  718.         if (len >= YYLMAX - 1) {
  719.             yytext[len] = 0; len = 0;
  720.             if (overflow) overflow = [overflow concatenateSTR:yytext];
  721.             else overflow = [ByteArray str:yytext];
  722.         }
  723.         switch(yytext[len++] = c = input()) {
  724.         case '\'': if (what == '\'') {
  725.                 if ((c = input()) == '\'') { yytext[len++] = c; continue; }
  726.                 else { unput(c); break; }
  727.             } else continue;
  728.         case '"': if (what == '"') break; else continue;
  729.         case '*': if (what != '/') continue;
  730.             if ((c = input()) == '/') { yytext[len++] = c; break; }
  731.             unput(c); continue;
  732.         case '\\': yytext[len++] = input(); continue;
  733.         case '\n': continue;
  734.         case 0: wer("Unterminated string or charconst"); break;
  735.         default: continue;
  736.         }
  737.         yytext[len] = 0;
  738.         return overflow
  739.             ? [(overflow = [overflow concatenateSTR:yytext]) str]
  740.             : yytext;
  741.     }
  742. }
  743. \Rogue\Monster\
  744. else
  745.   echo "will not over write ./src/lex.l"
  746. fi
  747. if `test ! -s ./src/Makefile`
  748. then
  749. echo "writting ./src/Makefile"
  750. cat > ./src/Makefile << '\Rogue\Monster\'
  751. # Producer: The Smalltalk to ObjectiveC Translator
  752. OCOBJ= Node.o List.o Block.o Comment.o \
  753.     ByteArray.o \
  754.         Symbol.o \
  755.         Constant.o \
  756.             Type.o \
  757.             CharConstant.o \
  758.             NumberConstant.o \
  759.             SelectorConstant.o \
  760.             StringConstant.o \
  761.     Expr.o StArray.o Class.o \
  762.     Msg.o Method.o Stmt.o Return.o \
  763.     MsgArgPattern.o \
  764.     MsgNamePattern.o \
  765.     MsgTranslator.o \
  766.     Template.o \
  767.     Selector.o \
  768.         ArgumentList.o \
  769.     Identifier.o \
  770.     IdentifierTranslation.o \
  771.     AbstractTranslation.o \
  772.         FunctionTranslation.o \
  773.         MsgTranslation.o \
  774.         StringTranslation.o \
  775.     Scope.o
  776. YACCOBJ=gram.o
  777. LEXOBJ=lex.o
  778. CCOBJ=gen.o main.o
  779. OBJ=$(OCOBJ) $(YACCOBJ) $(LEXOBJ) $(CCOBJ)
  780. LIBS=/u/ui/sb/Substrate.a
  781. OBJC=objcc -q -g
  782. MISC=main.m gram.y lex.l gen.m Producer.h 
  783. SRC=README Makefile $(MISC) `_suffix .m $(OCOBJ) $(CCOBJ) | tr ' ' '\012' | sort`
  784.  
  785. .SUFFIXES:
  786. .SUFFIXES: .y .l .m .o .c .me .i .f
  787. all: METHODDECLS.o producer
  788. producer: $(OBJ); $(OBJC) $(OBJ) && mv a.out producer
  789. clean:        ; rm -f *.o *.c [cpCP]_* log core gram.m lex.m
  790. .y.o:        ; yacc -dv $< && mv y.tab.c $*.m && $(OBJC) -c $*.m
  791. .l.o:        ; lex $< && mv lex.yy.c $*.m && $(OBJC) -c $*.m
  792. .m.o:        ; $(OBJC) -c -nRetain $<
  793. .m.c:        ; $(OBJC) -c $<
  794. .me.i:        ; me -i -t /u/cox/src/mac.me $<
  795. .me.f:        ; me -t /u/cox/src/mac.me $< >$$$$.f && mv $$$$.f $*.f
  796. v.m: v.st    ; -producer RULES/* v.st >v.m
  797. v.o: v.m    ; objc v.m -c -Retain -g -q -I../wg -I../ui $C
  798. test:        ; rm -f v.m; make v.o
  799. wc:            ; wc $(SRC)
  800. \Rogue\Monster\
  801. else
  802.   echo "will not over write ./src/Makefile"
  803. fi
  804. if `test ! -s ./src/design.me`
  805. then
  806. echo "writting ./src/design.me"
  807. cat > ./src/design.me << '\Rogue\Monster\'
  808. Smalltalk Syntax consists of
  809.     identifiers
  810.     literal constants
  811.     message expressions
  812.         Return type
  813.         Argument types
  814.  
  815. Literal constant typing is explicit from context
  816.     Integer
  817.     Floating Point
  818.     String
  819.     Character
  820.  
  821. Identifier type inferencing
  822.     Identifier name transformation: How to specify scope of change?
  823.     The type of each identifier is the type of the first assignment.
  824.     Instance variables: generate declaration at tail of file after
  825.         assignments have provided a type for each?
  826.     Inherited variables: do these appear in methods of Smalltalk 
  827.         subclasses?
  828.  
  829. Message expression type inferencing
  830.     (int) do:(TYPE) this:(TYPE) to:(TYPE) that:(TYPE)
  831.     Return type and argument types are taken from category files
  832.         after performing any message name transforms
  833.  
  834. Method type inferencing
  835.     When Objective-C method exists by the same name, use types from
  836.         that
  837.     Otherwise the type is determined after inferencing variable types.
  838.  
  839. Static polymorphism
  840.     When translation of messages should depend on the (static) type of
  841.     the receiver; e.g.
  842.         (10@20) extent:(30@40) -> [Rectangle origin:pt(10,20) extent:(30@40)]
  843.         aRectangle extent:(30@40) -> [Rectangle extent:pt(30@40)]
  844.     or
  845.         aPoint x                 -> X(aPoint)
  846.         aRectangle origin         -> aRectangle->origin
  847.         aRectangle left            -> L(aRectangle)
  848.     or better yet
  849.         2 + 3                    -> 2+3
  850.         2.3 + 4.8                -> 2.3 + 4.8
  851.         aPoint + anotherPoint     -> ptPlus(aPoint, anotherPoint)
  852.         aPoint + 3                -> ptPlusInt(aPoint, 3)
  853.  
  854. Notation:
  855.     ReceiverType MessageExpression -> ReturnType FormatString
  856.     \________Source_____________/      \______Target_________/
  857.         Default:
  858.             ReceiverType:            matches id
  859.             ReturnType:                id
  860.             FormatString:            message expression
  861.  
  862.     Examples:
  863.     (int)+(int)                        -> $1 + $2
  864.     (float)+(float)                    -> $1 + $2
  865.     (PT)+(PT)                        -> ptPlus($1, $2)
  866.     (PT)+(int)                        -> ptPlusInt($1, $2)
  867. \Rogue\Monster\
  868. else
  869.   echo "will not over write ./src/design.me"
  870. fi
  871. if `test ! -s ./src/Symbol.m`
  872. then
  873. echo "writting ./src/Symbol.m"
  874. cat > ./src/Symbol.m << '\Rogue\Monster\'
  875. /*{ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  876. Symbol
  877.     My instances in only a single copy, allowing them to be tested for
  878.     equality via == instead of isEqual:
  879.  
  880. bjc: A prototype; not tested under load. The hash and isEqual: methods
  881.     have broken since I was here last (library incompatibilities?)
  882. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ }*/
  883. #include "Producer.h"
  884.     USE Set;
  885. = Symbol:ByteArray CATEGORIES() { }
  886.     LOCAL id symbolTable;
  887.  
  888. + initialize
  889.     { if (!symbolTable) symbolTable = [Set new]; }
  890. + symbolTable
  891.     { return symbolTable; }
  892. + str:(STR)aStr 
  893.     { return [symbolTable filter:[super str:aStr]]; }
  894. + name:aByteArray 
  895.     { return [self str:[aByteArray str]]; }
  896. - free 
  897.     { return nil; }
  898. - str:(STR)aStr 
  899.     { return [self cannotModifyError]; }
  900. - (char)charAt:(unsigned)anOffset put:(char)aChar 
  901.     { return (char)[self cannotModifyError]; }
  902. - sort 
  903.     { return [self cannotModifyError]; }
  904. - concat:aStr 
  905.     { return [self cannotModifyError]; }
  906. - concatSTR:(STR)aCString
  907.     { return [self cannotModifyError]; }
  908. - concatenateAndFreeReceiver:aByteArray 
  909.     { return [self cannotModifyError]; }
  910. - concatenateSTRAndFreeReceiver:(STR)aString 
  911.     { return [self cannotModifyError]; }
  912. - concatenateSTR:(STR)aString 
  913.     { return [self cannotModifyError]; }
  914. - concatenate:aByteArray
  915.     { return [self cannotModifyError]; }
  916. - cannotModifyError
  917.     { return [self error:"the bytes in a %s are invarient", [self name]]; }
  918. #ifdef NOTWORKING
  919. - (unsigned)hash 
  920.     { return (unsigned)self; }
  921. - (BOOL)isEqual:anObject
  922.     { return self == anObject; }
  923. #endif
  924. =:
  925.  
  926. \Rogue\Monster\
  927. else
  928.   echo "will not over write ./src/Symbol.m"
  929. fi
  930. if `test ! -s ./src/ByteArray.m`
  931. then
  932. echo "writting ./src/ByteArray.m"
  933. cat > ./src/ByteArray.m << '\Rogue\Monster\'
  934. /*{ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  935. ByteArray.m
  936.     Do not be misled by the superficial resemblance between this class
  937.     and the BytArray class in functionality, method names, implementation, 
  938.     and usage. They are totally different.
  939. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ }*/
  940. #include <stdio.h>    /* @retain */
  941. #include "Producer.h"
  942. #include "vectors.h"    /* @retain */
  943. #define badIndex(offset) ((unsigned)(offset) >= (unsigned)capacity)
  944. #define goodIndex(offset) (!badIndex(offset))
  945.     LOCAL char typeStr[]="\"";
  946.     IMPORT int strlen(), atoi();
  947.     IMPORT long atol();
  948.     IMPORT double atof();
  949.     IMPORT STR strcpy(), strcat();
  950.     IMPORT unsigned _strhash();
  951.  
  952. = ByteArray:Array CATEGORIES() { }
  953.  
  954. // Indexed variable typing
  955. + (unsigned)ndxVarSize { return sizeof(char); }
  956. + (STR)ndxVarType { return typeStr; }
  957. - (STR)describe { return typeStr; }
  958.  
  959. // Instance creation: Note that capacity records the capacity actually
  960. //    available for characters. This is one more than the number requested
  961. //    to guarantee that a null terminator will exist.
  962. + new { return [self new:0]; }
  963. + new:(unsigned)nExtra { self = (*_alloc)(self, nExtra+1);
  964.     capacity = nExtra + 1; return self; 
  965. }
  966. + str:(STR)aStr { unsigned n; if (aStr == 0) aStr = "";
  967.     n = strlen(aStr); self = (*_alloc)(self, n+1);
  968.     strcpy(IV(self), aStr); capacity = n+1; return self;
  969. }
  970. #define VA_TYPE int
  971. + sprintf:(STR)fmt; VA_TYPE va_alist; { char buf[BUFSIZ];
  972. #ifdef BOOTSTRAP    /* @retain */
  973. typedef int FILE;
  974. #endif
  975. #include "varargs.h"    /* @retain */
  976. #ifdef BOOTSTRAP    /* @retain */
  977. typedef char *va_list;
  978. #endif
  979. #ifdef _IOSTRG        /* @retain */
  980.     {
  981.     va_list ap;
  982.     FILE iod;
  983.     iod._cnt = sizeof(buf); iod._base = iod._ptr = buf;
  984.     iod._flag = _IOWRT+_IOSTRG; va_start(ap);
  985.     _prn(fmt, ap, &iod); va_end(ap);
  986.     *iod._ptr = '\0';
  987.     }
  988. #else
  989. # define INT int
  990.     {
  991.     va_list ap;
  992.     int ilist[10]; register int *ip = ilist, i;
  993.     va_start (ap);
  994.     for (i = 0; i < 10; i++)
  995.         *ip++ = va_arg(ap, INT);
  996.     va_end (ap);
  997.     ip = ilist;
  998.     sprintf (buf, fmt, ip[0], ip[1], ip[2], ip[3], ip[4], ip[5],
  999.          ip[6], ip[7], ip[8], ip[9]);
  1000.     }
  1001. #endif
  1002.     return [self str:buf];
  1003. }
  1004. // Convert to indicated type
  1005. - (int)asInt { return atoi(IV(self)); } 
  1006. - (long)asLong { return atol(IV(self)); }
  1007. - (double)asFloat { return atof(IV(self)); }
  1008.  
  1009. // Accessing
  1010. - (STR)str { return IV(self); }
  1011. - str:(STR)aStr { strncpy(IV(self), aStr, capacity-1);
  1012.     IV(self)[capacity-1] = '\0'; return self; }
  1013. - (char)charAt:(unsigned)anOffset { return goodIndex(anOffset) ? 
  1014.     IV(self)[anOffset] : (char)[self boundsViolation:anOffset];
  1015. }
  1016. - (char)charAt:(unsigned)anOffset put:(char)aChar { STR p = IV(self)+anOffset;
  1017.     if goodIndex(anOffset) { char tmp= *p; *p=aChar; return tmp; }
  1018.     else return (char)[self boundsViolation:anOffset];
  1019. }
  1020.     LOCAL int cmp(a, b) char *a, *b; { return *a-*b; }
  1021. - sort { qsort(IV(self), capacity-1, sizeof(char), cmp); return self; }
  1022.  
  1023. #ifdef OBSOLETE
  1024. // Concatenate aStr to self. Reply 0 if truncation occurred.
  1025. - concat:aStr { return [self concatSTR:[aStr str]]; }
  1026. - concatSTR:(STR)aCString { unsigned me, l; if (aCString == 0) return 0;
  1027.     me = strlen(IV(self)); l = capacity-1;
  1028.     if (l > me) strncpy(IV(self)+me, aCString, l-me); 
  1029.     IV(self)[capacity-1] = '\0';
  1030.     return (l > me + strlen(aCString)) ? self : nil;
  1031. }
  1032. #endif
  1033. - concatenateAndFreeReceiver:aByteArray 
  1034.     { return [self concatenateSTRAndFreeReceiver:[aByteArray str]]; }
  1035. - concatenateSTRAndFreeReceiver:(STR)aString 
  1036.     { id tmp = [self concatenate:aString]; [self free]; return tmp; }
  1037. - concatenateSTR:(STR)aString 
  1038.     { return [isa sprintf:"%s%s", [self str], aString]; }
  1039. - concatenate:aByteArray
  1040.     { return [self concatenateSTR:[aByteArray str]]; }
  1041.  
  1042. // Comparing and hashing: hash must correlate with isEqual:
  1043. LOCAL int arycmp(obj, str) id obj; register STR str; {
  1044.     register unsigned siz = obj->capacity; register STR p = IV(obj);
  1045.     for (; siz--; p++, str++) if (*p != *str) return *p - *str;
  1046.     return 0;
  1047. }
  1048. - (int)compare:aStr { return aStr ? arycmp(self, [aStr str]) : NO; }
  1049. - (int)compareSTR:(STR)aStr { return aStr ? arycmp(self, aStr) : NO; }
  1050. - (BOOL)isEqual:aStr { return aStr ? arycmp(self, [aStr str]) == 0 : NO; }
  1051. - (BOOL)isEqualSTR:(STR)aStr { return aStr ? arycmp(self, aStr) == 0 : NO; }
  1052. - (BOOL)isCopyOf:anObject {
  1053.     return [super isCopyOf:anObject]
  1054.         && (arycmp(self, IV(anObject)) == 0);
  1055. }
  1056. - (unsigned)hash 
  1057.     { return _strhash(IV(self)); }
  1058. =:
  1059. \Rogue\Monster\
  1060. else
  1061.   echo "will not over write ./src/ByteArray.m"
  1062. fi
  1063. if `test ! -s ./src/y.output`
  1064. then
  1065. echo "writting ./src/y.output"
  1066. cat > ./src/y.output << '\Rogue\Monster\'
  1067.  
  1068. state 0
  1069.     $accept : _ChunkList $end 
  1070.     ChunkList : _    (1)
  1071.  
  1072.     .  reduce 1
  1073.  
  1074.     ChunkList  goto 1
  1075.  
  1076. state 1
  1077.     $accept :  ChunkList_$end 
  1078.     ChunkList :  ChunkList_Chunk 
  1079.  
  1080.     $end  accept
  1081.     error  shift 5
  1082.     IDENTIFIER  shift 6
  1083.     {  shift 4
  1084.     .  error
  1085.  
  1086.     VariableName  goto 3
  1087.     Chunk  goto 2
  1088.  
  1089. state 2
  1090.     ChunkList :  ChunkList Chunk_    (2)
  1091.  
  1092.     .  reduce 2
  1093.  
  1094.  
  1095. state 3
  1096.     Chunk :  VariableName_KEYWORD # VariableName KEYWORD StringConstant KEYWORD StringConstant KEYWORD StringConstant KEYWORD StringConstant ! 
  1097.     Chunk :  VariableName_KEYWORD STRING ! $$4 Methods Sep 
  1098.     Chunk :  VariableName_VariableName KEYWORD STRING ! $$6 Methods Sep 
  1099.  
  1100.     IDENTIFIER  shift 6
  1101.     KEYWORD  shift 7
  1102.     .  error
  1103.  
  1104.     VariableName  goto 8
  1105.  
  1106. state 4
  1107.     Chunk :  {_InferenceRule } 
  1108.     Chunk :  {_error } 
  1109.     OptionalType : _    (123)
  1110.  
  1111.     error  shift 10
  1112.     #  shift 11
  1113.     (  shift 15
  1114.     .  reduce 123
  1115.  
  1116.     Template  goto 12
  1117.     InferenceRule  goto 9
  1118.     OptionalType  goto 14
  1119.     TemplateType  goto 13
  1120.  
  1121. state 5
  1122.     Chunk :  error_! 
  1123.  
  1124.     !  shift 16
  1125.     .  error
  1126.  
  1127.  
  1128. state 6
  1129.     VariableName :  IDENTIFIER_    (126)
  1130.  
  1131.     .  reduce 126
  1132.  
  1133.  
  1134. state 7
  1135.     Chunk :  VariableName KEYWORD_# VariableName KEYWORD StringConstant KEYWORD StringConstant KEYWORD StringConstant KEYWORD StringConstant ! 
  1136.     Chunk :  VariableName KEYWORD_STRING ! $$4 Methods Sep 
  1137.  
  1138.     STRING  shift 18
  1139.     #  shift 17
  1140.     .  error
  1141.  
  1142.  
  1143. state 8
  1144.     Chunk :  VariableName VariableName_KEYWORD STRING ! $$6 Methods Sep 
  1145.  
  1146.     KEYWORD  shift 19
  1147.     .  error
  1148.  
  1149.  
  1150. state 9
  1151.     Chunk :  { InferenceRule_} 
  1152.  
  1153.     }  shift 20
  1154.     .  error
  1155.  
  1156.  
  1157. state 10
  1158.     Chunk :  { error_} 
  1159.  
  1160.     }  shift 21
  1161.     .  error
  1162.  
  1163.  
  1164. state 11
  1165.     InferenceRule :  #_PatternType [ ObjcMsgPattern ] 
  1166.     InferenceRule :  #_VariableName PatternType VariableName 
  1167.     OptionalType : _    (123)
  1168.  
  1169.     IDENTIFIER  shift 6
  1170.     (  shift 15
  1171.     .  reduce 123
  1172.  
  1173.     VariableName  goto 23
  1174.     OptionalType  goto 24
  1175.     PatternType  goto 22
  1176.  
  1177. state 12
  1178.     InferenceRule :  Template_# PatternType [ ObjcMsgPattern ] 
  1179.     InferenceRule :  Template_# PatternType ObjcFunctionPattern 
  1180.     InferenceRule :  Template_# PatternType StringConstant 
  1181.  
  1182.     #  shift 25
  1183.     .  error
  1184.  
  1185.  
  1186. state 13
  1187.     Template :  TemplateType_UnarySelector 
  1188.     Template :  TemplateType_BinarySelector TemplateType 
  1189.     Template :  TemplateType_KeywordPattern 
  1190.  
  1191.     IDENTIFIER  shift 29
  1192.     KEYWORD  shift 48
  1193.     DOUBLESPECIAL  shift 32
  1194.     %  shift 43
  1195.     |  shift 47
  1196.     &  shift 44
  1197.     ?  shift 45
  1198.     ,  shift 46
  1199.     +  shift 34
  1200.     -  shift 30
  1201.     /  shift 35
  1202.     \\  shift 36
  1203.     *  shift 37
  1204.     ~  shift 38
  1205.     <  shift 39
  1206.     >  shift 40
  1207.     =  shift 41
  1208.     @  shift 42
  1209.     .  error
  1210.  
  1211.     Keyword  goto 33
  1212.     BinarySelector  goto 27
  1213.     UnarySelector  goto 26
  1214.     KeywordPattern  goto 28
  1215.     SpecialCharacter  goto 31
  1216.  
  1217. state 14
  1218.     TemplateType :  OptionalType_    (122)
  1219.  
  1220.     .  reduce 122
  1221.  
  1222.  
  1223. state 15
  1224.     OptionalType :  (_Type ) 
  1225.  
  1226.     IDENTIFIER  shift 50
  1227.     .  error
  1228.  
  1229.     Type  goto 49
  1230.  
  1231. state 16
  1232.     Chunk :  error !_    (10)
  1233.  
  1234.     .  reduce 10
  1235.  
  1236.  
  1237. state 17
  1238.     Chunk :  VariableName KEYWORD #_VariableName KEYWORD StringConstant KEYWORD StringConstant KEYWORD StringConstant KEYWORD StringConstant ! 
  1239.  
  1240.     IDENTIFIER  shift 6
  1241.     .  error
  1242.  
  1243.     VariableName  goto 51
  1244.  
  1245. state 18
  1246.     Chunk :  VariableName KEYWORD STRING_! $$4 Methods Sep 
  1247.  
  1248.     !  shift 52
  1249.     .  error
  1250.  
  1251.  
  1252. state 19
  1253.     Chunk :  VariableName VariableName KEYWORD_STRING ! $$6 Methods Sep 
  1254.  
  1255.     STRING  shift 53
  1256.     .  error
  1257.  
  1258.  
  1259. state 20
  1260.     Chunk :  { InferenceRule }_    (8)
  1261.  
  1262.     .  reduce 8
  1263.  
  1264.  
  1265. state 21
  1266.     Chunk :  { error }_    (9)
  1267.  
  1268.     .  reduce 9
  1269.  
  1270.  
  1271. state 22
  1272.     InferenceRule :  # PatternType_[ ObjcMsgPattern ] 
  1273.  
  1274.     [  shift 54
  1275.     .  error
  1276.  
  1277.  
  1278. state 23
  1279.     InferenceRule :  # VariableName_PatternType VariableName 
  1280.     OptionalType : _    (123)
  1281.  
  1282.     (  shift 15
  1283.     .  reduce 123
  1284.  
  1285.     OptionalType  goto 24
  1286.     PatternType  goto 55
  1287.  
  1288. state 24
  1289.     PatternType :  OptionalType_    (121)
  1290.  
  1291.     .  reduce 121
  1292.  
  1293.  
  1294. state 25
  1295.     InferenceRule :  Template #_PatternType [ ObjcMsgPattern ] 
  1296.     InferenceRule :  Template #_PatternType ObjcFunctionPattern 
  1297.     InferenceRule :  Template #_PatternType StringConstant 
  1298.     OptionalType : _    (123)
  1299.  
  1300.     (  shift 15
  1301.     .  reduce 123
  1302.  
  1303.     OptionalType  goto 24
  1304.     PatternType  goto 56
  1305.  
  1306. state 26
  1307.     Template :  TemplateType UnarySelector_    (87)
  1308.  
  1309.     .  reduce 87
  1310.  
  1311.  
  1312. state 27
  1313.     Template :  TemplateType BinarySelector_TemplateType 
  1314.     OptionalType : _    (123)
  1315.  
  1316.     (  shift 15
  1317.     .  reduce 123
  1318.  
  1319.     OptionalType  goto 14
  1320.     TemplateType  goto 57
  1321.  
  1322. state 28
  1323.     Template :  TemplateType KeywordPattern_    (89)
  1324.     KeywordPattern :  KeywordPattern_Keyword PatternType 
  1325.  
  1326.     KEYWORD  shift 48
  1327.     .  reduce 89
  1328.  
  1329.     Keyword  goto 58
  1330.  
  1331. state 29
  1332.     UnarySelector :  IDENTIFIER_    (127)
  1333.  
  1334.     .  reduce 127
  1335.  
  1336.  
  1337. state 30
  1338.     BinarySelector :  -_    (104)
  1339.  
  1340.     .  reduce 104
  1341.  
  1342.  
  1343. state 31
  1344.     BinarySelector :  SpecialCharacter_    (105)
  1345.  
  1346.     .  reduce 105
  1347.  
  1348.  
  1349. state 32
  1350.     BinarySelector :  DOUBLESPECIAL_    (106)
  1351.  
  1352.     .  reduce 106
  1353.  
  1354.  
  1355. state 33
  1356.     KeywordPattern :  Keyword_PatternType 
  1357.     OptionalType : _    (123)
  1358.  
  1359.     (  shift 15
  1360.     .  reduce 123
  1361.  
  1362.     OptionalType  goto 24
  1363.     PatternType  goto 59
  1364.  
  1365. state 34
  1366.     SpecialCharacter :  +_    (107)
  1367.  
  1368.     .  reduce 107
  1369.  
  1370.  
  1371. state 35
  1372.     SpecialCharacter :  /_    (108)
  1373.  
  1374.     .  reduce 108
  1375.  
  1376.  
  1377. state 36
  1378.     SpecialCharacter :  \\_    (109)
  1379.  
  1380.     .  reduce 109
  1381.  
  1382.  
  1383. state 37
  1384.     SpecialCharacter :  *_    (110)
  1385.  
  1386.     .  reduce 110
  1387.  
  1388.  
  1389. state 38
  1390.     SpecialCharacter :  ~_    (111)
  1391.  
  1392.     .  reduce 111
  1393.  
  1394.  
  1395. state 39
  1396.     SpecialCharacter :  <_    (112)
  1397.  
  1398.     .  reduce 112
  1399.  
  1400.  
  1401. state 40
  1402.     SpecialCharacter :  >_    (113)
  1403.  
  1404.     .  reduce 113
  1405.  
  1406.  
  1407. state 41
  1408.     SpecialCharacter :  =_    (114)
  1409.  
  1410.     .  reduce 114
  1411.  
  1412.  
  1413. state 42
  1414.     SpecialCharacter :  @_    (115)
  1415.  
  1416.     .  reduce 115
  1417.  
  1418.  
  1419. state 43
  1420.     SpecialCharacter :  %_    (116)
  1421.  
  1422.     .  reduce 116
  1423.  
  1424.  
  1425. state 44
  1426.     SpecialCharacter :  &_    (117)
  1427.  
  1428.     .  reduce 117
  1429.  
  1430.  
  1431. state 45
  1432.     SpecialCharacter :  ?_    (118)
  1433.  
  1434.     .  reduce 118
  1435.  
  1436.  
  1437. state 46
  1438.     SpecialCharacter :  ,_    (119)
  1439.  
  1440.     .  reduce 119
  1441.  
  1442.  
  1443. state 47
  1444.     SpecialCharacter :  |_    (120)
  1445.  
  1446.     .  reduce 120
  1447.  
  1448.  
  1449. state 48
  1450.     Keyword :  KEYWORD_    (132)
  1451.  
  1452.     .  reduce 132
  1453.  
  1454.  
  1455. state 49
  1456.     OptionalType :  ( Type_) 
  1457.  
  1458.     )  shift 60
  1459.     .  error
  1460.  
  1461.  
  1462. state 50
  1463.     Type :  IDENTIFIER_    (125)
  1464.  
  1465.     .  reduce 125
  1466.  
  1467.  
  1468. state 51
  1469.     Chunk :  VariableName KEYWORD # VariableName_KEYWORD StringConstant KEYWORD StringConstant KEYWORD StringConstant KEYWORD StringConstant ! 
  1470.  
  1471.     KEYWORD  shift 61
  1472.     .  error
  1473.  
  1474.  
  1475. state 52
  1476.     Chunk :  VariableName KEYWORD STRING !_$$4 Methods Sep 
  1477.     $$4 : _    (4)
  1478.  
  1479.     .  reduce 4
  1480.  
  1481.     $$4  goto 62
  1482.  
  1483. state 53
  1484.     Chunk :  VariableName VariableName KEYWORD STRING_! $$6 Methods Sep 
  1485.  
  1486.     !  shift 63
  1487.     .  error
  1488.  
  1489.  
  1490. state 54
  1491.     InferenceRule :  # PatternType [_ObjcMsgPattern ] 
  1492.     OptionalType : _    (123)
  1493.  
  1494.     (  shift 15
  1495.     .  reduce 123
  1496.  
  1497.     ObjcMsgPattern  goto 64
  1498.     OptionalType  goto 24
  1499.     PatternType  goto 65
  1500.  
  1501. state 55
  1502.     InferenceRule :  # VariableName PatternType_VariableName 
  1503.  
  1504.     IDENTIFIER  shift 6
  1505.     .  error
  1506.  
  1507.     VariableName  goto 66
  1508.  
  1509. state 56
  1510.     InferenceRule :  Template # PatternType_[ ObjcMsgPattern ] 
  1511.     InferenceRule :  Template # PatternType_ObjcFunctionPattern 
  1512.     InferenceRule :  Template # PatternType_StringConstant 
  1513.  
  1514.     IDENTIFIER  shift 6
  1515.     STRING  shift 71
  1516.     [  shift 67
  1517.     .  error
  1518.  
  1519.     VariableName  goto 70
  1520.     ObjcFunctionPattern  goto 68
  1521.     StringConstant  goto 69
  1522.  
  1523. state 57
  1524.     Template :  TemplateType BinarySelector TemplateType_    (88)
  1525.  
  1526.     .  reduce 88
  1527.  
  1528.  
  1529. state 58
  1530.     KeywordPattern :  KeywordPattern Keyword_PatternType 
  1531.     OptionalType : _    (123)
  1532.  
  1533.     (  shift 15
  1534.     .  reduce 123
  1535.  
  1536.     OptionalType  goto 24
  1537.     PatternType  goto 72
  1538.  
  1539. state 59
  1540.     KeywordPattern :  Keyword PatternType_    (90)
  1541.  
  1542.     .  reduce 90
  1543.  
  1544.  
  1545. state 60
  1546.     OptionalType :  ( Type )_    (124)
  1547.  
  1548.     .  reduce 124
  1549.  
  1550.  
  1551. state 61
  1552.     Chunk :  VariableName KEYWORD # VariableName KEYWORD_StringConstant KEYWORD StringConstant KEYWORD StringConstant KEYWORD StringConstant ! 
  1553.  
  1554.     STRING  shift 71
  1555.     .  error
  1556.  
  1557.     StringConstant  goto 73
  1558.  
  1559. state 62
  1560.     Chunk :  VariableName KEYWORD STRING ! $$4_Methods Sep 
  1561.     Methods : _    (13)
  1562.  
  1563.     .  reduce 13
  1564.  
  1565.     Methods  goto 74
  1566.  
  1567. state 63
  1568.     Chunk :  VariableName VariableName KEYWORD STRING !_$$6 Methods Sep 
  1569.     $$6 : _    (6)
  1570.  
  1571.     .  reduce 6
  1572.  
  1573.     $$6  goto 75
  1574.  
  1575. state 64
  1576.     InferenceRule :  # PatternType [ ObjcMsgPattern_] 
  1577.  
  1578.     ]  shift 76
  1579.     .  error
  1580.  
  1581.  
  1582. state 65
  1583.     ObjcMsgPattern :  PatternType_UnarySelector 
  1584.     ObjcMsgPattern :  PatternType_ObjcKeywordPattern 
  1585.  
  1586.     IDENTIFIER  shift 29
  1587.     KEYWORD  shift 48
  1588.     .  error
  1589.  
  1590.     Keyword  goto 79
  1591.     UnarySelector  goto 77
  1592.     ObjcKeywordPattern  goto 78
  1593.  
  1594. state 66
  1595.     InferenceRule :  # VariableName PatternType VariableName_    (86)
  1596.  
  1597.     .  reduce 86
  1598.  
  1599.  
  1600. state 67
  1601.     InferenceRule :  Template # PatternType [_ObjcMsgPattern ] 
  1602.     OptionalType : _    (123)
  1603.  
  1604.     (  shift 15
  1605.     .  reduce 123
  1606.  
  1607.     ObjcMsgPattern  goto 80
  1608.     OptionalType  goto 24
  1609.     PatternType  goto 65
  1610.  
  1611. state 68
  1612.     InferenceRule :  Template # PatternType ObjcFunctionPattern_    (84)
  1613.  
  1614.     .  reduce 84
  1615.  
  1616.  
  1617. state 69
  1618.     InferenceRule :  Template # PatternType StringConstant_    (85)
  1619.  
  1620.     .  reduce 85
  1621.  
  1622.  
  1623. state 70
  1624.     ObjcFunctionPattern :  VariableName_( ObjcFunctionArgList ) 
  1625.     ObjcFunctionPattern :  VariableName_( ) 
  1626.  
  1627.     (  shift 81
  1628.     .  error
  1629.  
  1630.  
  1631. state 71
  1632.     StringConstant :  STRING_    (131)
  1633.  
  1634.     .  reduce 131
  1635.  
  1636.  
  1637. state 72
  1638.     KeywordPattern :  KeywordPattern Keyword PatternType_    (91)
  1639.  
  1640.     .  reduce 91
  1641.  
  1642.  
  1643. state 73
  1644.     Chunk :  VariableName KEYWORD # VariableName KEYWORD StringConstant_KEYWORD StringConstant KEYWORD StringConstant KEYWORD StringConstant ! 
  1645.  
  1646.     KEYWORD  shift 82
  1647.     .  error
  1648.  
  1649.  
  1650. state 74
  1651.     Chunk :  VariableName KEYWORD STRING ! $$4 Methods_Sep 
  1652.     Methods :  Methods_Method ! 
  1653.     Methods :  Methods_error ! 
  1654.  
  1655.     error  shift 85
  1656.     IDENTIFIER  shift 29
  1657.     KEYWORD  shift 48
  1658.     DOUBLESPECIAL  shift 32
  1659.     %  shift 43
  1660.     |  shift 47
  1661.     &  shift 44
  1662.     ?  shift 45
  1663.     !  shift 86
  1664.     ,  shift 46
  1665.     +  shift 34
  1666.     -  shift 30
  1667.     /  shift 35
  1668.     \\  shift 36
  1669.     *  shift 37
  1670.     ~  shift 38
  1671.     <  shift 39
  1672.     >  shift 40
  1673.     =  shift 41
  1674.     @  shift 42
  1675.     .  error
  1676.  
  1677.     Method  goto 84
  1678.     MethodName  goto 87
  1679.     Keyword  goto 91
  1680.     KwdMethodDecl  goto 90
  1681.     BinarySelector  goto 89
  1682.     UnarySelector  goto 88
  1683.     SpecialCharacter  goto 31
  1684.     Sep  goto 83
  1685.  
  1686. state 75
  1687.     Chunk :  VariableName VariableName KEYWORD STRING ! $$6_Methods Sep 
  1688.     Methods : _    (13)
  1689.  
  1690.     .  reduce 13
  1691.  
  1692.     Methods  goto 92
  1693.  
  1694. state 76
  1695.     InferenceRule :  # PatternType [ ObjcMsgPattern ]_    (82)
  1696.  
  1697.     .  reduce 82
  1698.  
  1699.  
  1700. state 77
  1701.     ObjcMsgPattern :  PatternType UnarySelector_    (96)
  1702.  
  1703.     .  reduce 96
  1704.  
  1705.  
  1706. state 78
  1707.     ObjcMsgPattern :  PatternType ObjcKeywordPattern_    (97)
  1708.     ObjcKeywordPattern :  ObjcKeywordPattern_Keyword PatternType ParameterDesignator 
  1709.  
  1710.     KEYWORD  shift 48
  1711.     .  reduce 97
  1712.  
  1713.     Keyword  goto 93
  1714.  
  1715. state 79
  1716.     ObjcKeywordPattern :  Keyword_PatternType ParameterDesignator 
  1717.     OptionalType : _    (123)
  1718.  
  1719.     (  shift 15
  1720.     .  reduce 123
  1721.  
  1722.     OptionalType  goto 24
  1723.     PatternType  goto 94
  1724.  
  1725. state 80
  1726.     InferenceRule :  Template # PatternType [ ObjcMsgPattern_] 
  1727.  
  1728.     ]  shift 95
  1729.     .  error
  1730.  
  1731.  
  1732. state 81
  1733.     ObjcFunctionPattern :  VariableName (_ObjcFunctionArgList ) 
  1734.     ObjcFunctionPattern :  VariableName (_) 
  1735.     OptionalType : _    (123)
  1736.  
  1737.     (  shift 15
  1738.     )  shift 97
  1739.     .  reduce 123
  1740.  
  1741.     ObjcFunctionArgList  goto 96
  1742.     OptionalType  goto 24
  1743.     PatternType  goto 98
  1744.  
  1745. state 82
  1746.     Chunk :  VariableName KEYWORD # VariableName KEYWORD StringConstant KEYWORD_StringConstant KEYWORD StringConstant KEYWORD StringConstant ! 
  1747.  
  1748.     STRING  shift 71
  1749.     .  error
  1750.  
  1751.     StringConstant  goto 99
  1752.  
  1753. state 83
  1754.     Chunk :  VariableName KEYWORD STRING ! $$4 Methods Sep_    (5)
  1755.     Sep :  Sep_! 
  1756.  
  1757.     !  shift 100
  1758.     .  reduce 5
  1759.  
  1760.  
  1761. state 84
  1762.     Methods :  Methods Method_! 
  1763.  
  1764.     !  shift 101
  1765.     .  error
  1766.  
  1767.  
  1768. state 85
  1769.     Methods :  Methods error_! 
  1770.  
  1771.     !  shift 102
  1772.     .  error
  1773.  
  1774.  
  1775. state 86
  1776.     Sep :  !_    (11)
  1777.  
  1778.     .  reduce 11
  1779.  
  1780.  
  1781. state 87
  1782.     Method :  MethodName_LocalVariables $$16 PrimMarker StmtList 
  1783.     LocalVariables : _    (23)
  1784.  
  1785.     |  shift 104
  1786.     .  reduce 23
  1787.  
  1788.     LocalVariables  goto 103
  1789.  
  1790. state 88
  1791.     MethodName :  UnarySelector_    (18)
  1792.  
  1793.     .  reduce 18
  1794.  
  1795.  
  1796. state 89
  1797.     MethodName :  BinarySelector_VariableName 
  1798.  
  1799.     IDENTIFIER  shift 6
  1800.     .  error
  1801.  
  1802.     VariableName  goto 105
  1803.  
  1804. state 90
  1805.     MethodName :  KwdMethodDecl_    (20)
  1806.     KwdMethodDecl :  KwdMethodDecl_Keyword VariableName 
  1807.  
  1808.     KEYWORD  shift 48
  1809.     .  reduce 20
  1810.  
  1811.     Keyword  goto 106
  1812.  
  1813. state 91
  1814.     KwdMethodDecl :  Keyword_VariableName 
  1815.  
  1816.     IDENTIFIER  shift 6
  1817.     .  error
  1818.  
  1819.     VariableName  goto 107
  1820.  
  1821. state 92
  1822.     Chunk :  VariableName VariableName KEYWORD STRING ! $$6 Methods_Sep 
  1823.     Methods :  Methods_Method ! 
  1824.     Methods :  Methods_error ! 
  1825.  
  1826.     error  shift 85
  1827.     IDENTIFIER  shift 29
  1828.     KEYWORD  shift 48
  1829.     DOUBLESPECIAL  shift 32
  1830.     %  shift 43
  1831.     |  shift 47
  1832.     &  shift 44
  1833.     ?  shift 45
  1834.     !  shift 86
  1835.     ,  shift 46
  1836.     +  shift 34
  1837.     -  shift 30
  1838.     /  shift 35
  1839.     \\  shift 36
  1840.     *  shift 37
  1841.     ~  shift 38
  1842.     <  shift 39
  1843.     >  shift 40
  1844.     =  shift 41
  1845.     @  shift 42
  1846.     .  error
  1847.  
  1848.     Method  goto 84
  1849.     MethodName  goto 87
  1850.     Keyword  goto 91
  1851.     KwdMethodDecl  goto 90
  1852.     BinarySelector  goto 89
  1853.     UnarySelector  goto 88
  1854.     SpecialCharacter  goto 31
  1855.     Sep  goto 108
  1856.  
  1857. state 93
  1858.     ObjcKeywordPattern :  ObjcKeywordPattern Keyword_PatternType ParameterDesignator 
  1859.     OptionalType : _    (123)
  1860.  
  1861.     (  shift 15
  1862.     .  reduce 123
  1863.  
  1864.     OptionalType  goto 24
  1865.     PatternType  goto 109
  1866.  
  1867. state 94
  1868.     ObjcKeywordPattern :  Keyword PatternType_ParameterDesignator 
  1869.  
  1870.     IDENTIFIER  shift 6
  1871.     %  shift 112
  1872.     .  error
  1873.  
  1874.     VariableName  goto 111
  1875.     ParameterDesignator  goto 110
  1876.  
  1877. state 95
  1878.     InferenceRule :  Template # PatternType [ ObjcMsgPattern ]_    (83)
  1879.  
  1880.     .  reduce 83
  1881.  
  1882.  
  1883. state 96
  1884.     ObjcFunctionPattern :  VariableName ( ObjcFunctionArgList_) 
  1885.     ObjcFunctionArgList :  ObjcFunctionArgList_, PatternType ParameterDesignator 
  1886.  
  1887.     ,  shift 114
  1888.     )  shift 113
  1889.     .  error
  1890.  
  1891.  
  1892. state 97
  1893.     ObjcFunctionPattern :  VariableName ( )_    (93)
  1894.  
  1895.     .  reduce 93
  1896.  
  1897.  
  1898. state 98
  1899.     ObjcFunctionArgList :  PatternType_ParameterDesignator 
  1900.  
  1901.     IDENTIFIER  shift 6
  1902.     %  shift 112
  1903.     .  error
  1904.  
  1905.     VariableName  goto 111
  1906.     ParameterDesignator  goto 115
  1907.  
  1908. state 99
  1909.     Chunk :  VariableName KEYWORD # VariableName KEYWORD StringConstant KEYWORD StringConstant_KEYWORD StringConstant KEYWORD StringConstant ! 
  1910.  
  1911.     KEYWORD  shift 116
  1912.     .  error
  1913.  
  1914.  
  1915. state 100
  1916.     Sep :  Sep !_    (12)
  1917.  
  1918.     .  reduce 12
  1919.  
  1920.  
  1921. state 101
  1922.     Methods :  Methods Method !_    (14)
  1923.  
  1924.     .  reduce 14
  1925.  
  1926.  
  1927. state 102
  1928.     Methods :  Methods error !_    (15)
  1929.  
  1930.     .  reduce 15
  1931.  
  1932.  
  1933. state 103
  1934.     Method :  MethodName LocalVariables_$$16 PrimMarker StmtList 
  1935.     $$16 : _    (16)
  1936.  
  1937.     .  reduce 16
  1938.  
  1939.     $$16  goto 117
  1940.  
  1941. state 104
  1942.     LocalVariables :  |_VarList | 
  1943.     VarList : _    (25)
  1944.  
  1945.     .  reduce 25
  1946.  
  1947.     VarList  goto 118
  1948.  
  1949. state 105
  1950.     MethodName :  BinarySelector VariableName_    (19)
  1951.  
  1952.     .  reduce 19
  1953.  
  1954.  
  1955. state 106
  1956.     KwdMethodDecl :  KwdMethodDecl Keyword_VariableName 
  1957.  
  1958.     IDENTIFIER  shift 6
  1959.     .  error
  1960.  
  1961.     VariableName  goto 119
  1962.  
  1963. state 107
  1964.     KwdMethodDecl :  Keyword VariableName_    (27)
  1965.  
  1966.     .  reduce 27
  1967.  
  1968.  
  1969. state 108
  1970.     Chunk :  VariableName VariableName KEYWORD STRING ! $$6 Methods Sep_    (7)
  1971.     Sep :  Sep_! 
  1972.  
  1973.     !  shift 100
  1974.     .  reduce 7
  1975.  
  1976.  
  1977. state 109
  1978.     ObjcKeywordPattern :  ObjcKeywordPattern Keyword PatternType_ParameterDesignator 
  1979.  
  1980.     IDENTIFIER  shift 6
  1981.     %  shift 112
  1982.     .  error
  1983.  
  1984.     VariableName  goto 111
  1985.     ParameterDesignator  goto 120
  1986.  
  1987. state 110
  1988.     ObjcKeywordPattern :  Keyword PatternType ParameterDesignator_    (98)
  1989.  
  1990.     .  reduce 98
  1991.  
  1992.  
  1993. state 111
  1994.     ParameterDesignator :  VariableName_    (100)
  1995.  
  1996.     .  reduce 100
  1997.  
  1998.  
  1999. state 112
  2000.     ParameterDesignator :  %_DIGITS 
  2001.  
  2002.     DIGITS  shift 121
  2003.     .  error
  2004.  
  2005.  
  2006. state 113
  2007.     ObjcFunctionPattern :  VariableName ( ObjcFunctionArgList )_    (92)
  2008.  
  2009.     .  reduce 92
  2010.  
  2011.  
  2012. state 114
  2013.     ObjcFunctionArgList :  ObjcFunctionArgList ,_PatternType ParameterDesignator 
  2014.     OptionalType : _    (123)
  2015.  
  2016.     (  shift 15
  2017.     .  reduce 123
  2018.  
  2019.     OptionalType  goto 24
  2020.     PatternType  goto 122
  2021.  
  2022. state 115
  2023.     ObjcFunctionArgList :  PatternType ParameterDesignator_    (94)
  2024.  
  2025.     .  reduce 94
  2026.  
  2027.  
  2028. state 116
  2029.     Chunk :  VariableName KEYWORD # VariableName KEYWORD StringConstant KEYWORD StringConstant KEYWORD_StringConstant KEYWORD StringConstant ! 
  2030.  
  2031.     STRING  shift 71
  2032.     .  error
  2033.  
  2034.     StringConstant  goto 123
  2035.  
  2036. state 117
  2037.     Method :  MethodName LocalVariables $$16_PrimMarker StmtList 
  2038.     PrimMarker : _    (21)
  2039.  
  2040.     <  shift 125
  2041.     .  reduce 21
  2042.  
  2043.     PrimMarker  goto 124
  2044.  
  2045. state 118
  2046.     LocalVariables :  | VarList_| 
  2047.     VarList :  VarList_VariableName 
  2048.  
  2049.     IDENTIFIER  shift 6
  2050.     |  shift 126
  2051.     .  error
  2052.  
  2053.     VariableName  goto 127
  2054.  
  2055. state 119
  2056.     KwdMethodDecl :  KwdMethodDecl Keyword VariableName_    (28)
  2057.  
  2058.     .  reduce 28
  2059.  
  2060.  
  2061. state 120
  2062.     ObjcKeywordPattern :  ObjcKeywordPattern Keyword PatternType ParameterDesignator_    (99)
  2063.  
  2064.     .  reduce 99
  2065.  
  2066.  
  2067. state 121
  2068.     ParameterDesignator :  % DIGITS_    (101)
  2069.  
  2070.     .  reduce 101
  2071.  
  2072.  
  2073. state 122
  2074.     ObjcFunctionArgList :  ObjcFunctionArgList , PatternType_ParameterDesignator 
  2075.  
  2076.     IDENTIFIER  shift 6
  2077.     %  shift 112
  2078.     .  error
  2079.  
  2080.     VariableName  goto 111
  2081.     ParameterDesignator  goto 128
  2082.  
  2083. state 123
  2084.     Chunk :  VariableName KEYWORD # VariableName KEYWORD StringConstant KEYWORD StringConstant KEYWORD StringConstant_KEYWORD StringConstant ! 
  2085.  
  2086.     KEYWORD  shift 129
  2087.     .  error
  2088.  
  2089.  
  2090. state 124
  2091.     Method :  MethodName LocalVariables $$16 PrimMarker_StmtList 
  2092.     AssignmentList : _    (37)
  2093.  
  2094.     error  shift 133
  2095.     ^  shift 131
  2096.     .  reduce 37
  2097.  
  2098.     StmtList  goto 130
  2099.     Expr  goto 132
  2100.     AssignmentList  goto 134
  2101.  
  2102. state 125
  2103.     PrimMarker :  <_KEYWORD NumberConstant > 
  2104.  
  2105.     KEYWORD  shift 135
  2106.     .  error
  2107.  
  2108.  
  2109. state 126
  2110.     LocalVariables :  | VarList |_    (24)
  2111.  
  2112.     .  reduce 24
  2113.  
  2114.  
  2115. state 127
  2116.     VarList :  VarList VariableName_    (26)
  2117.  
  2118.     .  reduce 26
  2119.  
  2120.  
  2121. state 128
  2122.     ObjcFunctionArgList :  ObjcFunctionArgList , PatternType ParameterDesignator_    (95)
  2123.  
  2124.     .  reduce 95
  2125.  
  2126.  
  2127. state 129
  2128.     Chunk :  VariableName KEYWORD # VariableName KEYWORD StringConstant KEYWORD StringConstant KEYWORD StringConstant KEYWORD_StringConstant ! 
  2129.  
  2130.     STRING  shift 71
  2131.     .  error
  2132.  
  2133.     StringConstant  goto 136
  2134.  
  2135. state 130
  2136.     Method :  MethodName LocalVariables $$16 PrimMarker StmtList_    (17)
  2137.  
  2138.     .  reduce 17
  2139.  
  2140.  
  2141. state 131
  2142.     StmtList :  ^_Expr 
  2143.     AssignmentList : _    (37)
  2144.  
  2145.     .  reduce 37
  2146.  
  2147.     Expr  goto 137
  2148.     AssignmentList  goto 134
  2149.  
  2150. state 132
  2151.     StmtList :  Expr_    (30)
  2152.     StmtList :  Expr_. 
  2153.     StmtList :  Expr_. StmtList 
  2154.  
  2155.     .  shift 138
  2156.     .  reduce 30
  2157.  
  2158.  
  2159. state 133
  2160.     StmtList :  error_. 
  2161.  
  2162.     .  shift 139
  2163.     .  error
  2164.  
  2165.  
  2166. state 134
  2167.     Expr :  AssignmentList_Primary 
  2168.     Expr :  AssignmentList_SimpleMsgExpr 
  2169.     Expr :  AssignmentList_SimpleMsgExpr CascadedMsgExpr 
  2170.     AssignmentList :  AssignmentList_VariableName _ 
  2171.  
  2172.     IDENTIFIER  shift 6
  2173.     DIGITS  shift 157
  2174.     STRING  shift 71
  2175.     CHARCON  shift 156
  2176.     #  shift 152
  2177.     -  shift 158
  2178.     (  shift 145
  2179.     [  shift 153
  2180.     .  error
  2181.  
  2182.     Primary  goto 140
  2183.     UnaryObjDesc  goto 154
  2184.     BinaryObjDesc  goto 155
  2185.     SimpleMsgExpr  goto 141
  2186.     UnaryExpr  goto 146
  2187.     BinaryExpr  goto 147
  2188.     KeywordExpr  goto 148
  2189.     Literal  goto 143
  2190.     Block  goto 144
  2191.     VariableName  goto 142
  2192.     CharacterConstant  goto 149
  2193.     NumberConstant  goto 151
  2194.     StringConstant  goto 150
  2195.  
  2196. state 135
  2197.     PrimMarker :  < KEYWORD_NumberConstant > 
  2198.  
  2199.     DIGITS  shift 157
  2200.     -  shift 158
  2201.     .  error
  2202.  
  2203.     NumberConstant  goto 159
  2204.  
  2205. state 136
  2206.     Chunk :  VariableName KEYWORD # VariableName KEYWORD StringConstant KEYWORD StringConstant KEYWORD StringConstant KEYWORD StringConstant_! 
  2207.  
  2208.     !  shift 160
  2209.     .  error
  2210.  
  2211.  
  2212. state 137
  2213.     StmtList :  ^ Expr_    (29)
  2214.  
  2215.     .  reduce 29
  2216.  
  2217.  
  2218. state 138
  2219.     StmtList :  Expr ._    (31)
  2220.     StmtList :  Expr ._StmtList 
  2221.     AssignmentList : _    (37)
  2222.  
  2223.     error  shift 133
  2224.     !  reduce 31
  2225.     ^  shift 131
  2226.     ]  reduce 31
  2227.     .  reduce 37
  2228.  
  2229.     StmtList  goto 161
  2230.     Expr  goto 132
  2231.     AssignmentList  goto 134
  2232.  
  2233. state 139
  2234.     StmtList :  error ._    (33)
  2235.  
  2236.     .  reduce 33
  2237.  
  2238.  
  2239. state 140
  2240.     Expr :  AssignmentList Primary_    (34)
  2241.     UnaryObjDesc :  Primary_    (51)
  2242.  
  2243.     !  reduce 34
  2244.     .  reduce 34
  2245.     )  reduce 34
  2246.     ]  reduce 34
  2247.     .  reduce 51
  2248.  
  2249.  
  2250. state 141
  2251.     Expr :  AssignmentList SimpleMsgExpr_    (35)
  2252.     Expr :  AssignmentList SimpleMsgExpr_CascadedMsgExpr 
  2253.  
  2254.     ;  shift 164
  2255.     .  reduce 35
  2256.  
  2257.     CascadedMsgExpr  goto 162
  2258.     CascadedMsg  goto 163
  2259.  
  2260. state 142
  2261.     AssignmentList :  AssignmentList VariableName__ 
  2262.     Primary :  VariableName_    (44)
  2263.  
  2264.     _  shift 165
  2265.     .  reduce 44
  2266.  
  2267.  
  2268. state 143
  2269.     Primary :  Literal_    (45)
  2270.  
  2271.     .  reduce 45
  2272.  
  2273.  
  2274. state 144
  2275.     Primary :  Block_    (46)
  2276.  
  2277.     .  reduce 46
  2278.  
  2279.  
  2280. state 145
  2281.     Primary :  (_Expr ) 
  2282.     AssignmentList : _    (37)
  2283.  
  2284.     .  reduce 37
  2285.  
  2286.     Expr  goto 166
  2287.     AssignmentList  goto 134
  2288.  
  2289. state 146
  2290.     SimpleMsgExpr :  UnaryExpr_    (48)
  2291.     UnaryObjDesc :  UnaryExpr_    (52)
  2292.  
  2293.     !  reduce 48
  2294.     .  reduce 48
  2295.     ;  reduce 48
  2296.     )  reduce 48
  2297.     ]  reduce 48
  2298.     .  reduce 52
  2299.  
  2300.  
  2301. state 147
  2302.     SimpleMsgExpr :  BinaryExpr_    (49)
  2303.     BinaryObjDesc :  BinaryExpr_    (55)
  2304.  
  2305.     !  reduce 49
  2306.     .  reduce 49
  2307.     ;  reduce 49
  2308.     )  reduce 49
  2309.     ]  reduce 49
  2310.     .  reduce 55
  2311.  
  2312.  
  2313. state 148
  2314.     SimpleMsgExpr :  KeywordExpr_    (50)
  2315.  
  2316.     .  reduce 50
  2317.  
  2318.  
  2319. state 149
  2320.     Literal :  CharacterConstant_    (60)
  2321.  
  2322.     .  reduce 60
  2323.  
  2324.  
  2325. state 150
  2326.     Literal :  StringConstant_    (61)
  2327.  
  2328.     .  reduce 61
  2329.  
  2330.  
  2331. state 151
  2332.     Literal :  NumberConstant_    (62)
  2333.  
  2334.     .  reduce 62
  2335.  
  2336.  
  2337. state 152
  2338.     Literal :  #_( ArrayMemberList ) 
  2339.     Literal :  #_UnarySelector 
  2340.     Literal :  #_BinarySelector 
  2341.     Literal :  #_KeywordList 
  2342.  
  2343.     IDENTIFIER  shift 29
  2344.     KEYWORD  shift 171
  2345.     DOUBLESPECIAL  shift 32
  2346.     %  shift 43
  2347.     |  shift 47
  2348.     &  shift 44
  2349.     ?  shift 45
  2350.     ,  shift 46
  2351.     +  shift 34
  2352.     -  shift 30
  2353.     /  shift 35
  2354.     \\  shift 36
  2355.     *  shift 37
  2356.     ~  shift 38
  2357.     <  shift 39
  2358.     >  shift 40
  2359.     =  shift 41
  2360.     @  shift 42
  2361.     (  shift 167
  2362.     .  error
  2363.  
  2364.     BinarySelector  goto 169
  2365.     UnarySelector  goto 168
  2366.     KeywordList  goto 170
  2367.     SpecialCharacter  goto 31
  2368.  
  2369. state 153
  2370.     Block :  [_BlockVariables StmtList ] 
  2371.     Block :  [_BlockVariables ] 
  2372.     BlockVariables : _    (78)
  2373.  
  2374.     :  shift 174
  2375.     .  reduce 78
  2376.  
  2377.     BlockVarList  goto 173
  2378.     BlockVariables  goto 172
  2379.  
  2380. state 154
  2381.     UnaryExpr :  UnaryObjDesc_UnarySelector 
  2382.     BinaryObjDesc :  UnaryObjDesc_    (54)
  2383.  
  2384.     IDENTIFIER  shift 29
  2385.     .  reduce 54
  2386.  
  2387.     UnarySelector  goto 175
  2388.  
  2389. state 155
  2390.     BinaryExpr :  BinaryObjDesc_BinarySelector UnaryObjDesc 
  2391.     KeywordExpr :  BinaryObjDesc_KeywordArgList 
  2392.  
  2393.     KEYWORD  shift 48
  2394.     DOUBLESPECIAL  shift 32
  2395.     %  shift 43
  2396.     |  shift 47
  2397.     &  shift 44
  2398.     ?  shift 45
  2399.     ,  shift 46
  2400.     +  shift 34
  2401.     -  shift 30
  2402.     /  shift 35
  2403.     \\  shift 36
  2404.     *  shift 37
  2405.     ~  shift 38
  2406.     <  shift 39
  2407.     >  shift 40
  2408.     =  shift 41
  2409.     @  shift 42
  2410.     .  error
  2411.  
  2412.     Keyword  goto 178
  2413.     KeywordArgList  goto 177
  2414.     BinarySelector  goto 176
  2415.     SpecialCharacter  goto 31
  2416.  
  2417. state 156
  2418.     CharacterConstant :  CHARCON_    (128)
  2419.  
  2420.     .  reduce 128
  2421.  
  2422.  
  2423. state 157
  2424.     NumberConstant :  DIGITS_    (129)
  2425.  
  2426.     .  reduce 129
  2427.  
  2428.  
  2429. state 158
  2430.     NumberConstant :  -_DIGITS 
  2431.  
  2432.     DIGITS  shift 179
  2433.     .  error
  2434.  
  2435.  
  2436. state 159
  2437.     PrimMarker :  < KEYWORD NumberConstant_> 
  2438.  
  2439.     >  shift 180
  2440.     .  error
  2441.  
  2442.  
  2443. state 160
  2444.     Chunk :  VariableName KEYWORD # VariableName KEYWORD StringConstant KEYWORD StringConstant KEYWORD StringConstant KEYWORD StringConstant !_    (3)
  2445.  
  2446.     .  reduce 3
  2447.  
  2448.  
  2449. state 161
  2450.     StmtList :  Expr . StmtList_    (32)
  2451.  
  2452.     .  reduce 32
  2453.  
  2454.  
  2455. state 162
  2456.     Expr :  AssignmentList SimpleMsgExpr CascadedMsgExpr_    (36)
  2457.     CascadedMsgExpr :  CascadedMsgExpr_CascadedMsg 
  2458.  
  2459.     ;  shift 164
  2460.     .  reduce 36
  2461.  
  2462.     CascadedMsg  goto 181
  2463.  
  2464. state 163
  2465.     CascadedMsgExpr :  CascadedMsg_    (39)
  2466.  
  2467.     .  reduce 39
  2468.  
  2469.  
  2470. state 164
  2471.     CascadedMsg :  ;_UnarySelector 
  2472.     CascadedMsg :  ;_BinarySelector UnaryObjDesc 
  2473.     CascadedMsg :  ;_KeywordArgList 
  2474.  
  2475.     IDENTIFIER  shift 29
  2476.     KEYWORD  shift 48
  2477.     DOUBLESPECIAL  shift 32
  2478.     %  shift 43
  2479.     |  shift 47
  2480.     &  shift 44
  2481.     ?  shift 45
  2482.     ,  shift 46
  2483.     +  shift 34
  2484.     -  shift 30
  2485.     /  shift 35
  2486.     \\  shift 36
  2487.     *  shift 37
  2488.     ~  shift 38
  2489.     <  shift 39
  2490.     >  shift 40
  2491.     =  shift 41
  2492.     @  shift 42
  2493.     .  error
  2494.  
  2495.     Keyword  goto 178
  2496.     KeywordArgList  goto 184
  2497.     BinarySelector  goto 183
  2498.     UnarySelector  goto 182
  2499.     SpecialCharacter  goto 31
  2500.  
  2501. state 165
  2502.     AssignmentList :  AssignmentList VariableName __    (38)
  2503.  
  2504.     .  reduce 38
  2505.  
  2506.  
  2507. state 166
  2508.     Primary :  ( Expr_) 
  2509.  
  2510.     )  shift 185
  2511.     .  error
  2512.  
  2513.  
  2514. state 167
  2515.     Literal :  # (_ArrayMemberList ) 
  2516.     ArrayMemberList : _    (67)
  2517.  
  2518.     .  reduce 67
  2519.  
  2520.     ArrayMemberList  goto 186
  2521.  
  2522. state 168
  2523.     Literal :  # UnarySelector_    (64)
  2524.  
  2525.     .  reduce 64
  2526.  
  2527.  
  2528. state 169
  2529.     Literal :  # BinarySelector_    (65)
  2530.  
  2531.     .  reduce 65
  2532.  
  2533.  
  2534. 170: shift/reduce conflict (shift 187, red'n 66) on KEYWORD
  2535. state 170
  2536.     Literal :  # KeywordList_    (66)
  2537.     KeywordList :  KeywordList_KEYWORD 
  2538.  
  2539.     KEYWORD  shift 187
  2540.     .  reduce 66
  2541.  
  2542.  
  2543. state 171
  2544.     KeywordList :  KEYWORD_    (102)
  2545.  
  2546.     .  reduce 102
  2547.  
  2548.  
  2549. state 172
  2550.     Block :  [ BlockVariables_StmtList ] 
  2551.     Block :  [ BlockVariables_] 
  2552.     AssignmentList : _    (37)
  2553.  
  2554.     error  shift 133
  2555.     ^  shift 131
  2556.     ]  shift 189
  2557.     .  reduce 37
  2558.  
  2559.     StmtList  goto 188
  2560.     Expr  goto 132
  2561.     AssignmentList  goto 134
  2562.  
  2563. state 173
  2564.     BlockVariables :  BlockVarList_| 
  2565.     BlockVarList :  BlockVarList_: VariableName 
  2566.  
  2567.     |  shift 190
  2568.     :  shift 191
  2569.     .  error
  2570.  
  2571.  
  2572. state 174
  2573.     BlockVarList :  :_VariableName 
  2574.  
  2575.     IDENTIFIER  shift 6
  2576.     .  error
  2577.  
  2578.     VariableName  goto 192
  2579.  
  2580. state 175
  2581.     UnaryExpr :  UnaryObjDesc UnarySelector_    (53)
  2582.  
  2583.     .  reduce 53
  2584.  
  2585.  
  2586. state 176
  2587.     BinaryExpr :  BinaryObjDesc BinarySelector_UnaryObjDesc 
  2588.  
  2589.     IDENTIFIER  shift 6
  2590.     DIGITS  shift 157
  2591.     STRING  shift 71
  2592.     CHARCON  shift 156
  2593.     #  shift 152
  2594.     -  shift 158
  2595.     (  shift 145
  2596.     [  shift 153
  2597.     .  error
  2598.  
  2599.     Primary  goto 194
  2600.     UnaryObjDesc  goto 193
  2601.     UnaryExpr  goto 195
  2602.     Literal  goto 143
  2603.     Block  goto 144
  2604.     VariableName  goto 196
  2605.     CharacterConstant  goto 149
  2606.     NumberConstant  goto 151
  2607.     StringConstant  goto 150
  2608.  
  2609. state 177
  2610.     KeywordExpr :  BinaryObjDesc KeywordArgList_    (57)
  2611.     KeywordArgList :  KeywordArgList_Keyword BinaryObjDesc 
  2612.  
  2613.     KEYWORD  shift 48
  2614.     .  reduce 57
  2615.  
  2616.     Keyword  goto 197
  2617.  
  2618. state 178
  2619.     KeywordArgList :  Keyword_BinaryObjDesc 
  2620.  
  2621.     IDENTIFIER  shift 6
  2622.     DIGITS  shift 157
  2623.     STRING  shift 71
  2624.     CHARCON  shift 156
  2625.     #  shift 152
  2626.     -  shift 158
  2627.     (  shift 145
  2628.     [  shift 153
  2629.     .  error
  2630.  
  2631.     Primary  goto 194
  2632.     UnaryObjDesc  goto 154
  2633.     BinaryObjDesc  goto 198
  2634.     UnaryExpr  goto 195
  2635.     BinaryExpr  goto 199
  2636.     Literal  goto 143
  2637.     Block  goto 144
  2638.     VariableName  goto 196
  2639.     CharacterConstant  goto 149
  2640.     NumberConstant  goto 151
  2641.     StringConstant  goto 150
  2642.  
  2643. state 179
  2644.     NumberConstant :  - DIGITS_    (130)
  2645.  
  2646.     .  reduce 130
  2647.  
  2648.  
  2649. state 180
  2650.     PrimMarker :  < KEYWORD NumberConstant >_    (22)
  2651.  
  2652.     .  reduce 22
  2653.  
  2654.  
  2655. state 181
  2656.     CascadedMsgExpr :  CascadedMsgExpr CascadedMsg_    (40)
  2657.  
  2658.     .  reduce 40
  2659.  
  2660.  
  2661. state 182
  2662.     CascadedMsg :  ; UnarySelector_    (41)
  2663.  
  2664.     .  reduce 41
  2665.  
  2666.  
  2667. state 183
  2668.     CascadedMsg :  ; BinarySelector_UnaryObjDesc 
  2669.  
  2670.     IDENTIFIER  shift 6
  2671.     DIGITS  shift 157
  2672.     STRING  shift 71
  2673.     CHARCON  shift 156
  2674.     #  shift 152
  2675.     -  shift 158
  2676.     (  shift 145
  2677.     [  shift 153
  2678.     .  error
  2679.  
  2680.     Primary  goto 194
  2681.     UnaryObjDesc  goto 200
  2682.     UnaryExpr  goto 195
  2683.     Literal  goto 143
  2684.     Block  goto 144
  2685.     VariableName  goto 196
  2686.     CharacterConstant  goto 149
  2687.     NumberConstant  goto 151
  2688.     StringConstant  goto 150
  2689.  
  2690. state 184
  2691.     CascadedMsg :  ; KeywordArgList_    (43)
  2692.     KeywordArgList :  KeywordArgList_Keyword BinaryObjDesc 
  2693.  
  2694.     KEYWORD  shift 48
  2695.     .  reduce 43
  2696.  
  2697.     Keyword  goto 197
  2698.  
  2699. state 185
  2700.     Primary :  ( Expr )_    (47)
  2701.  
  2702.     .  reduce 47
  2703.  
  2704.  
  2705. state 186
  2706.     Literal :  # ( ArrayMemberList_) 
  2707.     ArrayMemberList :  ArrayMemberList_ArrayMember 
  2708.  
  2709.     IDENTIFIER  shift 29
  2710.     DIGITS  shift 157
  2711.     KEYWORD  shift 171
  2712.     STRING  shift 71
  2713.     CHARCON  shift 156
  2714.     DOUBLESPECIAL  shift 32
  2715.     %  shift 43
  2716.     |  shift 47
  2717.     &  shift 44
  2718.     ?  shift 45
  2719.     ,  shift 46
  2720.     +  shift 34
  2721.     -  shift 210
  2722.     /  shift 35
  2723.     \\  shift 36
  2724.     *  shift 37
  2725.     ~  shift 38
  2726.     <  shift 39
  2727.     >  shift 40
  2728.     =  shift 41
  2729.     @  shift 42
  2730.     (  shift 209
  2731.     )  shift 201
  2732.     .  error
  2733.  
  2734.     ArrayMember  goto 202
  2735.     BinarySelector  goto 207
  2736.     UnarySelector  goto 206
  2737.     KeywordList  goto 208
  2738.     CharacterConstant  goto 203
  2739.     NumberConstant  goto 205
  2740.     StringConstant  goto 204
  2741.     SpecialCharacter  goto 31
  2742.  
  2743. state 187
  2744.     KeywordList :  KeywordList KEYWORD_    (103)
  2745.  
  2746.     .  reduce 103
  2747.  
  2748.  
  2749. state 188
  2750.     Block :  [ BlockVariables StmtList_] 
  2751.  
  2752.     ]  shift 211
  2753.     .  error
  2754.  
  2755.  
  2756. state 189
  2757.     Block :  [ BlockVariables ]_    (77)
  2758.  
  2759.     .  reduce 77
  2760.  
  2761.  
  2762. state 190
  2763.     BlockVariables :  BlockVarList |_    (79)
  2764.  
  2765.     .  reduce 79
  2766.  
  2767.  
  2768. state 191
  2769.     BlockVarList :  BlockVarList :_VariableName 
  2770.  
  2771.     IDENTIFIER  shift 6
  2772.     .  error
  2773.  
  2774.     VariableName  goto 212
  2775.  
  2776. state 192
  2777.     BlockVarList :  : VariableName_    (80)
  2778.  
  2779.     .  reduce 80
  2780.  
  2781.  
  2782. state 193
  2783.     UnaryExpr :  UnaryObjDesc_UnarySelector 
  2784.     BinaryExpr :  BinaryObjDesc BinarySelector UnaryObjDesc_    (56)
  2785.  
  2786.     IDENTIFIER  shift 29
  2787.     .  reduce 56
  2788.  
  2789.     UnarySelector  goto 175
  2790.  
  2791. state 194
  2792.     UnaryObjDesc :  Primary_    (51)
  2793.  
  2794.     .  reduce 51
  2795.  
  2796.  
  2797. state 195
  2798.     UnaryObjDesc :  UnaryExpr_    (52)
  2799.  
  2800.     .  reduce 52
  2801.  
  2802.  
  2803. state 196
  2804.     Primary :  VariableName_    (44)
  2805.  
  2806.     .  reduce 44
  2807.  
  2808.  
  2809. state 197
  2810.     KeywordArgList :  KeywordArgList Keyword_BinaryObjDesc 
  2811.  
  2812.     IDENTIFIER  shift 6
  2813.     DIGITS  shift 157
  2814.     STRING  shift 71
  2815.     CHARCON  shift 156
  2816.     #  shift 152
  2817.     -  shift 158
  2818.     (  shift 145
  2819.     [  shift 153
  2820.     .  error
  2821.  
  2822.     Primary  goto 194
  2823.     UnaryObjDesc  goto 154
  2824.     BinaryObjDesc  goto 213
  2825.     UnaryExpr  goto 195
  2826.     BinaryExpr  goto 199
  2827.     Literal  goto 143
  2828.     Block  goto 144
  2829.     VariableName  goto 196
  2830.     CharacterConstant  goto 149
  2831.     NumberConstant  goto 151
  2832.     StringConstant  goto 150
  2833.  
  2834. state 198
  2835.     BinaryExpr :  BinaryObjDesc_BinarySelector UnaryObjDesc 
  2836.     KeywordArgList :  Keyword BinaryObjDesc_    (58)
  2837.  
  2838.     DOUBLESPECIAL  shift 32
  2839.     %  shift 43
  2840.     |  shift 47
  2841.     &  shift 44
  2842.     ?  shift 45
  2843.     ,  shift 46
  2844.     +  shift 34
  2845.     -  shift 30
  2846.     /  shift 35
  2847.     \\  shift 36
  2848.     *  shift 37
  2849.     ~  shift 38
  2850.     <  shift 39
  2851.     >  shift 40
  2852.     =  shift 41
  2853.     @  shift 42
  2854.     .  reduce 58
  2855.  
  2856.     BinarySelector  goto 176
  2857.     SpecialCharacter  goto 31
  2858.  
  2859. state 199
  2860.     BinaryObjDesc :  BinaryExpr_    (55)
  2861.  
  2862.     .  reduce 55
  2863.  
  2864.  
  2865. state 200
  2866.     CascadedMsg :  ; BinarySelector UnaryObjDesc_    (42)
  2867.     UnaryExpr :  UnaryObjDesc_UnarySelector 
  2868.  
  2869.     IDENTIFIER  shift 29
  2870.     .  reduce 42
  2871.  
  2872.     UnarySelector  goto 175
  2873.  
  2874. state 201
  2875.     Literal :  # ( ArrayMemberList )_    (63)
  2876.  
  2877.     .  reduce 63
  2878.  
  2879.  
  2880. state 202
  2881.     ArrayMemberList :  ArrayMemberList ArrayMember_    (68)
  2882.  
  2883.     .  reduce 68
  2884.  
  2885.  
  2886. state 203
  2887.     ArrayMember :  CharacterConstant_    (69)
  2888.  
  2889.     .  reduce 69
  2890.  
  2891.  
  2892. state 204
  2893.     ArrayMember :  StringConstant_    (70)
  2894.  
  2895.     .  reduce 70
  2896.  
  2897.  
  2898. state 205
  2899.     ArrayMember :  NumberConstant_    (71)
  2900.  
  2901.     .  reduce 71
  2902.  
  2903.  
  2904. state 206
  2905.     ArrayMember :  UnarySelector_    (72)
  2906.  
  2907.     .  reduce 72
  2908.  
  2909.  
  2910. state 207
  2911.     ArrayMember :  BinarySelector_    (73)
  2912.  
  2913.     .  reduce 73
  2914.  
  2915.  
  2916. 208: shift/reduce conflict (shift 187, red'n 74) on KEYWORD
  2917. state 208
  2918.     ArrayMember :  KeywordList_    (74)
  2919.     KeywordList :  KeywordList_KEYWORD 
  2920.  
  2921.     KEYWORD  shift 187
  2922.     .  reduce 74
  2923.  
  2924.  
  2925. state 209
  2926.     ArrayMember :  (_ArrayMemberList ) 
  2927.     ArrayMemberList : _    (67)
  2928.  
  2929.     .  reduce 67
  2930.  
  2931.     ArrayMemberList  goto 214
  2932.  
  2933. 210: shift/reduce conflict (shift 179, red'n 104) on DIGITS
  2934. state 210
  2935.     BinarySelector :  -_    (104)
  2936.     NumberConstant :  -_DIGITS 
  2937.  
  2938.     DIGITS  shift 179
  2939.     .  reduce 104
  2940.  
  2941.  
  2942. state 211
  2943.     Block :  [ BlockVariables StmtList ]_    (76)
  2944.  
  2945.     .  reduce 76
  2946.  
  2947.  
  2948. state 212
  2949.     BlockVarList :  BlockVarList : VariableName_    (81)
  2950.  
  2951.     .  reduce 81
  2952.  
  2953.  
  2954. state 213
  2955.     BinaryExpr :  BinaryObjDesc_BinarySelector UnaryObjDesc 
  2956.     KeywordArgList :  KeywordArgList Keyword BinaryObjDesc_    (59)
  2957.  
  2958.     DOUBLESPECIAL  shift 32
  2959.     %  shift 43
  2960.     |  shift 47
  2961.     &  shift 44
  2962.     ?  shift 45
  2963.     ,  shift 46
  2964.     +  shift 34
  2965.     -  shift 30
  2966.     /  shift 35
  2967.     \\  shift 36
  2968.     *  shift 37
  2969.     ~  shift 38
  2970.     <  shift 39
  2971.     >  shift 40
  2972.     =  shift 41
  2973.     @  shift 42
  2974.     .  reduce 59
  2975.  
  2976.     BinarySelector  goto 176
  2977.     SpecialCharacter  goto 31
  2978.  
  2979. state 214
  2980.     ArrayMemberList :  ArrayMemberList_ArrayMember 
  2981.     ArrayMember :  ( ArrayMemberList_) 
  2982.  
  2983.     IDENTIFIER  shift 29
  2984.     DIGITS  shift 157
  2985.     KEYWORD  shift 171
  2986.     STRING  shift 71
  2987.     CHARCON  shift 156
  2988.     DOUBLESPECIAL  shift 32
  2989.     %  shift 43
  2990.     |  shift 47
  2991.     &  shift 44
  2992.     ?  shift 45
  2993.     ,  shift 46
  2994.     +  shift 34
  2995.     -  shift 210
  2996.     /  shift 35
  2997.     \\  shift 36
  2998.     *  shift 37
  2999.     ~  shift 38
  3000.     <  shift 39
  3001.     >  shift 40
  3002.     =  shift 41
  3003.     @  shift 42
  3004.     (  shift 209
  3005.     )  shift 215
  3006.     .  error
  3007.  
  3008.     ArrayMember  goto 202
  3009.     BinarySelector  goto 207
  3010.     UnarySelector  goto 206
  3011.     KeywordList  goto 208
  3012.     CharacterConstant  goto 203
  3013.     NumberConstant  goto 205
  3014.     StringConstant  goto 204
  3015.     SpecialCharacter  goto 31
  3016.  
  3017. state 215
  3018.     ArrayMember :  ( ArrayMemberList )_    (75)
  3019.  
  3020.     .  reduce 75
  3021.  
  3022.  
  3023. 37/300 terminals, 53/300 nonterminals
  3024. 133/600 grammar rules, 216/750 states
  3025. 3 shift/reduce, 0 reduce/reduce conflicts reported
  3026. 53/350 working sets used
  3027. memory: states,etc. 1089/24000, parser 269/12000
  3028. 109/600 distinct lookahead sets
  3029. 179 extra closures
  3030. 341 shift entries, 17 exceptions
  3031. 139 goto entries
  3032. 68 entries saved by goto default
  3033. Optimizer space used: input 909/24000, output 501/12000
  3034. 501 table entries, 143 zero
  3035. maximum spread: 262, maximum offset: 260
  3036. \Rogue\Monster\
  3037. else
  3038.   echo "will not over write ./src/y.output"
  3039. fi
  3040. echo "Finished archive 3 of 5"
  3041. exit
  3042. ----
  3043. Dieter H. Zebbedies ('dee-ter  ayech  'zeb-ed-eez)
  3044.  Zebb-Hoff Mach. Tool's Automated Manufacturing Project Cleveland, OH
  3045.  (USnail): 9535 Clinton Rd, Cleveland, OH 44144 (+216 631 6100) (+216 741-5994)
  3046.  (UUCP): ...{decvax,sun,cbosgd}!cwruecmp!zhmti!dieter
  3047.  (CSNET/ARPA/BITNET): dieter@CWRU.EDU
  3048.