1 package org.simantics.scl.compiler.internal.parsing.parser;
3 import java.io.DataInputStream;
4 import java.io.IOException;
5 import java.util.ArrayList;
6 import java.util.Arrays;
7 import java.util.Collections;
8 import org.simantics.scl.compiler.internal.parsing.exceptions.SCLSyntaxErrorException;
10 import org.simantics.scl.compiler.internal.parsing.Token;
12 public abstract class SCLParser {
13 public static final boolean TRACE = false;
15 private static final int INITIAL_CAPACITY = 16;
16 private static final int STATE_COUNT = 344;
17 private static final int TERMINAL_COUNT = 82;
18 private static final int NONTERMINAL_COUNT = 51;
19 private static final int PRODUCT_COUNT = 132;
21 private static final int[] ACTION_ROW_ID = new int[STATE_COUNT];
22 private static final int[] ACTION_COLUMN_ID = new int[TERMINAL_COUNT];
23 private static final short[] ACTION_TABLE = new short[6120];
24 private static final int[] ERROR_TABLE = new int[882];
25 private static final int[] GOTO_ROW_ID = new int[STATE_COUNT];
26 private static final int[] GOTO_COLUMN_ID = new int[NONTERMINAL_COUNT];
27 private static final short[] GOTO_TABLE = new short[1829];
28 private static final int[] PRODUCT_LHS = new int[PRODUCT_COUNT];
30 private static final short STATE_MASK = (short)0x0fff;
31 private static final short REDUCE_MASK = (short)0x8000;
32 private static final short POP_MASK = (short)0x4000;
33 private static final short PUSH_MASK = (short)0x2000;
34 private static final short ERROR_ACTION = (short)0xffff;
35 private static final short ACCEPT_ACTION = (short)0xfffe;
37 public static final String[] TERMINAL_NAMES = new String[] {
122 public static final String[] NONTERMINAL_NAMES = new String[] {
157 "symbolWithoutMinus",
178 DataInputStream input = new DataInputStream(SCLParser.class.getResourceAsStream("SCLParser.dat"));
179 for(int i=0;i<ACTION_ROW_ID.length;++i)
180 ACTION_ROW_ID[i] = input.readInt();
181 for(int i=0;i<ACTION_COLUMN_ID.length;++i)
182 ACTION_COLUMN_ID[i] = input.readInt();
183 for(int i=0;i<ACTION_TABLE.length;++i)
184 ACTION_TABLE[i] = input.readShort();
185 for(int i=0;i<ERROR_TABLE.length;++i)
186 ERROR_TABLE[i] = input.readInt();
187 for(int i=0;i<GOTO_ROW_ID.length;++i)
188 GOTO_ROW_ID[i] = input.readInt();
189 for(int i=0;i<GOTO_COLUMN_ID.length;++i)
190 GOTO_COLUMN_ID[i] = input.readInt();
191 for(int i=0;i<GOTO_TABLE.length;++i)
192 GOTO_TABLE[i] = input.readShort();
193 for(int i=0;i<PRODUCT_LHS.length;++i)
194 PRODUCT_LHS[i] = input.readInt();
196 } catch(IOException e) {
201 private static short getAction(int state, int symbol) {
202 int id = TERMINAL_COUNT*state + symbol;
203 if( ((ERROR_TABLE[id>>5] >> (id&31))&1) != 0 )
205 return ACTION_TABLE[ACTION_ROW_ID[state] + ACTION_COLUMN_ID[symbol]];
208 private static short getGoto(int state, int symbol) {
209 return GOTO_TABLE[GOTO_ROW_ID[state] + GOTO_COLUMN_ID[symbol]];
212 protected abstract Token nextToken();
214 private Object[] symbolStack = new Object[INITIAL_CAPACITY];
215 private int symbolStackLength = 0;
217 private int[] stateStack = new int[INITIAL_CAPACITY];
218 private int[] symbolStackPositionStack = new int[INITIAL_CAPACITY];
219 private int stateStackLength = 0;
222 private int reductionLength;
224 protected int length() {
225 return reductionLength;
228 protected Object get(int i) {
229 if(i < 0 || i >= reductionLength)
230 throw new IndexOutOfBoundsException();
231 return symbolStack[symbolStackLength+i];
234 private String parseErrorDescription(int state, Token token, int tokenId) {
235 StringBuilder b = new StringBuilder();
236 b.append("Unexpected token '").append(token)
237 .append("' (").append(TERMINAL_NAMES[tokenId])
238 .append("). Expected one of ");
239 ArrayList<String> possibleTerminals = new ArrayList<String>();
240 for(int i=0;i<TERMINAL_COUNT;++i)
241 if(getAction(state, i) != ERROR_ACTION)
242 possibleTerminals.add(TERMINAL_NAMES[i]);
243 Collections.sort(possibleTerminals);
244 for(int i=0;i<possibleTerminals.size();++i) {
247 b.append(possibleTerminals.get(i));
253 protected abstract RuntimeException syntaxError(Token token, String description);
255 private static String describeAction(int action) {
256 if(action == ERROR_ACTION)
258 if(action == ACCEPT_ACTION)
260 StringBuilder b = new StringBuilder();
261 if((action & REDUCE_MASK) != 0) {
262 action ^= REDUCE_MASK;
267 if((action & POP_MASK) != 0) {
271 if((action & PUSH_MASK) != 0) {
275 b.append(' ').append(action);
279 private Object parse(int state) {
281 Token token = nextToken();
282 int tokenId = token.id;
284 short action = getAction(state, tokenId);
286 System.out.println("state=" + state + ", tokenId=" + TERMINAL_NAMES[tokenId] +
287 ", action=" + describeAction(action));
288 System.out.print(" ");
289 for(int i=symbolStackLength-1,j=stateStackLength-1;i>=0;--i) {
290 Object s = symbolStack[i];
291 if(s instanceof Token)
292 System.out.print(" " + TERMINAL_NAMES[((Token)s).id]);
294 System.out.print(" " + s.getClass().getSimpleName());
295 while(j>=0 && symbolStackPositionStack[j]==i)
296 System.out.print(" (" + stateStack[j--] + ")");
298 System.out.println();
300 //System.out.println(STATE_DESCRIPTIONS[state]);
301 if((action & REDUCE_MASK) != 0) {
302 if(action == ACCEPT_ACTION)
303 return symbolStack[symbolStackLength-1];
304 if(action == ERROR_ACTION)
305 throw syntaxError(token, parseErrorDescription(state, token, tokenId));
306 stateStackLength -= (action >>> 13)&3;
307 action &= STATE_MASK;
309 int reductionBegin = symbolStackPositionStack[--stateStackLength];
311 reductionLength = symbolStackLength-reductionBegin;
312 symbolStackLength = reductionBegin;
314 if(symbolStackLength == symbolStack.length)
315 symbolStack = Arrays.copyOf(symbolStack, symbolStackLength*2);
316 Object symbol = reduce(action);
318 symbolStack[symbolStackLength] = symbol;
320 state = stateStack[stateStackLength];
321 action = getGoto(state, PRODUCT_LHS[action]);
323 if((action & POP_MASK) != 0) {
327 if((action & PUSH_MASK) != 0) {
328 if(stateStackLength == stateStack.length) {
329 stateStack = Arrays.copyOf(stateStack, stateStackLength*2);
330 symbolStackPositionStack = Arrays.copyOf(symbolStackPositionStack, stateStackLength*2);
332 symbolStackPositionStack[stateStackLength] = symbolStackLength;
333 stateStack[stateStackLength++] = state;
335 state = action & STATE_MASK;
340 if((action & POP_MASK) != 0) {
344 if((action & PUSH_MASK) != 0) {
345 if(stateStackLength == stateStack.length) {
346 stateStack = Arrays.copyOf(stateStack, stateStackLength*2);
347 symbolStackPositionStack = Arrays.copyOf(symbolStackPositionStack, stateStackLength*2);
349 symbolStackPositionStack[stateStackLength] = symbolStackLength;
350 stateStack[stateStackLength++] = state;
354 state = action & STATE_MASK;
357 if(symbolStackLength == symbolStack.length)
358 symbolStack = Arrays.copyOf(symbolStack, symbolStackLength*2);
359 symbolStack[symbolStackLength++] = token;
366 public Object parseModule() {
369 public Object parseCommands() {
372 public Object parseImport() {
375 public Object parseType() {
378 public Object parseExp() {
381 public Object parseEquationBlock() {
386 protected Object reduce(int productionId) {
388 switch(productionId) {
390 return reduceModule();
392 return reduceOneCommand();
394 return reduceManyCommands();
396 return reduceImport();
398 return reduceArrow();
400 return reduceLocalTypeAnnotation();
402 return reduceEntityTypeAnnotation();
404 return reduceEquationBlock();
406 return reduceTypeAnnotation();
408 return reduceValueDefinition();
410 return reduceDataDefinition();
412 return reduceTypeDefinition();
414 return reduceClassDefinition();
416 return reduceInstanceDefinition();
418 return reduceDerivingInstanceDefinition();
420 return reduceDocumentationString();
422 return reduceAnnotation();
424 return reducePrecedenceDefinition();
426 return reduceJustImport();
428 return reduceImportJava();
430 return reduceEffectDefinition();
432 return reduceRuleDefinition();
434 return reduceMappingRelationDefinition();
436 return reduceRelationDefinition();
438 return reduceStatementCommand();
440 return reduceImportCommand();
442 return reduceGuardStatement();
444 return reduceLetStatement();
446 return reduceBindStatement();
448 return reduceRuleStatement();
450 return reduceCHRStatement();
452 return reduceVerboseCHRStatement();
454 return reduceConstraintStatement();
456 return reduceDeclarations();
458 return reduceVarId();
460 return reduceEscapedSymbol();
462 return reduceTupleConstructor();
464 return reduceBinary();
466 return reduceSimpleRhs();
468 return reduceGuardedRhs();
470 return reduceConstructor();
472 return reduceRecordConstructor();
474 return reduceContext();
476 return reduceFundeps();
478 return reduceTypeVar();
480 return reduceTupleType();
482 return reduceListType();
484 return reduceListTypeConstructor();
486 return reduceTupleTypeConstructor();
488 return reduceLambda();
490 return reduceLambdaMatch();
496 return reduceMatch();
500 return reduceSelect();
502 return reduceEnforce();
506 return reduceHashedId();
508 return reduceBlank();
510 return reduceInteger();
512 return reduceFloat();
514 return reduceString();
518 return reduceTuple();
520 return reduceViewPattern();
522 return reduceRightSection();
524 return reduceLeftSection();
526 return reduceListLiteral();
528 return reduceRange();
530 return reduceListComprehension();
534 return reduceRecord();
536 return reduceTransformation();
540 return reduceRuleDeclarations();
542 return reduceImportShowing();
544 return reduceImportHiding();
546 return reduceImportValueItem();
548 return reduceFieldDescription();
550 return reduceStatements();
552 return reduceGuardedExpEq();
554 return reduceFundep();
556 return reduceQueryRuleDeclaration();
558 return reduceAnnotation();
560 return reduceGuardQuery();
562 return reduceEqualsQuery();
564 return reduceBindQuery();
566 return reduceCompositeQuery();
568 return reduceQueryBlock();
570 return reduceApply();
572 return reduceSymbol();
574 return reduceEscapedId();
576 return reduceMinus();
580 return reduceGreater();
584 return reduceFieldAccess();
586 return reduceIdAccessor();
588 return reduceStringAccessor();
590 return reduceExpAccessor();
594 return reduceStringLiteral();
596 return reduceSymbol();
598 return reduceEscapedId();
602 return reduceGreater();
606 return reduceGuardQualifier();
608 return reduceLetQualifier();
610 return reduceBindQualifier();
612 return reduceThenQualifier();
614 return reduceField();
616 return reduceFieldShorthand();
618 return reduceCHRQuery();
620 return reduceVerboseCHRQuery();
622 return reduceSimpleCaseRhs();
624 return reduceGuardedCaseRhs();
626 return reduceGuardedExpArrow();
628 return reduceGuardEquation();
630 return reduceBasicEquation();
632 return reduceEffect();
634 return reduceJustEtype();
636 return reduceForAll();
638 return reduceApplyType();
640 return reduceDummy1();
643 throw new RuntimeException("Internal parser error.");
645 } catch(SCLSyntaxErrorException e) {
646 StringBuilder b = new StringBuilder();
647 b.append("Failed to reduce");
648 for(int i=0;i<length();++i) {
650 b.append("\n (").append(i).append(") \"").append(obj).append('\"');
651 if(obj instanceof Token)
652 b.append(" (").append(TERMINAL_NAMES[((Token)obj).id]).append(")");
654 b.append(" [").append(obj.getClass().getSimpleName()).append("]");
656 throw new RuntimeException(b.toString(), e);
661 * module ::= (declaration (SEMICOLON declaration)*)?
663 protected abstract Object reduceModule();
665 * commands ::= command?
667 protected abstract Object reduceOneCommand();
669 * commands ::= commands SEMICOLON command
671 protected abstract Object reduceManyCommands();
673 * import ::= (IMPORT | INCLUDE) BEGIN_STRING END_STRING (AS ID)? importSpec?
675 protected abstract Object reduceImport();
677 * type ::= (etype (ARROW | IMPLIES))* etype
679 protected abstract Object reduceArrow();
681 * exp ::= bexp (HASTYPE type)?
683 protected abstract Object reduceLocalTypeAnnotation();
685 * exp ::= bexp COLON ID (queryBlock | WITH queryBlock?)?
687 protected abstract Object reduceEntityTypeAnnotation();
689 * equationBlock ::= (equation (SEMICOLON equation)*)?
691 protected abstract Object reduceEquationBlock();
693 * declaration ::= (var COMMA)* var HASTYPE type
695 protected abstract Object reduceTypeAnnotation();
697 * declaration ::= bexp rhs
699 protected abstract Object reduceValueDefinition();
701 * declaration ::= DATA ID ID* (EQUALS (constructor BAR)* constructor)?
703 protected abstract Object reduceDataDefinition();
705 * declaration ::= TYPE ID ID* EQUALS type
707 protected abstract Object reduceTypeDefinition();
709 * declaration ::= CLASS context? ID ID* (BAR fundeps | (BAR fundeps)? WHERE declarations)?
711 protected abstract Object reduceClassDefinition();
713 * declaration ::= INSTANCE context? ID atype atype* (WHERE declarations)?
715 protected abstract Object reduceInstanceDefinition();
717 * declaration ::= DERIVING INSTANCE context? ID atype atype*
719 protected abstract Object reduceDerivingInstanceDefinition();
721 * declaration ::= BEGIN_STRING END_STRING
723 protected abstract Object reduceDocumentationString();
725 * declaration ::= ANNOTATION_ID aexp*
727 protected abstract Object reduceAnnotation();
729 * declaration ::= (INFIX | INFIXL | INFIXR) INTEGER (var COMMA)* var
731 protected abstract Object reducePrecedenceDefinition();
733 * declaration ::= import
735 protected abstract Object reduceJustImport();
737 * declaration ::= IMPORTJAVA BEGIN_STRING END_STRING WHERE declarations
739 protected abstract Object reduceImportJava();
741 * declaration ::= EFFECT ID BEGIN_STRING END_STRING BEGIN_STRING END_STRING
743 protected abstract Object reduceEffectDefinition();
745 * declaration ::= (RULE | ABSTRACT_RULE) ID (EXTENDS (ID COMMA)* ID)? WHERE ruleDeclarations
747 protected abstract Object reduceRuleDefinition();
749 * declaration ::= MAPPING_RELATION ID atype*
751 protected abstract Object reduceMappingRelationDefinition();
753 * declaration ::= bexp FOLLOWS ruleDeclarations
755 protected abstract Object reduceRelationDefinition();
757 * command ::= statement
759 protected abstract Object reduceStatementCommand();
763 protected abstract Object reduceImportCommand();
767 protected abstract Object reduceGuardStatement();
769 * statement ::= exp rhs
771 protected abstract Object reduceLetStatement();
773 * statement ::= exp BINDS exp
775 protected abstract Object reduceBindStatement();
777 * statement ::= exp FOLLOWS queryBlock
779 protected abstract Object reduceRuleStatement();
781 * statement ::= chrQuery IMPLIES chrQuery
783 protected abstract Object reduceCHRStatement();
785 * statement ::= WHEN verboseChrQuery THEN_AFTER_WHEN verboseChrQuery
787 protected abstract Object reduceVerboseCHRStatement();
789 * statement ::= CONSTRAINT ID atype*
791 protected abstract Object reduceConstraintStatement();
793 * declarations ::= LBRACE (declaration (SEMICOLON (declaration SEMICOLON)* declaration)?)? RBRACE
795 protected abstract Object reduceDeclarations();
799 protected abstract Object reduceVarId();
801 * var ::= ESCAPED_SYMBOL
803 protected abstract Object reduceEscapedSymbol();
805 * var ::= LPAREN COMMA COMMA* RPAREN
807 protected abstract Object reduceTupleConstructor();
809 * bexp ::= MINUS? lexp (symbol lexp)*
811 protected abstract Object reduceBinary();
813 * rhs ::= EQUALS exp (WHERE statements)?
815 protected abstract Object reduceSimpleRhs();
817 * rhs ::= guardedExpEq guardedExpEq* (WHERE statements)?
819 protected abstract Object reduceGuardedRhs();
821 * constructor ::= (ANNOTATION_ID aexp)* ID atype*
823 protected abstract Object reduceConstructor();
825 * constructor ::= (ANNOTATION_ID aexp)* ID LBRACE fieldDeclaration (COMMA fieldDeclaration)* RBRACE
827 protected abstract Object reduceRecordConstructor();
829 * context ::= LPAREN type (COMMA type)* RPAREN IMPLIES
831 protected abstract Object reduceContext();
833 * fundeps ::= (fundep COMMA)* fundep
835 protected abstract Object reduceFundeps();
839 protected abstract Object reduceTypeVar();
841 * atype ::= LPAREN (type (COMMA (type COMMA)* type)?)? RPAREN
843 protected abstract Object reduceTupleType();
845 * atype ::= LBRACKET type RBRACKET
847 protected abstract Object reduceListType();
849 * atype ::= LBRACKET RBRACKET
851 protected abstract Object reduceListTypeConstructor();
853 * atype ::= LPAREN COMMA COMMA* RPAREN
855 protected abstract Object reduceTupleTypeConstructor();
857 * aexp ::= LAMBDA aexp aexp* ARROW exp
859 protected abstract Object reduceLambda();
861 * aexp ::= LAMBDA_MATCH LBRACE case (SEMICOLON case)* RBRACE
863 protected abstract Object reduceLambdaMatch();
865 * aexp ::= LET statements IN exp
867 protected abstract Object reduceLet();
869 * aexp ::= IF exp THEN exp (ELSE exp)?
871 protected abstract Object reduceIf();
873 * aexp ::= MATCH exp WITH LBRACE case (SEMICOLON case)* RBRACE
875 protected abstract Object reduceMatch();
877 * aexp ::= (DO | MDO) statements
879 protected abstract Object reduceDo();
881 * aexp ::= (SELECT | SELECT_FIRST | SELECT_DISTINCT) exp WHERE queryBlock
883 protected abstract Object reduceSelect();
885 * aexp ::= ENFORCE queryBlock
887 protected abstract Object reduceEnforce();
891 protected abstract Object reduceVar();
893 * aexp ::= ATTACHED_HASH ID
895 protected abstract Object reduceHashedId();
899 protected abstract Object reduceBlank();
903 protected abstract Object reduceInteger();
907 protected abstract Object reduceFloat();
909 * aexp ::= stringLiteral
911 protected abstract Object reduceString();
915 protected abstract Object reduceChar();
917 * aexp ::= LPAREN (exp (COMMA (exp COMMA)* exp)?)? RPAREN
919 protected abstract Object reduceTuple();
921 * aexp ::= LPAREN exp ARROW exp RPAREN
923 protected abstract Object reduceViewPattern();
925 * aexp ::= LPAREN symbolWithoutMinus lexp RPAREN
927 protected abstract Object reduceRightSection();
929 * aexp ::= LPAREN lexp symbol RPAREN
931 protected abstract Object reduceLeftSection();
933 * aexp ::= LBRACKET (exp (COMMA (exp COMMA)* exp)?)? RBRACKET
935 protected abstract Object reduceListLiteral();
937 * aexp ::= LBRACKET exp DOTDOT exp RBRACKET
939 protected abstract Object reduceRange();
941 * aexp ::= LBRACKET exp BAR listQualifier (COMMA listQualifier)* RBRACKET
943 protected abstract Object reduceListComprehension();
945 * aexp ::= ID AT aexp
947 protected abstract Object reduceAs();
949 * aexp ::= ID LBRACE (field (COMMA field)*)? RBRACE
951 protected abstract Object reduceRecord();
953 * aexp ::= TRANSFORMATION ID WHERE queryBlock
955 protected abstract Object reduceTransformation();
957 * aexp ::= EQ LBRACE equationBlock RBRACE
959 protected abstract Object reduceEq();
961 * ruleDeclarations ::= LBRACE (ruleDeclaration (SEMICOLON (ruleDeclaration SEMICOLON)* ruleDeclaration)?)? RBRACE
963 protected abstract Object reduceRuleDeclarations();
965 * importSpec ::= LPAREN (importItem (COMMA (importItem COMMA)* importItem)?)? RPAREN
967 protected abstract Object reduceImportShowing();
969 * importSpec ::= HIDING LPAREN (importItem (COMMA importItem)*)? RPAREN
971 protected abstract Object reduceImportHiding();
975 protected abstract Object reduceImportValueItem();
977 * fieldDeclaration ::= ID HASTYPE type
979 protected abstract Object reduceFieldDescription();
981 * statements ::= LBRACE (statement (SEMICOLON (statement SEMICOLON)* statement)?)? RBRACE
983 protected abstract Object reduceStatements();
985 * guardedExpEq ::= BAR exp (COMMA exp)* EQUALS exp
987 protected abstract Object reduceGuardedExpEq();
989 * fundep ::= ID ID* ARROW ID
991 protected abstract Object reduceFundep();
993 * ruleDeclaration ::= query
995 protected abstract Object reduceQueryRuleDeclaration();
999 protected abstract Object reduceGuardQuery();
1001 * query ::= exp EQUALS exp
1003 protected abstract Object reduceEqualsQuery();
1005 * query ::= exp BINDS exp
1007 protected abstract Object reduceBindQuery();
1009 * query ::= QUERY_OP queryBlock
1011 protected abstract Object reduceCompositeQuery();
1013 * queryBlock ::= LBRACE (query (SEMICOLON (query SEMICOLON)* query)?)? RBRACE
1015 protected abstract Object reduceQueryBlock();
1017 * lexp ::= faexp faexp*
1019 protected abstract Object reduceApply();
1023 protected abstract Object reduceSymbol();
1025 * symbol ::= ESCAPED_ID
1027 protected abstract Object reduceEscapedId();
1031 protected abstract Object reduceMinus();
1035 protected abstract Object reduceLess();
1037 * symbol ::= GREATER
1039 protected abstract Object reduceGreater();
1041 * symbol ::= SEPARATED_DOT
1043 protected abstract Object reduceDot();
1045 * faexp ::= aexp ((ATTACHED_HASH | ATTACHED_DOT) accessor)*
1047 protected abstract Object reduceFieldAccess();
1051 protected abstract Object reduceIdAccessor();
1053 * accessor ::= BEGIN_STRING END_STRING
1055 protected abstract Object reduceStringAccessor();
1057 * accessor ::= LPAREN exp RPAREN
1059 protected abstract Object reduceExpAccessor();
1061 * case ::= exp caseRhs
1063 protected abstract Object reduceCase();
1065 * stringLiteral ::= BEGIN_STRING (SUSPEND_STRING exp CONTINUE_STRING)* END_STRING
1067 protected abstract Object reduceStringLiteral();
1069 * listQualifier ::= exp
1071 protected abstract Object reduceGuardQualifier();
1073 * listQualifier ::= exp EQUALS exp
1075 protected abstract Object reduceLetQualifier();
1077 * listQualifier ::= exp BINDS exp
1079 protected abstract Object reduceBindQualifier();
1081 * listQualifier ::= THEN exp (BY exp)?
1083 protected abstract Object reduceThenQualifier();
1085 * field ::= ID EQUALS exp
1087 protected abstract Object reduceField();
1091 protected abstract Object reduceFieldShorthand();
1093 * chrQuery ::= (listQualifier COMMA)* listQualifier
1095 protected abstract Object reduceCHRQuery();
1097 * verboseChrQuery ::= LBRACE listQualifier (SEMICOLON listQualifier)* RBRACE
1099 protected abstract Object reduceVerboseCHRQuery();
1101 * caseRhs ::= ARROW exp (WHERE statements)?
1103 protected abstract Object reduceSimpleCaseRhs();
1105 * caseRhs ::= guardedExpArrow guardedExpArrow* (WHERE statements)?
1107 protected abstract Object reduceGuardedCaseRhs();
1109 * guardedExpArrow ::= BAR exp (COMMA exp)* ARROW exp
1111 protected abstract Object reduceGuardedExpArrow();
1115 protected abstract Object reduceGuardEquation();
1117 * equation ::= exp EQUALS exp
1119 protected abstract Object reduceBasicEquation();
1121 * etype ::= LESS ID (COMMA ID)* GREATER btype
1123 protected abstract Object reduceEffect();
1127 protected abstract Object reduceJustEtype();
1129 * etype ::= FORALL ID ID* (SEPARATED_DOT | ATTACHED_DOT) type
1131 protected abstract Object reduceForAll();
1133 * btype ::= atype atype*
1135 protected abstract Object reduceApplyType();
1137 * dummy ::= COMMENT EOL
1139 protected abstract Object reduceDummy1();
1141 protected void postReduce(Object reduced) {