Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

"Producer" translates Smalltalk to Objective-C (Part 3 of 5)

0 views
Skip to first unread message

Dieter H. Zebbedies

unread,
Aug 19, 1987, 9:56:33 PM8/19/87
to

"Producer", A package to translate Smalltalk-80 code to your favorite
object oriented language, Objective-C.

#!/bin/sh
# to extract, remove the header and type "sh filename"
if `test ! -d ./src`
then
mkdir ./src
echo "mkdir ./src"
fi
if `test ! -s ./src/Type.m`
then
echo "writting ./src/Type.m"
cat > ./src/Type.m << '\Rogue\Monster\'
#include "Producer.h"
TYPE types = { 0 };
LOCAL id knownTypes;
USE Set;
= Type : Constant CATEGORIES()
+ initialize { static BOOL beenHere;
if (!beenHere) { beenHere = YES;
self = Type; knownTypes = [Set new];

// C base types
types.ID = [self str:"id"];
types.CHAR = [self str:"char"];
types.SHORT = [self str:"short"];
types.INT = [self str:"int"];
types.LONG = [self str:"long"];
types.FLOAT = [self str:"float"];
types.DOUBLE = [self str:"double"];

// Common derived types
types.CSTRING = [self str:"STR"];
types.POINT = [self str:"PT"];
types.RECTANGLE = [self str:"RT"];

// Language types
types.BLOCK = [self str:"BLOCK"];
types.STMT = [self str:"STMT"];
types.SELECTOR = [self str:"SEL"];
types.SHARED = [self str:"SHR"];

// Misc
types.UNKNOWN = [self str:"unknown"];
types.ANY = [self str:"any"];
}
return self;
}
- type
{ return self; }
=:
\Rogue\Monster\
else
echo "will not over write ./src/Type.m"
fi
if `test ! -s ./src/gen.m`
then
echo "writting ./src/gen.m"
cat > ./src/gen.m << '\Rogue\Monster\'
#include "Producer.h"
#include "stdio.h"
#include "ctype.h"
= CATEGORIES()
LOCAL unsigned indent = 0;
LOCAL BOOL bol = YES;
LOCAL IOD genFD = stdout;
LOCAL STR yyfilename = "<stdin>";

// Debug option
EXPORT void po(o) id o;
{ [o show]; }
EXPORT void dbgo(o) id o;
{ IMPORT BOOL dbgFlag; if (dbgFlag) [o show]; }
EXPORT int yywrap()
{ IMPORT unsigned yylineno; yylineno = 1; return 1; }

// stockpile the last n tokens for printing in error messages
#define SIZ 30
LOCAL char minPt[SIZ+10] = ""; // slop
LOCAL STR inPt = &minPt[SIZ-1], maxPt = &minPt[SIZ-1];
EXPORT void stockToken(s) STR s; {
if (!s) return;
if (isalnum(*inPt) && isalnum(*s)) {
if (inPt >= maxPt) inPt = minPt;
*inPt++ = ' ';
}
while(*s) {
if (inPt >= maxPt) inPt = minPt;
*inPt++ = *s++;
}
}
LOCAL printToken(iod) IOD iod; { STR outPt, stopPt;
if (inPt >= maxPt) { outPt = minPt; stopPt = maxPt-1; }
else { outPt = inPt; stopPt = inPt-1; }
for(;;) {
if (outPt >= maxPt) outPt = minPt;
putc(*outPt ? *outPt : ' ', iod);
if (outPt++ == stopPt) break;
}
}
EXPORT IOD yyopen(file, mode, iod) STR file, mode; IOD iod; {
IMPORT IOD yyin; IMPORT unsigned yylineno;
yylineno = 1; return freopen(yyfilename = file, mode, yyin=stdin);
}
EXPORT int errorCount = 0;
EXPORT void wer(fmt, arg) STR fmt, arg; { IMPORT unsigned yylineno;
fflush(stdout); fflush(genFD); fflush(stderr);
fprintf(stderr, "error: ");
_doprnt(fmt, &arg, stderr); fprintf(stderr, "\n");
fflush(stdout); fflush(genFD); fflush(stderr);
errorCount++;
}
EXPORT void yyerror(fmt, arg) STR fmt, arg; { IMPORT unsigned yylineno;
fflush(stdout); fflush(genFD); fflush(stderr);
fprintf(stderr, "error %3d:%s: ", yylineno, yyfilename);
printToken(stderr); fprintf(stderr, " : ");
_doprnt(fmt, &arg, stderr); fprintf(stderr, "\n");
fflush(stdout); fflush(genFD); fflush(stderr);
errorCount++;
}
EXPORT BOOL infoFlag = NO;
EXPORT void info(fmt, arg) STR fmt, arg; { IMPORT unsigned yylineno;
if (!infoFlag) return;
fflush(stdout); fflush(genFD); fflush(stderr);
fprintf(stderr, "fyi %3d:%s: ", yylineno, yyfilename);
_doprnt(fmt, &arg, stderr); fflush(stderr);
}
// String copy
EXPORT STR strCopy(s) STR s; { return (STR)strcpy(malloc(strlen(s)+1), s); }

// fopen(genFD)
EXPORT void genOpen(className) STR className; {
if (genFD != stdout) fclose(genFD);
genFD = fopen(className, "w");
indent = 0; bol = YES;
if (!genFD) { fprintf(stderr, "cannot open %s for writing ", className);
perror("");
exit(-1);
}
}
EXPORT void genReset() { indent = 0; bol = YES; }

// Generate: formatted, string, newline, char
EXPORT void gc(c) { BOOL eol = NO, discardSemi = NO;
switch(c) {
case '\n': case '\r': case '\f': newline(); return;
case '{': eol = YES; discardSemi = NO; break;
case '}': indent--; eol = YES; discardSemi = YES; newline(); break;
case '(': indent++; discardSemi = NO; break;
case ')': indent--; discardSemi = NO; break;
case ';': if (discardSemi) return; eol = YES; discardSemi = YES; break;
default: discardSemi = NO; break;
}
if (bol) idn();
putc(c, genFD);
if (eol) newline();
if (c == '{'/*}*/) indent++;
}
EXPORT void gf(s, arg) STR s, arg; { _doprnt(s, &arg, genFD); }
EXPORT void gs(s) STR s; { while(*s) gc(*s++); }
EXPORT void gn() { bol = NO; newline(); }
LOCAL idn() { unsigned i;
for (i = indent; i-- != 0; ) putc('\t', genFD);
bol = NO;
}
LOCAL newline() {
if (!bol) putc('\n', genFD);
bol = YES;
}
\Rogue\Monster\
else
echo "will not over write ./src/gen.m"
fi
if `test ! -s ./src/main.m`
then
echo "writting ./src/main.m"
cat > ./src/main.m << '\Rogue\Monster\'
#include "stdio.h"
#include "Producer.h"
= CATEGORIES()
LOCAL BOOL showMsgTranslationFlag, showIdTranslationFlag;
STR *parseArguments(argc, argv) STR *argv; { unsigned i; USE Object;
IMPORT BOOL dbgFlag, msgFlag, allocFlag, printFlag, lexFlag, infoFlag,
autoFileFlag, stripCommentsFlag, infoFlag;
IMPORT IOD dbgIOD;
// settrap(); // trap interrupts
[Object self]; // trigger initializes now
dbgIOD = stderr;
for (i = 1; i < argc; i++) { STR arg = argv[i];
static char usage[]="usage: %s [-(dmaplgsci)] files ..";
if (*arg == '-')
switch (*++arg) {
case 'd': dbgFlag = YES; break;
case 'm': msgFlag = YES; break;
case 'a': allocFlag = YES; break;
case 'p': printFlag = YES; break;
case 'l': lexFlag = YES; break;
case 'g': autoFileFlag = YES; break;
case 's': stripCommentsFlag = YES; break;
case 'c': stripCommentsFlag = NO; break;
case 'i': infoFlag = YES; break;
case 'M': showMsgTranslationFlag = YES; break;
case 'I': showIdTranslationFlag = YES; break;
default: fprintf(stderr, usage, argv[0]); bye(-2);
}
else return &argv[i];
}
return 0;
}
main(argc, argv) STR *argv; { USE Comment;
IMPORT unsigned errorCount;
STR *file = parseArguments(argc, argv);
if (file) for (; *file; file++) {
if (yyopen(*file, "r", stdin)) yyparse();
else wer("cannot open %s\n", *file);
}
else yyparse();
bye(errorCount != 0);
}
// Exit here.
bye(n) { static BOOL beenHere = 0;
IMPORT id msgTranslator, identifierTranslator;
if (beenHere++) exit(n);
if (showMsgTranslationFlag) {
printf("msgTranslator============================\n");
[msgTranslator show];
}
if (showIdTranslationFlag) {
printf("identifierTranslator============================\n");
[identifierTranslator show];
}
exit(n);
}
@class(String, Block, ByteArray, Return, Selector, Comment, Stmt, AsciiFiler,
Expr, Msg, StArray, Method, List, IdArray, Sequence, Cltn,
Set, IntArray, Class, Identifier, MsgArgPattern, MsgNamePattern,
MsgTranslator, AbstractTranslation, FunctionTranslation,
MsgTranslation, StringTranslation, IdentifierTranslation,
CharConstant, Constant, NumberConstant, SelectorConstant, StringConstant,
Template, Type, ArgumentList, Scope)
@phyla CATEGORIES()
\Rogue\Monster\
else
echo "will not over write ./src/main.m"
fi
if `test ! -s ./src/Producer.h`
then
echo "writting ./src/Producer.h"
cat > ./src/Producer.h << '\Rogue\Monster\'
#ifndef PRODUCER_H
# include "Substrate.h"
# undef CATEGORIES
#ifndef COXLIB
# define CATEGORIES() (Producer, Collection, Primitive)
#else
# define CATEGORIES() (Producer, Substrate, Primitive)
#endif
# define ARYSIZ(x) (sizeof(x)/sizeof(*x))
# define strEq(a, b) (strcmp(a, b) == 0)
typedef struct _TYPES {
id DEFAULT, ID, CHAR, SHORT, INT, LONG, FLOAT, DOUBLE;
id CSTRING, POINT, RECTANGLE;
id BLOCK, STMT;
id SELECTOR, SHARED;
id UNKNOWN, ANY;
} TYPE;
IMPORT TYPE types;

# define AbstractTranslation prAbstractTranslation
# define ArgumentList prArgumentList
# define Block prBlock
# define CharConstant prCharConstant
# define Class prClass
# define Comment prComment
# define Constant prConstant
# define Expr prExpr
# define FunctionTranslation prFunctionTranslation
# define Identifier prIdentifier
# define IdentifierTranslation prIdentifierTranslation
# define List prList
# define Method prMethod
# define Msg prMsg
# define MsgArgPattern prMsgArgPattern
# define MsgNamePattern prMsgNamePattern
# define MsgTranslation prMsgTranslation
# define MsgTranslator prMsgTranslator
# define Node prNode
# define NumberConstant prNumberConstant
# define Return prReturn
# define Scope prScope
# define Selector prSelector
# define SelectorConstant prSelectorConstant
# define StArray prStArray
# define Stmt prStmt
# define StringConstant prStringConstant
# define StringTranslation prStringTranslation
# define Template prTemplate
# define Type prType

#define PRODUCER_H
#endif
\Rogue\Monster\
else
echo "will not over write ./src/Producer.h"
fi
if `test ! -s ./src/st80.h`
then
echo "writting ./src/st80.h"
cat > ./src/st80.h << '\Rogue\Monster\'
#ifndef PRODUCERTEST_H
# include "Layers.h"
# define ARYSIZ(x) (sizeof(x)/sizeof(*x))
# define strEq(a, b) (strcmp(a, b) == 0)

# undef CATEGORIES()
# define CATEGORIES() (ProducerTest, Collecting, Primitive)
# define unknown id
# define PRODUCERTEST_H
#endif
\Rogue\Monster\
else
echo "will not over write ./src/st80.h"
fi
if `test ! -s ./src/y.tab.h`
then
echo "writting ./src/y.tab.h"
cat > ./src/y.tab.h << '\Rogue\Monster\'

typedef union TYP { id O; char B; char *S; } YYSTYPE;
extern YYSTYPE yylval;
# define IDENTIFIER 257
# define DIGITS 258
# define KEYWORD 259
# define STRING 260
# define CHARCON 261
# define DOUBLESPECIAL 262
# define _ 95
# define VariableIdentifier 263
\Rogue\Monster\
else
echo "will not over write ./src/y.tab.h"
fi
if `test ! -s ./src/gram.y`
then
echo "writting ./src/gram.y"
cat > ./src/gram.y << '\Rogue\Monster\'
%{
/* Grammar for Smalltalk-80
* 3 shift/reduce, 0 reduce/reduce conflicts
*/
#include <stdio.h>
#include "objc.h"
#include "Producer.h"
= CATEGORIES()
USE Block, Expr, List, Array, Type, StArray, Msg, Method, Return,
Selector, Stmt, Identifier, IdentifierTranslation, StringTranslation,
FunctionTranslation, NumberConstant, SelectorConstant, CharConstant,
StringConstant, MsgTranslation, Template, ArgumentList, Class, Comment;
EXPORT BOOL printFlag,
isFactory = NO;
IMPORT id findSymbol();
LOCAL id thisClass = nil;
IMPORT id msgTranslator;
%}
%union TYP { id O; char B; char *S; }
%type <O> LocalVariables VarList PrimMarker Type Method MethodName Keyword
%type <O> KwdMethodDecl StmtList Expr AssignmentList Primary
%type <O> UnaryObjDesc BinaryObjDesc SimpleMsgExpr UnaryExpr BinaryExpr
%type <O> KeywordExpr KeywordArgList CascadedMsgExpr CascadedMsg
%type <O> Literal ArrayMemberList ArrayMember Block BinarySelector
%type <O> VariableName UnarySelector Template BlockVarList KeywordList
%type <O> InferenceRule ObjcFunctionArgList ObjcFunctionPattern BlockVariables
%type <O> ObjcKeywordPattern ObjcMsgPattern OptionalType
%type <O> ParameterDesignator KeywordPattern PatternType TemplateType
%type <O> CharacterConstant NumberConstant StringConstant Keyword
%type <B> SpecialCharacter
%token <S> IDENTIFIER DIGITS KEYWORD STRING CHARCON DOUBLESPECIAL
%token <B> '%' '|' '&' '?' '#' '!' ',' '_'
%token <B> '+' '-' '/' '\\' '*' '~' '<' '>' '=' '@'

%left '_'
%left IDENTIFIER STRING UnarySelector VariableIdentifier
%right KEYWORD BinarySelector
%start ChunkList
%%
ChunkList:
| ChunkList Chunk { USE Comment; [Comment gen]; }
;
Chunk: VariableName KEYWORD '#' VariableName
KEYWORD StringConstant KEYWORD StringConstant
KEYWORD StringConstant KEYWORD StringConstant '!' {
[Comment gen];
if (thisClass) { [thisClass gen]; [thisClass free]; }
thisClass = [Class name:findSymbol($4)];
[thisClass superclass:findSymbol($1)];
[thisClass instanceVariableNames:$6];
[thisClass classVariableNames:$8];
[thisClass poolDictionaries:$10];
[thisClass category:$12];
[thisClass gen];
}
| VariableName KEYWORD STRING '!'
{isFactory=NO;} Methods Sep
| VariableName VariableName KEYWORD STRING '!'
{isFactory=YES;} Methods Sep
| '{' InferenceRule '}'
{ [Comment free]; }
| '{' error '}'
| error '!'
;
Sep: '!'
| Sep '!'
;
Methods:
| Methods Method '!'
{ [Comment gen]; [$2 gen]; [$2 free]; }
| Methods error '!'
{ [Comment gen]; }
;
/* Declare a new method */
Method: MethodName LocalVariables
{ [$$=$1 variables:$2]; }
PrimMarker StmtList
{ [$$ primitive:$4]; [$$ statements:$5]; }
;
MethodName: UnarySelector
{ $$ = [Method selector:$1 asFactory:isFactory]; }
| BinarySelector VariableName
{ $$ = [Method selector:[$1 argument:$2] asFactory:isFactory]; }
| KwdMethodDecl
{ $$ = [Method selector:$1 asFactory:isFactory]; }
;
PrimMarker: { $$ = nil; }
| '<' KEYWORD NumberConstant '>'
{ $$ = [NumberConstant sprintf:"primitive(%s);", [$3 str]]; [$3 free]; }
;
LocalVariables: { $$ = nil; }
| '|' VarList '|'
{ $$ = $2; }
;
VarList: { $$ = nil; }
| VarList VariableName
{ $$ = $1 ? $1 : [List new]; [$$ add:$2]; }
;
KwdMethodDecl: Keyword VariableName
{ [$$=$1 argument:$2]; }
| KwdMethodDecl Keyword VariableName
{ [$$=$1 add:[$2 argument:$3]]; }
;
/* Statements and expressions */
StmtList: '^' Expr
{ $$ = [Return expr:$2]; }
| Expr
{ $$ = [Stmt expr:$1]; }
| Expr '.'
{ $$ = [Stmt expr:$1]; }
| Expr '.' StmtList
{ [$$=[Stmt expr:$1] successor:$3]; }
| error '.'
{ wer("erroneous statement ignored"); $$=nil; }
;
Expr: AssignmentList Primary
{ $$ = [Expr assign:$1 value:$2]; }
| AssignmentList SimpleMsgExpr
{ $$ = [Expr assign:$1 value:$2]; }
| AssignmentList SimpleMsgExpr CascadedMsgExpr
{ [$$ = [Expr assign:$1 value:$2] cascade:$3]; }
;
AssignmentList: { $$ = nil; }
| AssignmentList VariableName '_'
{ $$ = $1 ? $1 : [List new]; [$$ add:findSymbol($2)]; }
;
CascadedMsgExpr: CascadedMsg
{ $$=[Expr assign:nil value:$1]; }
| CascadedMsgExpr CascadedMsg
{ [$$=$1 add:[Expr assign:nil value:$2]]; }
;
CascadedMsg: ';' UnarySelector
{ $$ = [Msg selector:$2]; }
| ';' BinarySelector UnaryObjDesc
{ $$ = [Msg selector:[$2 argument:$3]]; }
| ';' KeywordArgList
{ $$ = [Msg selector:$2]; }
;
Primary: VariableName
{ $$ = findSymbol($1); }
| Literal | Block | '(' Expr ')'
{ $$ = $2; }
;
SimpleMsgExpr: UnaryExpr | BinaryExpr | KeywordExpr ;
UnaryObjDesc: Primary | UnaryExpr ;
UnaryExpr: UnaryObjDesc UnarySelector
{ $$ = [Msg receiver:$1 selector:$2]; } ;
BinaryObjDesc: UnaryObjDesc | BinaryExpr ;
BinaryExpr: BinaryObjDesc BinarySelector UnaryObjDesc
{ $$ = [Msg receiver:$1 selector:[$2 argument:$3]]; } ;
KeywordExpr: BinaryObjDesc KeywordArgList
{ $$ = [Msg receiver:$1 selector:$2]; }
;
KeywordArgList: Keyword BinaryObjDesc
{ [$$=$1 argument:$2]; }
| KeywordArgList Keyword BinaryObjDesc
{ [$$=$1 add:[$2 argument:$3]]; }
;
Literal: CharacterConstant | StringConstant | NumberConstant
| '#' '(' ArrayMemberList ')'
{ $$ = $3; }
| '#' UnarySelector
{ $$=[SelectorConstant name:$2]; [$2 free]; }
| '#' BinarySelector
{ $$=[SelectorConstant name:$2]; [$2 free]; }
| '#' KeywordList
{ $$=[SelectorConstant name:$2]; [$2 free]; }
;
ArrayMemberList: { $$ = nil; }
| ArrayMemberList ArrayMember
{ [$$ = $1 ? $1 : [StArray new] add:$2]; }
;
ArrayMember: CharacterConstant | StringConstant | NumberConstant
| UnarySelector | BinarySelector | KeywordList
| '(' ArrayMemberList ')'
{ $$ = $2; }
;
Block: '[' BlockVariables StmtList ']'
{ $$ = [$2 statements:$3]; }
| '[' BlockVariables ']'
{ $$ = $2; }
;
BlockVariables:
{ $$ = [Block new]; }
| BlockVarList '|'
{ $$ = [[Block new] variables:$1]; }
;
BlockVarList: ':' VariableName
{ [$$ = [List new] add:$2]; }
| BlockVarList ':' VariableName
{ [$$=$1 add:$3]; }
;
/* Type inferencing rules */
InferenceRule: '#' PatternType '[' ObjcMsgPattern ']'
{ [msgTranslator install:[Template receiverType:[$4 receiverType]
selector:[$4 selector]] translation:[$4 type:$2]]; }
| Template '#' PatternType '[' ObjcMsgPattern ']'
{ [msgTranslator install:$1 translation:[$5 type:$3]]; }
| Template '#' PatternType ObjcFunctionPattern
{ [msgTranslator install:$1 translation:[$4 type:$3]]; }
| Template '#' PatternType StringConstant
{ [msgTranslator install:$1
translation:[StringTranslation type:$3 translation:$4]]; }
| '#' VariableName PatternType VariableName
{ [IdentifierTranslation sourceName:$2 targetType:$3 targetName:$4]; }
;
Template: TemplateType UnarySelector
{ $$ = [Template receiverType:$1 selector:$2]; }
| TemplateType BinarySelector TemplateType
{ $$ = [Template receiverType:$1 selector:[$2 type:$3]]; }
| TemplateType KeywordPattern
{ $$ = [Template receiverType:$1 selector:$2]; }
;
KeywordPattern: Keyword PatternType
{ [$$=$1 type:$2]; }
| KeywordPattern Keyword PatternType
{ [$$=$1 add:$2]; [$2 type:$3]; }
;
ObjcFunctionPattern: VariableName '(' ObjcFunctionArgList ')'
{ $$ = [FunctionTranslation name:$1 args:$3]; }
| VariableName '(' ')'
{ $$ = [FunctionTranslation name:$1 args:0]; }
;
ObjcFunctionArgList: PatternType ParameterDesignator
{ $$ = [ArgumentList type:$1 name:$2]; }
| ObjcFunctionArgList ',' PatternType ParameterDesignator
{ [$$=$1 add:[ArgumentList type:$3 name:$4]]; }
;
ObjcMsgPattern: PatternType UnarySelector
{ $$ = [MsgTranslation receiverType:$1 selector:$2]; }
| PatternType ObjcKeywordPattern
{ $$ = [MsgTranslation receiverType:$1 selector:$2]; }
;
ObjcKeywordPattern: Keyword PatternType ParameterDesignator
{ [$1 type:$2]; [$$=$1 argument:$3]; }
| ObjcKeywordPattern Keyword PatternType ParameterDesignator
{ [$$=$1 add:$2]; [$2 type:$3]; [$2 argument:$3]; }
;
ParameterDesignator: VariableName
| '%' DIGITS { $$=[NumberConstant sprintf:"%%%s", $2]; }
;
/* Token Packaging */
KeywordList: KEYWORD { $$ = [Selector str:$1]; }
| KeywordList KEYWORD { $$ = [$1 concatenateSTRAndFreeReceiver:$2]; }
;
BinarySelector: '-' { $$ = [Selector str:"-"]; }
| SpecialCharacter
{ char b[2]; b[0]=$1; b[1]=0; $$ = [Selector str:b]; }
| DOUBLESPECIAL { $$ = [Selector str:$1]; }
;
SpecialCharacter: '+' | '/' | '\\' | '*' | '~' | '<'
| '>' | '=' | '@' | '%' | '&' | '?' | ',' | '|'
;
PatternType: OptionalType { $$ = $1 ? $1 : types.ID; };
TemplateType: OptionalType { $$ = $1 ? $1 : types.ANY; };
OptionalType: { $$ = 0; } | '(' Type ')' { $$ = $2; };
Type: IDENTIFIER { $$=[Type str:$1]; };
VariableName: IDENTIFIER { $$=[Identifier str:$1]; };
UnarySelector: IDENTIFIER { $$ = [Selector str:$1]; };
CharacterConstant: CHARCON { $$ = [CharConstant str:$1]; };
NumberConstant: DIGITS { $$ = [NumberConstant str:$1]; }
| '-' DIGITS %prec KEYWORD { $$ = [NumberConstant sprintf:"-%s", $2]; }
;
StringConstant: STRING { $$ = [StringConstant str:$1]; };
Keyword: KEYWORD { $$ = [Selector str:$1]; };
%%

\Rogue\Monster\
else
echo "will not over write ./src/gram.y"
fi
if `test ! -s ./src/lex.l`
then
echo "writting ./src/lex.l"
cat > ./src/lex.l << '\Rogue\Monster\'
%{
#include "Producer.h"
#include "y.tab.h"
USE Comment;
LOCAL STR collect();
EXPORT BOOL lexFlag = NO;
IMPORT BOOL stripCommentsFlag;
#ifndef OBJC_COX
= CATEGORIES()
#endif
/* Intrudes between lexer and parser for token-level debugging */
EXPORT int yylex() { STR typeStr, tokenValue; LOCAL char b[2]={0};
int type = rawlexer();
switch(type) {
case DIGITS: typeStr="DIGITS"; tokenValue = yylval.S; break;
case KEYWORD: typeStr="KEYWORD"; tokenValue = yylval.S; break;
case IDENTIFIER: typeStr="IDENTIFIER"; tokenValue = yylval.S; break;
case STRING: typeStr="STRING"; tokenValue = yylval.S; break;
case CHARCON: typeStr="CHARCON"; tokenValue = yylval.S; break;
default: b[0] = yylval.B; typeStr = tokenValue = b; break;
}
stockToken(tokenValue);
if (lexFlag) printf("::%3d=%10s: %s\n", type, typeStr, tokenValue);
return type;
}
LOCAL STR bitsToHex(s) STR s; { LOCAL char buf[80];
LOCAL char charToHex[]="0123456789abcdef";
unsigned short out = 0; STR p; int shiftBy;
p = buf; *p++ = '0'; *p++ = 'x';
for (shiftBy = 3; *s; shiftBy--,s++) {
out |= (unsigned)(*s != '0') << shiftBy;
if (shiftBy == 0) {
*p++ = charToHex[out];
out = 0;
shiftBy = 3;
}
}
*p = 0; return buf;
}
GETC(iod) IOD iod; { LOCAL char buf[BUFSIZ] = {0}; LOCAL STR p = buf;
if (*p == 0) { p = buf; *p = 0;
if (fgets(buf, sizeof(buf), iod) == NULL) {
STR q = &buf[strlen(buf)];
*q++ = EOF; *q = 0;
}
if (!stripCommentsFlag) [Comment str:buf];
}
return *p++;
}
# undef input
# define input() (((yytchar=yysptr>yysbuf?U(*--yysptr):GETC(yyin))==10?\
(yylineno++,yytchar):yytchar)==EOF?0:yytchar)
# define yylex rawlexer
%}
%%
[ \t\n\f\r]+ { ; }
"\"" { yylval.S = collect(yyleng); }
"'" { yylval.S = collect(yyleng); return STRING; }
[A-Za-z][A-Za-z0-9]* { yylval.S = yytext; return IDENTIFIER; }
[A-Za-z][A-Za-z0-9]*: { yylval.S = yytext; return KEYWORD; }
[+/\\*~<>=@%|&?][+/\\*~<>=@%|&?] { yylval.S = yytext; return DOUBLESPECIAL; }
[0-9]+ |
[0-9]*\.[0-9]+ { yylval.S = yytext; return DIGITS; }
2r[0-1]+ { yylval.S = bitsToHex(&yytext[2]); return DIGITS; }
\$. { yylval.S = &yytext[1]; return CHARCON; }
\$!! { yylval.S = "!"; return CHARCON; }
. { return yylval.B = *yytext; }
%%
/* Collect a "String" 'CharacterConstant', #command or comment
* The item to be collected is identified (in `what') from the
* first character in yytext.
*
* To save copying time, we collect as much as will fit directly in yytext[].
* An instance of String is then created to hold any overflows. The str
* returned from here will locate the result, whether held
* in yytext or aString.
*/
LOCAL STR collect(len)
register short len;
{
USE ByteArray; register short c;
LOCAL id overflow = 0; char what = *yytext;
if (overflow) overflow = [overflow free]; /* from last time around */
for(;;) {
if (len >= YYLMAX - 1) {
yytext[len] = 0; len = 0;
if (overflow) overflow = [overflow concatenateSTR:yytext];
else overflow = [ByteArray str:yytext];
}
switch(yytext[len++] = c = input()) {
case '\'': if (what == '\'') {
if ((c = input()) == '\'') { yytext[len++] = c; continue; }
else { unput(c); break; }
} else continue;
case '"': if (what == '"') break; else continue;
case '*': if (what != '/') continue;
if ((c = input()) == '/') { yytext[len++] = c; break; }
unput(c); continue;
case '\\': yytext[len++] = input(); continue;
case '\n': continue;
case 0: wer("Unterminated string or charconst"); break;
default: continue;
}
yytext[len] = 0;
return overflow
? [(overflow = [overflow concatenateSTR:yytext]) str]
: yytext;
}
}
\Rogue\Monster\
else
echo "will not over write ./src/lex.l"
fi
if `test ! -s ./src/Makefile`
then
echo "writting ./src/Makefile"
cat > ./src/Makefile << '\Rogue\Monster\'
# Producer: The Smalltalk to ObjectiveC Translator
OCOBJ= Node.o List.o Block.o Comment.o \
ByteArray.o \
Symbol.o \
Constant.o \
Type.o \
CharConstant.o \
NumberConstant.o \
SelectorConstant.o \
StringConstant.o \
Expr.o StArray.o Class.o \
Msg.o Method.o Stmt.o Return.o \
MsgArgPattern.o \
MsgNamePattern.o \
MsgTranslator.o \
Template.o \
Selector.o \
ArgumentList.o \
Identifier.o \
IdentifierTranslation.o \
AbstractTranslation.o \
FunctionTranslation.o \
MsgTranslation.o \
StringTranslation.o \
Scope.o
YACCOBJ=gram.o
LEXOBJ=lex.o
CCOBJ=gen.o main.o
OBJ=$(OCOBJ) $(YACCOBJ) $(LEXOBJ) $(CCOBJ)
LIBS=/u/ui/sb/Substrate.a
OBJC=objcc -q -g
MISC=main.m gram.y lex.l gen.m Producer.h
SRC=README Makefile $(MISC) `_suffix .m $(OCOBJ) $(CCOBJ) | tr ' ' '\012' | sort`

.SUFFIXES:
.SUFFIXES: .y .l .m .o .c .me .i .f
all: METHODDECLS.o producer
producer: $(OBJ); $(OBJC) $(OBJ) && mv a.out producer
clean: ; rm -f *.o *.c [cpCP]_* log core gram.m lex.m
.y.o: ; yacc -dv $< && mv y.tab.c $*.m && $(OBJC) -c $*.m
.l.o: ; lex $< && mv lex.yy.c $*.m && $(OBJC) -c $*.m
.m.o: ; $(OBJC) -c -nRetain $<
.m.c: ; $(OBJC) -c $<
.me.i: ; me -i -t /u/cox/src/mac.me $<
.me.f: ; me -t /u/cox/src/mac.me $< >$$$$.f && mv $$$$.f $*.f
v.m: v.st ; -producer RULES/* v.st >v.m
v.o: v.m ; objc v.m -c -Retain -g -q -I../wg -I../ui $C
test: ; rm -f v.m; make v.o
wc: ; wc $(SRC)
\Rogue\Monster\
else
echo "will not over write ./src/Makefile"
fi
if `test ! -s ./src/design.me`
then
echo "writting ./src/design.me"
cat > ./src/design.me << '\Rogue\Monster\'
Smalltalk Syntax consists of
identifiers
literal constants
message expressions
Return type
Argument types

Literal constant typing is explicit from context
Integer
Floating Point
String
Character

Identifier type inferencing
Identifier name transformation: How to specify scope of change?
The type of each identifier is the type of the first assignment.
Instance variables: generate declaration at tail of file after
assignments have provided a type for each?
Inherited variables: do these appear in methods of Smalltalk
subclasses?

Message expression type inferencing
(int) do:(TYPE) this:(TYPE) to:(TYPE) that:(TYPE)
Return type and argument types are taken from category files
after performing any message name transforms

Method type inferencing
When Objective-C method exists by the same name, use types from
that
Otherwise the type is determined after inferencing variable types.

Static polymorphism
When translation of messages should depend on the (static) type of
the receiver; e.g.
(10@20) extent:(30@40) -> [Rectangle origin:pt(10,20) extent:(30@40)]
aRectangle extent:(30@40) -> [Rectangle extent:pt(30@40)]
or
aPoint x -> X(aPoint)
aRectangle origin -> aRectangle->origin
aRectangle left -> L(aRectangle)
or better yet
2 + 3 -> 2+3
2.3 + 4.8 -> 2.3 + 4.8
aPoint + anotherPoint -> ptPlus(aPoint, anotherPoint)
aPoint + 3 -> ptPlusInt(aPoint, 3)

Notation:
ReceiverType MessageExpression -> ReturnType FormatString
\________Source_____________/ \______Target_________/
Default:
ReceiverType: matches id
ReturnType: id
FormatString: message expression

Examples:
(int)+(int) -> $1 + $2
(float)+(float) -> $1 + $2
(PT)+(PT) -> ptPlus($1, $2)
(PT)+(int) -> ptPlusInt($1, $2)
\Rogue\Monster\
else
echo "will not over write ./src/design.me"
fi
if `test ! -s ./src/Symbol.m`
then
echo "writting ./src/Symbol.m"
cat > ./src/Symbol.m << '\Rogue\Monster\'
/*{ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Symbol
My instances in only a single copy, allowing them to be tested for
equality via == instead of isEqual:

bjc: A prototype; not tested under load. The hash and isEqual: methods
have broken since I was here last (library incompatibilities?)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ }*/
#include "Producer.h"
USE Set;
= Symbol:ByteArray CATEGORIES() { }
LOCAL id symbolTable;

+ initialize
{ if (!symbolTable) symbolTable = [Set new]; }
+ symbolTable
{ return symbolTable; }
+ str:(STR)aStr
{ return [symbolTable filter:[super str:aStr]]; }
+ name:aByteArray
{ return [self str:[aByteArray str]]; }
- free
{ return nil; }
- str:(STR)aStr
{ return [self cannotModifyError]; }
- (char)charAt:(unsigned)anOffset put:(char)aChar
{ return (char)[self cannotModifyError]; }
- sort
{ return [self cannotModifyError]; }
- concat:aStr
{ return [self cannotModifyError]; }
- concatSTR:(STR)aCString
{ return [self cannotModifyError]; }
- concatenateAndFreeReceiver:aByteArray
{ return [self cannotModifyError]; }
- concatenateSTRAndFreeReceiver:(STR)aString
{ return [self cannotModifyError]; }
- concatenateSTR:(STR)aString
{ return [self cannotModifyError]; }
- concatenate:aByteArray
{ return [self cannotModifyError]; }
- cannotModifyError
{ return [self error:"the bytes in a %s are invarient", [self name]]; }
#ifdef NOTWORKING
- (unsigned)hash
{ return (unsigned)self; }
- (BOOL)isEqual:anObject
{ return self == anObject; }
#endif
=:

\Rogue\Monster\
else
echo "will not over write ./src/Symbol.m"
fi
if `test ! -s ./src/ByteArray.m`
then
echo "writting ./src/ByteArray.m"
cat > ./src/ByteArray.m << '\Rogue\Monster\'
/*{ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ByteArray.m
Do not be misled by the superficial resemblance between this class
and the BytArray class in functionality, method names, implementation,
and usage. They are totally different.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ }*/
#include <stdio.h> /* @retain */
#include "Producer.h"
#include "vectors.h" /* @retain */
#define badIndex(offset) ((unsigned)(offset) >= (unsigned)capacity)
#define goodIndex(offset) (!badIndex(offset))
LOCAL char typeStr[]="\"";
IMPORT int strlen(), atoi();
IMPORT long atol();
IMPORT double atof();
IMPORT STR strcpy(), strcat();
IMPORT unsigned _strhash();

= ByteArray:Array CATEGORIES() { }

// Indexed variable typing
+ (unsigned)ndxVarSize { return sizeof(char); }
+ (STR)ndxVarType { return typeStr; }
- (STR)describe { return typeStr; }

// Instance creation: Note that capacity records the capacity actually
// available for characters. This is one more than the number requested
// to guarantee that a null terminator will exist.
+ new { return [self new:0]; }
+ new:(unsigned)nExtra { self = (*_alloc)(self, nExtra+1);
capacity = nExtra + 1; return self;
}
+ str:(STR)aStr { unsigned n; if (aStr == 0) aStr = "";
n = strlen(aStr); self = (*_alloc)(self, n+1);
strcpy(IV(self), aStr); capacity = n+1; return self;
}
#define VA_TYPE int
+ sprintf:(STR)fmt; VA_TYPE va_alist; { char buf[BUFSIZ];
#ifdef BOOTSTRAP /* @retain */
typedef int FILE;
#endif
#include "varargs.h" /* @retain */
#ifdef BOOTSTRAP /* @retain */
typedef char *va_list;
#endif
#ifdef _IOSTRG /* @retain */
{
va_list ap;
FILE iod;
iod._cnt = sizeof(buf); iod._base = iod._ptr = buf;
iod._flag = _IOWRT+_IOSTRG; va_start(ap);
_prn(fmt, ap, &iod); va_end(ap);
*iod._ptr = '\0';
}
#else
# define INT int
{
va_list ap;
int ilist[10]; register int *ip = ilist, i;
va_start (ap);
for (i = 0; i < 10; i++)
*ip++ = va_arg(ap, INT);
va_end (ap);
ip = ilist;
sprintf (buf, fmt, ip[0], ip[1], ip[2], ip[3], ip[4], ip[5],
ip[6], ip[7], ip[8], ip[9]);
}
#endif
return [self str:buf];
}
// Convert to indicated type
- (int)asInt { return atoi(IV(self)); }
- (long)asLong { return atol(IV(self)); }
- (double)asFloat { return atof(IV(self)); }

// Accessing
- (STR)str { return IV(self); }
- str:(STR)aStr { strncpy(IV(self), aStr, capacity-1);
IV(self)[capacity-1] = '\0'; return self; }
- (char)charAt:(unsigned)anOffset { return goodIndex(anOffset) ?
IV(self)[anOffset] : (char)[self boundsViolation:anOffset];
}
- (char)charAt:(unsigned)anOffset put:(char)aChar { STR p = IV(self)+anOffset;
if goodIndex(anOffset) { char tmp= *p; *p=aChar; return tmp; }
else return (char)[self boundsViolation:anOffset];
}
LOCAL int cmp(a, b) char *a, *b; { return *a-*b; }
- sort { qsort(IV(self), capacity-1, sizeof(char), cmp); return self; }

#ifdef OBSOLETE
// Concatenate aStr to self. Reply 0 if truncation occurred.
- concat:aStr { return [self concatSTR:[aStr str]]; }
- concatSTR:(STR)aCString { unsigned me, l; if (aCString == 0) return 0;
me = strlen(IV(self)); l = capacity-1;
if (l > me) strncpy(IV(self)+me, aCString, l-me);
IV(self)[capacity-1] = '\0';
return (l > me + strlen(aCString)) ? self : nil;
}
#endif
- concatenateAndFreeReceiver:aByteArray
{ return [self concatenateSTRAndFreeReceiver:[aByteArray str]]; }
- concatenateSTRAndFreeReceiver:(STR)aString
{ id tmp = [self concatenate:aString]; [self free]; return tmp; }
- concatenateSTR:(STR)aString
{ return [isa sprintf:"%s%s", [self str], aString]; }
- concatenate:aByteArray
{ return [self concatenateSTR:[aByteArray str]]; }

// Comparing and hashing: hash must correlate with isEqual:
LOCAL int arycmp(obj, str) id obj; register STR str; {
register unsigned siz = obj->capacity; register STR p = IV(obj);
for (; siz--; p++, str++) if (*p != *str) return *p - *str;
return 0;
}
- (int)compare:aStr { return aStr ? arycmp(self, [aStr str]) : NO; }
- (int)compareSTR:(STR)aStr { return aStr ? arycmp(self, aStr) : NO; }
- (BOOL)isEqual:aStr { return aStr ? arycmp(self, [aStr str]) == 0 : NO; }
- (BOOL)isEqualSTR:(STR)aStr { return aStr ? arycmp(self, aStr) == 0 : NO; }
- (BOOL)isCopyOf:anObject {
return [super isCopyOf:anObject]
&& (arycmp(self, IV(anObject)) == 0);
}
- (unsigned)hash
{ return _strhash(IV(self)); }
=:
\Rogue\Monster\
else
echo "will not over write ./src/ByteArray.m"
fi
if `test ! -s ./src/y.output`
then
echo "writting ./src/y.output"
cat > ./src/y.output << '\Rogue\Monster\'

state 0
$accept : _ChunkList $end
ChunkList : _ (1)

. reduce 1

ChunkList goto 1

state 1
$accept : ChunkList_$end
ChunkList : ChunkList_Chunk

$end accept
error shift 5
IDENTIFIER shift 6
{ shift 4
. error

VariableName goto 3
Chunk goto 2

state 2
ChunkList : ChunkList Chunk_ (2)

. reduce 2


state 3
Chunk : VariableName_KEYWORD # VariableName KEYWORD StringConstant KEYWORD StringConstant KEYWORD StringConstant KEYWORD StringConstant !
Chunk : VariableName_KEYWORD STRING ! $$4 Methods Sep
Chunk : VariableName_VariableName KEYWORD STRING ! $$6 Methods Sep

IDENTIFIER shift 6
KEYWORD shift 7
. error

VariableName goto 8

state 4
Chunk : {_InferenceRule }
Chunk : {_error }
OptionalType : _ (123)

error shift 10
# shift 11
( shift 15
. reduce 123

Template goto 12
InferenceRule goto 9
OptionalType goto 14
TemplateType goto 13

state 5
Chunk : error_!

! shift 16
. error


state 6
VariableName : IDENTIFIER_ (126)

. reduce 126


state 7
Chunk : VariableName KEYWORD_# VariableName KEYWORD StringConstant KEYWORD StringConstant KEYWORD StringConstant KEYWORD StringConstant !
Chunk : VariableName KEYWORD_STRING ! $$4 Methods Sep

STRING shift 18
# shift 17
. error


state 8
Chunk : VariableName VariableName_KEYWORD STRING ! $$6 Methods Sep

KEYWORD shift 19
. error


state 9
Chunk : { InferenceRule_}

} shift 20
. error


state 10
Chunk : { error_}

} shift 21
. error


state 11
InferenceRule : #_PatternType [ ObjcMsgPattern ]
InferenceRule : #_VariableName PatternType VariableName
OptionalType : _ (123)

IDENTIFIER shift 6
( shift 15
. reduce 123

VariableName goto 23
OptionalType goto 24
PatternType goto 22

state 12
InferenceRule : Template_# PatternType [ ObjcMsgPattern ]
InferenceRule : Template_# PatternType ObjcFunctionPattern
InferenceRule : Template_# PatternType StringConstant

# shift 25
. error


state 13
Template : TemplateType_UnarySelector
Template : TemplateType_BinarySelector TemplateType
Template : TemplateType_KeywordPattern

IDENTIFIER shift 29
KEYWORD shift 48
DOUBLESPECIAL shift 32
% shift 43
| shift 47
& shift 44
? shift 45
, shift 46
+ shift 34
- shift 30
/ shift 35
\\ shift 36
* shift 37
~ shift 38
< shift 39
> shift 40
= shift 41
@ shift 42
. error

Keyword goto 33
BinarySelector goto 27
UnarySelector goto 26
KeywordPattern goto 28
SpecialCharacter goto 31

state 14
TemplateType : OptionalType_ (122)

. reduce 122


state 15
OptionalType : (_Type )

IDENTIFIER shift 50
. error

Type goto 49

state 16
Chunk : error !_ (10)

. reduce 10


state 17
Chunk : VariableName KEYWORD #_VariableName KEYWORD StringConstant KEYWORD StringConstant KEYWORD StringConstant KEYWORD StringConstant !

IDENTIFIER shift 6
. error

VariableName goto 51

state 18
Chunk : VariableName KEYWORD STRING_! $$4 Methods Sep

! shift 52
. error


state 19
Chunk : VariableName VariableName KEYWORD_STRING ! $$6 Methods Sep

STRING shift 53
. error


state 20
Chunk : { InferenceRule }_ (8)

. reduce 8


state 21
Chunk : { error }_ (9)

. reduce 9


state 22
InferenceRule : # PatternType_[ ObjcMsgPattern ]

[ shift 54
. error


state 23
InferenceRule : # VariableName_PatternType VariableName
OptionalType : _ (123)

( shift 15
. reduce 123

OptionalType goto 24
PatternType goto 55

state 24
PatternType : OptionalType_ (121)

. reduce 121


state 25
InferenceRule : Template #_PatternType [ ObjcMsgPattern ]
InferenceRule : Template #_PatternType ObjcFunctionPattern
InferenceRule : Template #_PatternType StringConstant
OptionalType : _ (123)

( shift 15
. reduce 123

OptionalType goto 24
PatternType goto 56

state 26
Template : TemplateType UnarySelector_ (87)

. reduce 87


state 27
Template : TemplateType BinarySelector_TemplateType
OptionalType : _ (123)

( shift 15
. reduce 123

OptionalType goto 14
TemplateType goto 57

state 28
Template : TemplateType KeywordPattern_ (89)
KeywordPattern : KeywordPattern_Keyword PatternType

KEYWORD shift 48
. reduce 89

Keyword goto 58

state 29
UnarySelector : IDENTIFIER_ (127)

. reduce 127


state 30
BinarySelector : -_ (104)

. reduce 104


state 31
BinarySelector : SpecialCharacter_ (105)

. reduce 105


state 32
BinarySelector : DOUBLESPECIAL_ (106)

. reduce 106


state 33
KeywordPattern : Keyword_PatternType
OptionalType : _ (123)

( shift 15
. reduce 123

OptionalType goto 24
PatternType goto 59

state 34
SpecialCharacter : +_ (107)

. reduce 107


state 35
SpecialCharacter : /_ (108)

. reduce 108


state 36
SpecialCharacter : \\_ (109)

. reduce 109


state 37
SpecialCharacter : *_ (110)

. reduce 110


state 38
SpecialCharacter : ~_ (111)

. reduce 111


state 39
SpecialCharacter : <_ (112)

. reduce 112


state 40
SpecialCharacter : >_ (113)

. reduce 113


state 41
SpecialCharacter : =_ (114)

. reduce 114


state 42
SpecialCharacter : @_ (115)

. reduce 115


state 43
SpecialCharacter : %_ (116)

. reduce 116


state 44
SpecialCharacter : &_ (117)

. reduce 117


state 45
SpecialCharacter : ?_ (118)

. reduce 118


state 46
SpecialCharacter : ,_ (119)

. reduce 119


state 47
SpecialCharacter : |_ (120)

. reduce 120


state 48
Keyword : KEYWORD_ (132)

. reduce 132


state 49
OptionalType : ( Type_)

) shift 60
. error


state 50
Type : IDENTIFIER_ (125)

. reduce 125


state 51
Chunk : VariableName KEYWORD # VariableName_KEYWORD StringConstant KEYWORD StringConstant KEYWORD StringConstant KEYWORD StringConstant !

KEYWORD shift 61
. error


state 52
Chunk : VariableName KEYWORD STRING !_$$4 Methods Sep
$$4 : _ (4)

. reduce 4

$$4 goto 62

state 53
Chunk : VariableName VariableName KEYWORD STRING_! $$6 Methods Sep

! shift 63
. error


state 54
InferenceRule : # PatternType [_ObjcMsgPattern ]
OptionalType : _ (123)

( shift 15
. reduce 123

ObjcMsgPattern goto 64
OptionalType goto 24
PatternType goto 65

state 55
InferenceRule : # VariableName PatternType_VariableName

IDENTIFIER shift 6
. error

VariableName goto 66

state 56
InferenceRule : Template # PatternType_[ ObjcMsgPattern ]
InferenceRule : Template # PatternType_ObjcFunctionPattern
InferenceRule : Template # PatternType_StringConstant

IDENTIFIER shift 6
STRING shift 71
[ shift 67
. error

VariableName goto 70
ObjcFunctionPattern goto 68
StringConstant goto 69

state 57
Template : TemplateType BinarySelector TemplateType_ (88)

. reduce 88


state 58
KeywordPattern : KeywordPattern Keyword_PatternType
OptionalType : _ (123)

( shift 15
. reduce 123

OptionalType goto 24
PatternType goto 72

state 59
KeywordPattern : Keyword PatternType_ (90)

. reduce 90


state 60
OptionalType : ( Type )_ (124)

. reduce 124


state 61
Chunk : VariableName KEYWORD # VariableName KEYWORD_StringConstant KEYWORD StringConstant KEYWORD StringConstant KEYWORD StringConstant !

STRING shift 71
. error

StringConstant goto 73

state 62
Chunk : VariableName KEYWORD STRING ! $$4_Methods Sep
Methods : _ (13)

. reduce 13

Methods goto 74

state 63
Chunk : VariableName VariableName KEYWORD STRING !_$$6 Methods Sep
$$6 : _ (6)

. reduce 6

$$6 goto 75

state 64
InferenceRule : # PatternType [ ObjcMsgPattern_]

] shift 76
. error


state 65
ObjcMsgPattern : PatternType_UnarySelector
ObjcMsgPattern : PatternType_ObjcKeywordPattern

IDENTIFIER shift 29
KEYWORD shift 48
. error

Keyword goto 79
UnarySelector goto 77
ObjcKeywordPattern goto 78

state 66
InferenceRule : # VariableName PatternType VariableName_ (86)

. reduce 86


state 67
InferenceRule : Template # PatternType [_ObjcMsgPattern ]
OptionalType : _ (123)

( shift 15
. reduce 123

ObjcMsgPattern goto 80
OptionalType goto 24
PatternType goto 65

state 68
InferenceRule : Template # PatternType ObjcFunctionPattern_ (84)

. reduce 84


state 69
InferenceRule : Template # PatternType StringConstant_ (85)

. reduce 85


state 70
ObjcFunctionPattern : VariableName_( ObjcFunctionArgList )
ObjcFunctionPattern : VariableName_( )

( shift 81
. error


state 71
StringConstant : STRING_ (131)

. reduce 131


state 72
KeywordPattern : KeywordPattern Keyword PatternType_ (91)

. reduce 91


state 73
Chunk : VariableName KEYWORD # VariableName KEYWORD StringConstant_KEYWORD StringConstant KEYWORD StringConstant KEYWORD StringConstant !

KEYWORD shift 82
. error


state 74
Chunk : VariableName KEYWORD STRING ! $$4 Methods_Sep
Methods : Methods_Method !
Methods : Methods_error !

error shift 85
IDENTIFIER shift 29
KEYWORD shift 48
DOUBLESPECIAL shift 32
% shift 43
| shift 47
& shift 44
? shift 45
! shift 86
, shift 46
+ shift 34
- shift 30
/ shift 35
\\ shift 36
* shift 37
~ shift 38
< shift 39
> shift 40
= shift 41
@ shift 42
. error

Method goto 84
MethodName goto 87
Keyword goto 91
KwdMethodDecl goto 90
BinarySelector goto 89
UnarySelector goto 88
SpecialCharacter goto 31
Sep goto 83

state 75
Chunk : VariableName VariableName KEYWORD STRING ! $$6_Methods Sep
Methods : _ (13)

. reduce 13

Methods goto 92

state 76
InferenceRule : # PatternType [ ObjcMsgPattern ]_ (82)

. reduce 82


state 77
ObjcMsgPattern : PatternType UnarySelector_ (96)

. reduce 96


state 78
ObjcMsgPattern : PatternType ObjcKeywordPattern_ (97)
ObjcKeywordPattern : ObjcKeywordPattern_Keyword PatternType ParameterDesignator

KEYWORD shift 48
. reduce 97

Keyword goto 93

state 79
ObjcKeywordPattern : Keyword_PatternType ParameterDesignator
OptionalType : _ (123)

( shift 15
. reduce 123

OptionalType goto 24
PatternType goto 94

state 80
InferenceRule : Template # PatternType [ ObjcMsgPattern_]

] shift 95
. error


state 81
ObjcFunctionPattern : VariableName (_ObjcFunctionArgList )
ObjcFunctionPattern : VariableName (_)
OptionalType : _ (123)

( shift 15
) shift 97
. reduce 123

ObjcFunctionArgList goto 96
OptionalType goto 24
PatternType goto 98

state 82
Chunk : VariableName KEYWORD # VariableName KEYWORD StringConstant KEYWORD_StringConstant KEYWORD StringConstant KEYWORD StringConstant !

STRING shift 71
. error

StringConstant goto 99

state 83
Chunk : VariableName KEYWORD STRING ! $$4 Methods Sep_ (5)
Sep : Sep_!

! shift 100
. reduce 5


state 84
Methods : Methods Method_!

! shift 101
. error


state 85
Methods : Methods error_!

! shift 102
. error


state 86
Sep : !_ (11)

. reduce 11


state 87
Method : MethodName_LocalVariables $$16 PrimMarker StmtList
LocalVariables : _ (23)

| shift 104
. reduce 23

LocalVariables goto 103

state 88
MethodName : UnarySelector_ (18)

. reduce 18


state 89
MethodName : BinarySelector_VariableName

IDENTIFIER shift 6
. error

VariableName goto 105

state 90
MethodName : KwdMethodDecl_ (20)
KwdMethodDecl : KwdMethodDecl_Keyword VariableName

KEYWORD shift 48
. reduce 20

Keyword goto 106

state 91
KwdMethodDecl : Keyword_VariableName

IDENTIFIER shift 6
. error

VariableName goto 107

state 92
Chunk : VariableName VariableName KEYWORD STRING ! $$6 Methods_Sep
Methods : Methods_Method !
Methods : Methods_error !

error shift 85
IDENTIFIER shift 29
KEYWORD shift 48
DOUBLESPECIAL shift 32
% shift 43
| shift 47
& shift 44
? shift 45
! shift 86
, shift 46
+ shift 34
- shift 30
/ shift 35
\\ shift 36
* shift 37
~ shift 38
< shift 39
> shift 40
= shift 41
@ shift 42
. error

Method goto 84
MethodName goto 87
Keyword goto 91
KwdMethodDecl goto 90
BinarySelector goto 89
UnarySelector goto 88
SpecialCharacter goto 31
Sep goto 108

state 93
ObjcKeywordPattern : ObjcKeywordPattern Keyword_PatternType ParameterDesignator
OptionalType : _ (123)

( shift 15
. reduce 123

OptionalType goto 24
PatternType goto 109

state 94
ObjcKeywordPattern : Keyword PatternType_ParameterDesignator

IDENTIFIER shift 6
% shift 112
. error

VariableName goto 111
ParameterDesignator goto 110

state 95
InferenceRule : Template # PatternType [ ObjcMsgPattern ]_ (83)

. reduce 83


state 96
ObjcFunctionPattern : VariableName ( ObjcFunctionArgList_)
ObjcFunctionArgList : ObjcFunctionArgList_, PatternType ParameterDesignator

, shift 114
) shift 113
. error


state 97
ObjcFunctionPattern : VariableName ( )_ (93)

. reduce 93


state 98
ObjcFunctionArgList : PatternType_ParameterDesignator

IDENTIFIER shift 6
% shift 112
. error

VariableName goto 111
ParameterDesignator goto 115

state 99
Chunk : VariableName KEYWORD # VariableName KEYWORD StringConstant KEYWORD StringConstant_KEYWORD StringConstant KEYWORD StringConstant !

KEYWORD shift 116
. error


state 100
Sep : Sep !_ (12)

. reduce 12


state 101
Methods : Methods Method !_ (14)

. reduce 14


state 102
Methods : Methods error !_ (15)

. reduce 15


state 103
Method : MethodName LocalVariables_$$16 PrimMarker StmtList
$$16 : _ (16)

. reduce 16

$$16 goto 117

state 104
LocalVariables : |_VarList |
VarList : _ (25)

. reduce 25

VarList goto 118

state 105
MethodName : BinarySelector VariableName_ (19)

. reduce 19


state 106
KwdMethodDecl : KwdMethodDecl Keyword_VariableName

IDENTIFIER shift 6
. error

VariableName goto 119

state 107
KwdMethodDecl : Keyword VariableName_ (27)

. reduce 27


state 108
Chunk : VariableName VariableName KEYWORD STRING ! $$6 Methods Sep_ (7)
Sep : Sep_!

! shift 100
. reduce 7


state 109
ObjcKeywordPattern : ObjcKeywordPattern Keyword PatternType_ParameterDesignator

IDENTIFIER shift 6
% shift 112
. error

VariableName goto 111
ParameterDesignator goto 120

state 110
ObjcKeywordPattern : Keyword PatternType ParameterDesignator_ (98)

. reduce 98


state 111
ParameterDesignator : VariableName_ (100)

. reduce 100


state 112
ParameterDesignator : %_DIGITS

DIGITS shift 121
. error


state 113
ObjcFunctionPattern : VariableName ( ObjcFunctionArgList )_ (92)

. reduce 92


state 114
ObjcFunctionArgList : ObjcFunctionArgList ,_PatternType ParameterDesignator
OptionalType : _ (123)

( shift 15
. reduce 123

OptionalType goto 24
PatternType goto 122

state 115
ObjcFunctionArgList : PatternType ParameterDesignator_ (94)

. reduce 94


state 116
Chunk : VariableName KEYWORD # VariableName KEYWORD StringConstant KEYWORD StringConstant KEYWORD_StringConstant KEYWORD StringConstant !

STRING shift 71
. error

StringConstant goto 123

state 117
Method : MethodName LocalVariables $$16_PrimMarker StmtList
PrimMarker : _ (21)

< shift 125
. reduce 21

PrimMarker goto 124

state 118
LocalVariables : | VarList_|
VarList : VarList_VariableName

IDENTIFIER shift 6
| shift 126
. error

VariableName goto 127

state 119
KwdMethodDecl : KwdMethodDecl Keyword VariableName_ (28)

. reduce 28


state 120
ObjcKeywordPattern : ObjcKeywordPattern Keyword PatternType ParameterDesignator_ (99)

. reduce 99


state 121
ParameterDesignator : % DIGITS_ (101)

. reduce 101


state 122
ObjcFunctionArgList : ObjcFunctionArgList , PatternType_ParameterDesignator

IDENTIFIER shift 6
% shift 112
. error

VariableName goto 111
ParameterDesignator goto 128

state 123
Chunk : VariableName KEYWORD # VariableName KEYWORD StringConstant KEYWORD StringConstant KEYWORD StringConstant_KEYWORD StringConstant !

KEYWORD shift 129
. error


state 124
Method : MethodName LocalVariables $$16 PrimMarker_StmtList
AssignmentList : _ (37)

error shift 133
^ shift 131
. reduce 37

StmtList goto 130
Expr goto 132
AssignmentList goto 134

state 125
PrimMarker : <_KEYWORD NumberConstant >

KEYWORD shift 135
. error


state 126
LocalVariables : | VarList |_ (24)

. reduce 24


state 127
VarList : VarList VariableName_ (26)

. reduce 26


state 128
ObjcFunctionArgList : ObjcFunctionArgList , PatternType ParameterDesignator_ (95)

. reduce 95


state 129
Chunk : VariableName KEYWORD # VariableName KEYWORD StringConstant KEYWORD StringConstant KEYWORD StringConstant KEYWORD_StringConstant !

STRING shift 71
. error

StringConstant goto 136

state 130
Method : MethodName LocalVariables $$16 PrimMarker StmtList_ (17)

. reduce 17


state 131
StmtList : ^_Expr
AssignmentList : _ (37)

. reduce 37

Expr goto 137
AssignmentList goto 134

state 132
StmtList : Expr_ (30)
StmtList : Expr_.
StmtList : Expr_. StmtList

. shift 138
. reduce 30


state 133
StmtList : error_.

. shift 139
. error


state 134
Expr : AssignmentList_Primary
Expr : AssignmentList_SimpleMsgExpr
Expr : AssignmentList_SimpleMsgExpr CascadedMsgExpr
AssignmentList : AssignmentList_VariableName _

IDENTIFIER shift 6
DIGITS shift 157
STRING shift 71
CHARCON shift 156
# shift 152
- shift 158
( shift 145
[ shift 153
. error

Primary goto 140
UnaryObjDesc goto 154
BinaryObjDesc goto 155
SimpleMsgExpr goto 141
UnaryExpr goto 146
BinaryExpr goto 147
KeywordExpr goto 148
Literal goto 143
Block goto 144
VariableName goto 142
CharacterConstant goto 149
NumberConstant goto 151
StringConstant goto 150

state 135
PrimMarker : < KEYWORD_NumberConstant >

DIGITS shift 157
- shift 158
. error

NumberConstant goto 159

state 136
Chunk : VariableName KEYWORD # VariableName KEYWORD StringConstant KEYWORD StringConstant KEYWORD StringConstant KEYWORD StringConstant_!

! shift 160
. error


state 137
StmtList : ^ Expr_ (29)

. reduce 29


state 138
StmtList : Expr ._ (31)
StmtList : Expr ._StmtList
AssignmentList : _ (37)

error shift 133
! reduce 31
^ shift 131
] reduce 31
. reduce 37

StmtList goto 161
Expr goto 132
AssignmentList goto 134

state 139
StmtList : error ._ (33)

. reduce 33


state 140
Expr : AssignmentList Primary_ (34)
UnaryObjDesc : Primary_ (51)

! reduce 34
. reduce 34
) reduce 34
] reduce 34
. reduce 51


state 141
Expr : AssignmentList SimpleMsgExpr_ (35)
Expr : AssignmentList SimpleMsgExpr_CascadedMsgExpr

; shift 164
. reduce 35

CascadedMsgExpr goto 162
CascadedMsg goto 163

state 142
AssignmentList : AssignmentList VariableName__
Primary : VariableName_ (44)

_ shift 165
. reduce 44


state 143
Primary : Literal_ (45)

. reduce 45


state 144
Primary : Block_ (46)

. reduce 46


state 145
Primary : (_Expr )
AssignmentList : _ (37)

. reduce 37

Expr goto 166
AssignmentList goto 134

state 146
SimpleMsgExpr : UnaryExpr_ (48)
UnaryObjDesc : UnaryExpr_ (52)

! reduce 48
. reduce 48
; reduce 48
) reduce 48
] reduce 48
. reduce 52


state 147
SimpleMsgExpr : BinaryExpr_ (49)
BinaryObjDesc : BinaryExpr_ (55)

! reduce 49
. reduce 49
; reduce 49
) reduce 49
] reduce 49
. reduce 55


state 148
SimpleMsgExpr : KeywordExpr_ (50)

. reduce 50


state 149
Literal : CharacterConstant_ (60)

. reduce 60


state 150
Literal : StringConstant_ (61)

. reduce 61


state 151
Literal : NumberConstant_ (62)

. reduce 62


state 152
Literal : #_( ArrayMemberList )
Literal : #_UnarySelector
Literal : #_BinarySelector
Literal : #_KeywordList

IDENTIFIER shift 29
KEYWORD shift 171
DOUBLESPECIAL shift 32
% shift 43
| shift 47
& shift 44
? shift 45
, shift 46
+ shift 34
- shift 30
/ shift 35
\\ shift 36
* shift 37
~ shift 38
< shift 39
> shift 40
= shift 41
@ shift 42
( shift 167
. error

BinarySelector goto 169
UnarySelector goto 168
KeywordList goto 170
SpecialCharacter goto 31

state 153
Block : [_BlockVariables StmtList ]
Block : [_BlockVariables ]
BlockVariables : _ (78)

: shift 174
. reduce 78

BlockVarList goto 173
BlockVariables goto 172

state 154
UnaryExpr : UnaryObjDesc_UnarySelector
BinaryObjDesc : UnaryObjDesc_ (54)

IDENTIFIER shift 29
. reduce 54

UnarySelector goto 175

state 155
BinaryExpr : BinaryObjDesc_BinarySelector UnaryObjDesc
KeywordExpr : BinaryObjDesc_KeywordArgList

KEYWORD shift 48
DOUBLESPECIAL shift 32
% shift 43
| shift 47
& shift 44
? shift 45
, shift 46
+ shift 34
- shift 30
/ shift 35
\\ shift 36
* shift 37
~ shift 38
< shift 39
> shift 40
= shift 41
@ shift 42
. error

Keyword goto 178
KeywordArgList goto 177
BinarySelector goto 176
SpecialCharacter goto 31

state 156
CharacterConstant : CHARCON_ (128)

. reduce 128


state 157
NumberConstant : DIGITS_ (129)

. reduce 129


state 158
NumberConstant : -_DIGITS

DIGITS shift 179
. error


state 159
PrimMarker : < KEYWORD NumberConstant_>

> shift 180
. error


state 160
Chunk : VariableName KEYWORD # VariableName KEYWORD StringConstant KEYWORD StringConstant KEYWORD StringConstant KEYWORD StringConstant !_ (3)

. reduce 3


state 161
StmtList : Expr . StmtList_ (32)

. reduce 32


state 162
Expr : AssignmentList SimpleMsgExpr CascadedMsgExpr_ (36)
CascadedMsgExpr : CascadedMsgExpr_CascadedMsg

; shift 164
. reduce 36

CascadedMsg goto 181

state 163
CascadedMsgExpr : CascadedMsg_ (39)

. reduce 39


state 164
CascadedMsg : ;_UnarySelector
CascadedMsg : ;_BinarySelector UnaryObjDesc
CascadedMsg : ;_KeywordArgList

IDENTIFIER shift 29
KEYWORD shift 48
DOUBLESPECIAL shift 32
% shift 43
| shift 47
& shift 44
? shift 45
, shift 46
+ shift 34
- shift 30
/ shift 35
\\ shift 36
* shift 37
~ shift 38
< shift 39
> shift 40
= shift 41
@ shift 42
. error

Keyword goto 178
KeywordArgList goto 184
BinarySelector goto 183
UnarySelector goto 182
SpecialCharacter goto 31

state 165
AssignmentList : AssignmentList VariableName __ (38)

. reduce 38


state 166
Primary : ( Expr_)

) shift 185
. error


state 167
Literal : # (_ArrayMemberList )
ArrayMemberList : _ (67)

. reduce 67

ArrayMemberList goto 186

state 168
Literal : # UnarySelector_ (64)

. reduce 64


state 169
Literal : # BinarySelector_ (65)

. reduce 65


170: shift/reduce conflict (shift 187, red'n 66) on KEYWORD
state 170
Literal : # KeywordList_ (66)
KeywordList : KeywordList_KEYWORD

KEYWORD shift 187
. reduce 66


state 171
KeywordList : KEYWORD_ (102)

. reduce 102


state 172
Block : [ BlockVariables_StmtList ]
Block : [ BlockVariables_]
AssignmentList : _ (37)

error shift 133
^ shift 131
] shift 189
. reduce 37

StmtList goto 188
Expr goto 132
AssignmentList goto 134

state 173
BlockVariables : BlockVarList_|
BlockVarList : BlockVarList_: VariableName

| shift 190
: shift 191
. error


state 174
BlockVarList : :_VariableName

IDENTIFIER shift 6
. error

VariableName goto 192

state 175
UnaryExpr : UnaryObjDesc UnarySelector_ (53)

. reduce 53


state 176
BinaryExpr : BinaryObjDesc BinarySelector_UnaryObjDesc

IDENTIFIER shift 6
DIGITS shift 157
STRING shift 71
CHARCON shift 156
# shift 152
- shift 158
( shift 145
[ shift 153
. error

Primary goto 194
UnaryObjDesc goto 193
UnaryExpr goto 195
Literal goto 143
Block goto 144
VariableName goto 196
CharacterConstant goto 149
NumberConstant goto 151
StringConstant goto 150

state 177
KeywordExpr : BinaryObjDesc KeywordArgList_ (57)
KeywordArgList : KeywordArgList_Keyword BinaryObjDesc

KEYWORD shift 48
. reduce 57

Keyword goto 197

state 178
KeywordArgList : Keyword_BinaryObjDesc

IDENTIFIER shift 6
DIGITS shift 157
STRING shift 71
CHARCON shift 156
# shift 152
- shift 158
( shift 145
[ shift 153
. error

Primary goto 194
UnaryObjDesc goto 154
BinaryObjDesc goto 198
UnaryExpr goto 195
BinaryExpr goto 199
Literal goto 143
Block goto 144
VariableName goto 196
CharacterConstant goto 149
NumberConstant goto 151
StringConstant goto 150

state 179
NumberConstant : - DIGITS_ (130)

. reduce 130


state 180
PrimMarker : < KEYWORD NumberConstant >_ (22)

. reduce 22


state 181
CascadedMsgExpr : CascadedMsgExpr CascadedMsg_ (40)

. reduce 40


state 182
CascadedMsg : ; UnarySelector_ (41)

. reduce 41


state 183
CascadedMsg : ; BinarySelector_UnaryObjDesc

IDENTIFIER shift 6
DIGITS shift 157
STRING shift 71
CHARCON shift 156
# shift 152
- shift 158
( shift 145
[ shift 153
. error

Primary goto 194
UnaryObjDesc goto 200
UnaryExpr goto 195
Literal goto 143
Block goto 144
VariableName goto 196
CharacterConstant goto 149
NumberConstant goto 151
StringConstant goto 150

state 184
CascadedMsg : ; KeywordArgList_ (43)
KeywordArgList : KeywordArgList_Keyword BinaryObjDesc

KEYWORD shift 48
. reduce 43

Keyword goto 197

state 185
Primary : ( Expr )_ (47)

. reduce 47


state 186
Literal : # ( ArrayMemberList_)
ArrayMemberList : ArrayMemberList_ArrayMember

IDENTIFIER shift 29
DIGITS shift 157
KEYWORD shift 171
STRING shift 71
CHARCON shift 156
DOUBLESPECIAL shift 32
% shift 43
| shift 47
& shift 44
? shift 45
, shift 46
+ shift 34
- shift 210
/ shift 35
\\ shift 36
* shift 37
~ shift 38
< shift 39
> shift 40
= shift 41
@ shift 42
( shift 209
) shift 201
. error

ArrayMember goto 202
BinarySelector goto 207
UnarySelector goto 206
KeywordList goto 208
CharacterConstant goto 203
NumberConstant goto 205
StringConstant goto 204
SpecialCharacter goto 31

state 187
KeywordList : KeywordList KEYWORD_ (103)

. reduce 103


state 188
Block : [ BlockVariables StmtList_]

] shift 211
. error


state 189
Block : [ BlockVariables ]_ (77)

. reduce 77


state 190
BlockVariables : BlockVarList |_ (79)

. reduce 79


state 191
BlockVarList : BlockVarList :_VariableName

IDENTIFIER shift 6
. error

VariableName goto 212

state 192
BlockVarList : : VariableName_ (80)

. reduce 80


state 193
UnaryExpr : UnaryObjDesc_UnarySelector
BinaryExpr : BinaryObjDesc BinarySelector UnaryObjDesc_ (56)

IDENTIFIER shift 29
. reduce 56

UnarySelector goto 175

state 194
UnaryObjDesc : Primary_ (51)

. reduce 51


state 195
UnaryObjDesc : UnaryExpr_ (52)

. reduce 52


state 196
Primary : VariableName_ (44)

. reduce 44


state 197
KeywordArgList : KeywordArgList Keyword_BinaryObjDesc

IDENTIFIER shift 6
DIGITS shift 157
STRING shift 71
CHARCON shift 156
# shift 152
- shift 158
( shift 145
[ shift 153
. error

Primary goto 194
UnaryObjDesc goto 154
BinaryObjDesc goto 213
UnaryExpr goto 195
BinaryExpr goto 199
Literal goto 143
Block goto 144
VariableName goto 196
CharacterConstant goto 149
NumberConstant goto 151
StringConstant goto 150

state 198
BinaryExpr : BinaryObjDesc_BinarySelector UnaryObjDesc
KeywordArgList : Keyword BinaryObjDesc_ (58)

DOUBLESPECIAL shift 32
% shift 43
| shift 47
& shift 44
? shift 45
, shift 46
+ shift 34
- shift 30
/ shift 35
\\ shift 36
* shift 37
~ shift 38
< shift 39
> shift 40
= shift 41
@ shift 42
. reduce 58

BinarySelector goto 176
SpecialCharacter goto 31

state 199
BinaryObjDesc : BinaryExpr_ (55)

. reduce 55


state 200
CascadedMsg : ; BinarySelector UnaryObjDesc_ (42)
UnaryExpr : UnaryObjDesc_UnarySelector

IDENTIFIER shift 29
. reduce 42

UnarySelector goto 175

state 201
Literal : # ( ArrayMemberList )_ (63)

. reduce 63


state 202
ArrayMemberList : ArrayMemberList ArrayMember_ (68)

. reduce 68


state 203
ArrayMember : CharacterConstant_ (69)

. reduce 69


state 204
ArrayMember : StringConstant_ (70)

. reduce 70


state 205
ArrayMember : NumberConstant_ (71)

. reduce 71


state 206
ArrayMember : UnarySelector_ (72)

. reduce 72


state 207
ArrayMember : BinarySelector_ (73)

. reduce 73


208: shift/reduce conflict (shift 187, red'n 74) on KEYWORD
state 208
ArrayMember : KeywordList_ (74)
KeywordList : KeywordList_KEYWORD

KEYWORD shift 187
. reduce 74


state 209
ArrayMember : (_ArrayMemberList )
ArrayMemberList : _ (67)

. reduce 67

ArrayMemberList goto 214

210: shift/reduce conflict (shift 179, red'n 104) on DIGITS
state 210
BinarySelector : -_ (104)
NumberConstant : -_DIGITS

DIGITS shift 179
. reduce 104


state 211
Block : [ BlockVariables StmtList ]_ (76)

. reduce 76


state 212
BlockVarList : BlockVarList : VariableName_ (81)

. reduce 81


state 213
BinaryExpr : BinaryObjDesc_BinarySelector UnaryObjDesc
KeywordArgList : KeywordArgList Keyword BinaryObjDesc_ (59)

DOUBLESPECIAL shift 32
% shift 43
| shift 47
& shift 44
? shift 45
, shift 46
+ shift 34
- shift 30
/ shift 35
\\ shift 36
* shift 37
~ shift 38
< shift 39
> shift 40
= shift 41
@ shift 42
. reduce 59

BinarySelector goto 176
SpecialCharacter goto 31

state 214
ArrayMemberList : ArrayMemberList_ArrayMember
ArrayMember : ( ArrayMemberList_)

IDENTIFIER shift 29
DIGITS shift 157
KEYWORD shift 171
STRING shift 71
CHARCON shift 156
DOUBLESPECIAL shift 32
% shift 43
| shift 47
& shift 44
? shift 45
, shift 46
+ shift 34
- shift 210
/ shift 35
\\ shift 36
* shift 37
~ shift 38
< shift 39
> shift 40
= shift 41
@ shift 42
( shift 209
) shift 215
. error

ArrayMember goto 202
BinarySelector goto 207
UnarySelector goto 206
KeywordList goto 208
CharacterConstant goto 203
NumberConstant goto 205
StringConstant goto 204
SpecialCharacter goto 31

state 215
ArrayMember : ( ArrayMemberList )_ (75)

. reduce 75


37/300 terminals, 53/300 nonterminals
133/600 grammar rules, 216/750 states
3 shift/reduce, 0 reduce/reduce conflicts reported
53/350 working sets used
memory: states,etc. 1089/24000, parser 269/12000
109/600 distinct lookahead sets
179 extra closures
341 shift entries, 17 exceptions
139 goto entries
68 entries saved by goto default
Optimizer space used: input 909/24000, output 501/12000
501 table entries, 143 zero
maximum spread: 262, maximum offset: 260
\Rogue\Monster\
else
echo "will not over write ./src/y.output"
fi
echo "Finished archive 3 of 5"
exit
----
Dieter H. Zebbedies ('dee-ter ayech 'zeb-ed-eez)
Zebb-Hoff Mach. Tool's Automated Manufacturing Project Cleveland, OH
(USnail): 9535 Clinton Rd, Cleveland, OH 44144 (+216 631 6100) (+216 741-5994)
(UUCP): ...{decvax,sun,cbosgd}!cwruecmp!zhmti!dieter
(CSNET/ARPA/BITNET): die...@CWRU.EDU

0 new messages