FOR = 270,
IF = 271,
IMPORT = 272,
- IN = 273,
- IS = 274,
- MOD = 275,
- MODULE = 276,
- NIL = 277,
- OF = 278,
- OR = 279,
- POINTER = 280,
- PROCEDURE = 281,
- RECORD = 282,
- REPEAT = 283,
- RETURN = 284,
- THEN = 285,
- TO = 286,
- TRUE = 287,
- TYPE = 288,
- UNTIL = 289,
- VAR = 290,
- WHILE = 291,
- BECOMES = 292,
- DOTDOT = 293,
- GE = 294,
- LE = 295,
- IDENT = 296,
- INTEGER = 297,
- REAL = 298,
- STRING = 299,
- TOKEN_END = 300
+ IS = 273,
+ MOD = 274,
+ MODULE = 275,
+ NIL = 276,
+ OF = 277,
+ OR = 278,
+ POINTER = 279,
+ PROCEDURE = 280,
+ RECORD = 281,
+ REPEAT = 282,
+ RETURN = 283,
+ THEN = 284,
+ TO = 285,
+ TRUE = 286,
+ TYPE = 287,
+ UNTIL = 288,
+ VAR = 289,
+ WHILE = 290,
+ BECOMES = 291,
+ DOTDOT = 292,
+ GE = 293,
+ LE = 294,
+ IDENT = 295,
+ INTEGER = 296,
+ REAL = 297,
+ STRING = 298,
+ TOKEN_END = 299
};
#endif
/* Tokens. */
#define FOR 270
#define IF 271
#define IMPORT 272
-#define IN 273
-#define IS 274
-#define MOD 275
-#define MODULE 276
-#define NIL 277
-#define OF 278
-#define OR 279
-#define POINTER 280
-#define PROCEDURE 281
-#define RECORD 282
-#define REPEAT 283
-#define RETURN 284
-#define THEN 285
-#define TO 286
-#define TRUE 287
-#define TYPE 288
-#define UNTIL 289
-#define VAR 290
-#define WHILE 291
-#define BECOMES 292
-#define DOTDOT 293
-#define GE 294
-#define LE 295
-#define IDENT 296
-#define INTEGER 297
-#define REAL 298
-#define STRING 299
-#define TOKEN_END 300
+#define IS 273
+#define MOD 274
+#define MODULE 275
+#define NIL 276
+#define OF 277
+#define OR 278
+#define POINTER 279
+#define PROCEDURE 280
+#define RECORD 281
+#define REPEAT 282
+#define RETURN 283
+#define THEN 284
+#define TO 285
+#define TRUE 286
+#define TYPE 287
+#define UNTIL 288
+#define VAR 289
+#define WHILE 290
+#define BECOMES 291
+#define DOTDOT 292
+#define GE 293
+#define LE 294
+#define IDENT 295
+#define INTEGER 296
+#define REAL 297
+#define STRING 298
+#define TOKEN_END 299
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
const char *string;
Trees_Node node;
-#line 309 "y.tab.c"
+#line 307 "y.tab.c"
};
typedef union YYSTYPE YYSTYPE;
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 5
/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 236
+#define YYLAST 224
/* YYNTOKENS -- Number of terminals. */
-#define YYNTOKENS 68
+#define YYNTOKENS 65
/* YYNNTS -- Number of nonterminals. */
-#define YYNNTS 97
+#define YYNNTS 94
/* YYNRULES -- Number of rules. */
-#define YYNRULES 181
+#define YYNRULES 173
/* YYNSTATES -- Number of states. */
-#define YYNSTATES 284
+#define YYNSTATES 272
#define YYUNDEFTOK 2
-#define YYMAXUTOK 300
+#define YYMAXUTOK 299
/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 54, 2, 2, 60, 2,
- 50, 51, 47, 57, 49, 58, 46, 59, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 53, 52,
- 55, 48, 56, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 53, 2, 2, 59, 2,
+ 49, 50, 46, 56, 48, 57, 45, 58, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 52, 51,
+ 54, 47, 55, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 62, 2, 63, 64, 2, 2, 2, 2, 2,
+ 2, 61, 2, 62, 63, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 65, 67, 66, 61, 2, 2, 2,
+ 2, 2, 2, 2, 64, 2, 60, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
- 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
- 45
+ 35, 36, 37, 38, 39, 40, 41, 42, 43, 44
};
#if YYDEBUG
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_int16 yyrline[] =
{
- 0, 221, 221, 225, 232, 250, 255, 264, 268, 278,
- 294, 309, 332, 342, 343, 344, 345, 346, 350, 370,
- 380, 384, 391, 411, 419, 430, 435, 441, 482, 488,
- 494, 498, 526, 575, 579, 589, 624, 633, 640, 647,
- 649, 658, 696, 697, 744, 748, 752, 756, 760, 764,
- 768, 772, 779, 801, 830, 834, 839, 845, 849, 853,
- 860, 861, 891, 895, 899, 903, 907, 914, 915, 919,
- 924, 928, 932, 938, 958, 963, 984, 1004, 1023, 1029,
- 1037, 1055, 1060, 1065, 1072, 1076, 1083, 1084, 1097, 1117,
- 1141, 1146, 1160, 1161, 1162, 1163, 1164, 1165, 1166, 1168,
- 1174, 1217, 1235, 1243, 1251, 1262, 1285, 1298, 1303, 1309,
- 1314, 1320, 1341, 1379, 1387, 1402, 1408, 1414, 1418, 1434,
- 1443, 1490, 1499, 1513, 1598, 1605, 1610, 1616, 1631, 1649,
- 1675, 1686, 1704, 1713, 1763, 1784, 1799, 1804, 1810, 1815,
- 1821, 1825, 1826, 1830, 1831, 1835, 1847, 1853, 1860, 1861,
- 1865, 1866, 1870, 1871, 1875, 1876, 1880, 1887, 1893, 1899,
- 1904, 1937, 1957, 1963, 1982, 1987, 1993, 1997, 2018, 2034,
- 2039, 2048, 2075, 2089, 2096, 2104, 2140, 2148, 2159, 2234,
- 2239, 2245
+ 0, 218, 218, 222, 229, 247, 252, 261, 265, 275,
+ 291, 306, 329, 339, 340, 341, 342, 343, 347, 367,
+ 377, 381, 388, 408, 416, 427, 432, 438, 479, 485,
+ 491, 495, 523, 572, 576, 586, 621, 630, 637, 644,
+ 646, 655, 693, 694, 741, 745, 749, 753, 757, 761,
+ 765, 772, 794, 823, 827, 832, 838, 842, 846, 853,
+ 854, 884, 888, 892, 896, 900, 907, 908, 912, 917,
+ 921, 926, 946, 951, 972, 992, 1011, 1017, 1025, 1043,
+ 1048, 1053, 1060, 1065, 1079, 1080, 1081, 1082, 1083, 1084,
+ 1085, 1087, 1093, 1136, 1154, 1162, 1170, 1181, 1204, 1217,
+ 1222, 1228, 1233, 1239, 1260, 1298, 1306, 1321, 1327, 1333,
+ 1337, 1353, 1362, 1409, 1418, 1432, 1517, 1524, 1529, 1535,
+ 1550, 1568, 1594, 1605, 1623, 1632, 1682, 1703, 1718, 1723,
+ 1729, 1734, 1740, 1744, 1745, 1749, 1750, 1754, 1766, 1772,
+ 1779, 1780, 1784, 1785, 1789, 1790, 1794, 1795, 1799, 1806,
+ 1812, 1818, 1823, 1856, 1876, 1882, 1901, 1906, 1912, 1916,
+ 1937, 1953, 1958, 1967, 1994, 2008, 2015, 2023, 2059, 2067,
+ 2078, 2153, 2158, 2164
};
#endif
{
"$end", "error", "$undefined", "TOKEN_START", "ARRAY", "BEGIN_", "BY",
"CASE", "CONST", "DIV", "DO", "ELSE", "ELSIF", "END", "FALSE", "FOR",
- "IF", "IMPORT", "IN", "IS", "MOD", "MODULE", "NIL", "OF", "OR",
- "POINTER", "PROCEDURE", "RECORD", "REPEAT", "RETURN", "THEN", "TO",
- "TRUE", "TYPE", "UNTIL", "VAR", "WHILE", "BECOMES", "DOTDOT", "GE", "LE",
- "IDENT", "INTEGER", "REAL", "STRING", "TOKEN_END", "'.'", "'*'", "'='",
- "','", "'('", "')'", "';'", "':'", "'#'", "'<'", "'>'", "'+'", "'-'",
- "'/'", "'&'", "'~'", "'['", "']'", "'^'", "'{'", "'}'", "'|'", "$accept",
- "qualident", "identdef", "ExportMarkOpt", "number", "ConstDeclaration",
+ "IF", "IMPORT", "IS", "MOD", "MODULE", "NIL", "OF", "OR", "POINTER",
+ "PROCEDURE", "RECORD", "REPEAT", "RETURN", "THEN", "TO", "TRUE", "TYPE",
+ "UNTIL", "VAR", "WHILE", "BECOMES", "DOTDOT", "GE", "LE", "IDENT",
+ "INTEGER", "REAL", "STRING", "TOKEN_END", "'.'", "'*'", "'='", "','",
+ "'('", "')'", "';'", "':'", "'#'", "'<'", "'>'", "'+'", "'-'", "'/'",
+ "'&'", "'~'", "'['", "']'", "'^'", "'|'", "$accept", "qualident",
+ "identdef", "ExportMarkOpt", "number", "ConstDeclaration",
"ConstExpression", "TypeDeclaration", "TypeIdentDef", "type",
"ArrayType", "ArrayLengthOf", "LengthRep", "length", "RecordType",
"RecordHeading", "BaseTypeOpt", "BaseType", "FieldListSequenceOpt",
"PointerTo", "ProcedureType", "ProcedureTypeSansParam",
"FormalParametersOpt", "VariableDeclaration", "expression", "relation",
"SimpleExpression", "SignOpt", "AddOperator", "term", "MulOperator",
- "factor", "designator", "SelectorOptRep", "selector", "set",
- "ElementRep", "element", "ExpList", "statement", "assignment",
- "ProcedureCall", "StatementSequence", "StatementSequenceReversed",
- "IfStatement", "guard", "ElseIfThenOptRep", "ElseOpt", "CaseStatement",
- "CaseExpression", "CaseRep", "case", "CaseLabelList", "LabelRange",
- "label", "WhileStatement", "ElseIfDoOptRep", "RepeatStatement",
- "ForStatement", "ForInit", "ForLimit", "ByOpt", "ProcedureDeclaration",
- "ProcedureHeading", "ProcedureHeadingSansParam", "StatementSequenceOpt",
+ "factor", "designator", "SelectorOptRep", "selector", "ExpList",
+ "statement", "assignment", "ProcedureCall", "StatementSequence",
+ "StatementSequenceReversed", "IfStatement", "guard", "ElseIfThenOptRep",
+ "ElseOpt", "CaseStatement", "CaseExpression", "CaseRep", "case",
+ "CaseLabelList", "LabelRange", "label", "WhileStatement",
+ "ElseIfDoOptRep", "RepeatStatement", "ForStatement", "ForInit",
+ "ForLimit", "ByOpt", "ProcedureDeclaration", "ProcedureHeading",
+ "ProcedureHeadingSansParam", "StatementSequenceOpt",
"ReturnExpressionOpt", "DeclarationSequence", "ConstSectionOpt",
"ConstDeclarationOptRep", "TypeSectionOpt", "TypeKeyword",
"TypeDeclarationOptRep", "VariableSectionOpt",
265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
- 295, 296, 297, 298, 299, 300, 46, 42, 61, 44,
- 40, 41, 59, 58, 35, 60, 62, 43, 45, 47,
- 38, 126, 91, 93, 94, 123, 125, 124
+ 295, 296, 297, 298, 299, 46, 42, 61, 44, 40,
+ 41, 59, 58, 35, 60, 62, 43, 45, 47, 38,
+ 126, 91, 93, 94, 124
};
# endif
-#define YYPACT_NINF (-132)
+#define YYPACT_NINF (-124)
#define yypact_value_is_default(Yyn) \
((Yyn) == YYPACT_NINF)
-#define YYTABLE_NINF (-166)
+#define YYTABLE_NINF (-158)
#define yytable_value_is_error(Yyn) \
0
STATE-NUM. */
static const yytype_int16 yypact[] =
{
- -5, -21, 49, -8, -132, -132, 37, 19, 54, -132,
- 36, 46, -132, -132, 75, 61, 58, -132, 19, -132,
- 68, 100, -132, 98, -132, 90, -132, -132, -132, 70,
- 79, 80, 29, 92, 29, 100, 29, -132, 94, -132,
- -132, -132, -132, 83, -132, -132, -132, -132, -132, 93,
- -132, -132, 68, -132, -132, 29, -132, -132, -132, -132,
- 64, 9, 114, 101, 108, -132, 110, 109, 132, -32,
- 29, 100, 99, 68, 118, 103, 95, 20, -132, -132,
- -132, -132, -132, -132, -132, -132, -132, -132, -132, -132,
- -132, 29, 9, -132, -132, -132, -132, -132, -132, 29,
- 9, -24, -132, 8, -132, -132, -132, 82, 29, 29,
- 100, 29, 100, 105, 7, 29, -132, -132, -132, -132,
- -132, -132, -27, 96, 68, 97, 104, 111, -132, -132,
- 29, 119, -132, 113, 106, -132, -132, -132, 20, -132,
- 68, -132, 20, -132, 111, 33, 8, 107, -132, -132,
- 115, -37, -132, -132, -132, -132, -132, -132, 9, -132,
- -132, -132, -4, -132, 23, -132, 116, -132, -132, 149,
- -132, -132, -132, -132, -132, -132, -12, -36, 68, 20,
- -132, -132, -132, 54, -20, -132, -132, -132, -13, -132,
- -132, 124, -132, 125, -132, 146, 126, -132, 43, -132,
- -132, -132, 29, 29, -132, -132, -132, 82, 82, 100,
- 82, 29, 150, 102, 117, 29, -132, -132, -132, -132,
- 75, -132, 120, 127, -132, 128, -132, 29, -132, 129,
- -132, -132, 68, 20, -132, -132, -132, -132, -132, -132,
- -132, 100, 100, 29, 154, 29, -132, -132, 139, 123,
- 135, -132, 44, -132, -132, -132, -132, 164, -132, 152,
- -132, 173, 29, 171, 124, -132, -132, 145, -132, -132,
- 100, 100, -132, 147, -132, -132, -132, 15, -132, -132,
- -132, 166, -132, -132
+ -9, -11, 35, 5, -124, -124, 34, 33, 71, -124,
+ 50, 32, -124, -124, 66, 59, 53, -124, 33, -124,
+ 55, 100, -124, 98, -124, 79, -124, -124, -124, 72,
+ 70, 68, -34, 80, -34, 100, -34, -124, 85, -124,
+ -124, -124, -124, 73, -124, -124, -124, -124, -124, 82,
+ -124, -124, 55, -124, -124, -34, -124, -124, -124, -124,
+ 8, 63, 103, 93, 101, -124, 104, 99, 120, 65,
+ -34, 100, 89, 55, 111, 90, 87, 13, -124, -124,
+ -124, -124, -124, -124, -124, -124, -124, -124, -124, -124,
+ -34, 63, -124, -124, -124, -124, -124, -124, -34, 63,
+ -124, -1, -124, -124, 49, -34, -34, 100, -34, 100,
+ 102, -37, -34, -124, -124, -124, -124, -124, -124, -20,
+ 88, 55, 92, 94, 95, -124, -124, -34, 116, -124,
+ 105, 96, -124, -124, -124, 13, -124, 55, -124, 13,
+ -124, 95, 31, -1, 106, -124, -124, -124, -124, -124,
+ -124, 63, -124, -124, -124, -4, -124, -18, -124, 110,
+ -124, -124, 142, -124, -124, -124, -124, -124, -124, 19,
+ -38, 55, 13, -124, -124, -124, 71, -13, -124, -124,
+ -124, -7, -124, -124, 109, -124, 115, -124, 138, 107,
+ -124, 0, -124, -124, -124, -124, -124, 49, 49, 100,
+ 49, -34, 147, 97, 30, -34, -124, -124, -124, -124,
+ 66, -124, 112, 108, -124, 121, -124, -34, -124, 113,
+ -124, -124, 55, 13, -124, -124, -124, -124, -124, 100,
+ 100, -34, 152, -34, -124, -124, 132, 117, 133, -124,
+ 18, -124, -124, -124, -124, 155, -124, 141, -124, 162,
+ -34, 160, 109, -124, -124, 134, -124, -124, 100, 100,
+ -124, 136, -124, -124, -124, 10, -124, -124, -124, 156,
+ -124, -124
};
/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
means the default is an error. */
static const yytype_uint8 yydefact[] =
{
- 0, 0, 0, 0, 172, 1, 174, 0, 142, 173,
- 180, 0, 176, 144, 137, 146, 0, 178, 0, 175,
- 141, 99, 181, 0, 147, 151, 149, 179, 177, 6,
- 0, 0, 56, 0, 56, 99, 56, 78, 101, 103,
- 92, 93, 136, 102, 94, 95, 96, 97, 98, 0,
- 153, 155, 145, 5, 4, 56, 143, 54, 55, 112,
- 42, 0, 0, 0, 0, 106, 0, 0, 0, 76,
- 56, 99, 0, 150, 140, 0, 0, 0, 9, 10,
- 50, 51, 59, 49, 47, 44, 45, 46, 48, 57,
- 58, 56, 0, 71, 69, 70, 7, 8, 68, 56,
- 0, 56, 67, 52, 60, 73, 72, 116, 56, 56,
- 99, 56, 99, 0, 56, 56, 81, 77, 100, 104,
- 171, 33, 0, 0, 0, 0, 0, 40, 12, 148,
- 56, 0, 38, 26, 2, 13, 11, 14, 0, 15,
- 29, 16, 0, 17, 40, 43, 53, 0, 75, 84,
- 88, 0, 86, 64, 65, 62, 63, 66, 0, 121,
- 122, 123, 0, 113, 0, 117, 119, 129, 130, 132,
- 108, 127, 126, 79, 83, 90, 0, 0, 0, 0,
- 152, 135, 154, 142, 158, 134, 39, 22, 0, 20,
- 36, 0, 24, 0, 18, 0, 28, 30, 0, 35,
- 37, 74, 56, 56, 85, 61, 111, 116, 0, 99,
- 0, 56, 0, 110, 0, 56, 82, 80, 34, 41,
- 137, 164, 0, 157, 159, 0, 19, 56, 27, 0,
- 3, 23, 0, 0, 89, 87, 114, 118, 115, 120,
- 131, 99, 99, 56, 0, 56, 124, 91, 139, 162,
- 165, 166, 0, 21, 25, 31, 32, 0, 109, 0,
- 105, 0, 56, 0, 0, 156, 160, 0, 170, 128,
- 99, 99, 138, 0, 161, 167, 163, 0, 107, 125,
- 133, 0, 168, 169
+ 0, 0, 0, 0, 164, 1, 166, 0, 134, 165,
+ 172, 0, 168, 136, 129, 138, 0, 170, 0, 167,
+ 133, 91, 173, 0, 139, 143, 141, 171, 169, 6,
+ 0, 0, 55, 0, 55, 91, 55, 76, 93, 95,
+ 84, 85, 128, 94, 86, 87, 88, 89, 90, 0,
+ 145, 147, 137, 5, 4, 55, 135, 53, 54, 104,
+ 42, 0, 0, 0, 0, 98, 0, 0, 0, 74,
+ 55, 91, 0, 142, 132, 0, 0, 0, 9, 10,
+ 50, 58, 49, 47, 44, 45, 46, 48, 56, 57,
+ 55, 0, 70, 68, 69, 7, 8, 67, 55, 0,
+ 66, 51, 59, 71, 108, 55, 55, 91, 55, 91,
+ 0, 55, 55, 79, 75, 92, 96, 163, 33, 0,
+ 0, 0, 0, 0, 40, 12, 140, 55, 0, 38,
+ 26, 2, 13, 11, 14, 0, 15, 29, 16, 0,
+ 17, 40, 43, 52, 0, 73, 63, 64, 61, 62,
+ 65, 0, 113, 114, 115, 0, 105, 0, 109, 111,
+ 121, 122, 124, 100, 119, 118, 77, 81, 82, 0,
+ 0, 0, 0, 144, 127, 146, 134, 150, 126, 39,
+ 22, 0, 20, 36, 0, 24, 0, 18, 0, 28,
+ 30, 0, 35, 37, 72, 60, 103, 108, 0, 91,
+ 0, 55, 0, 102, 0, 55, 80, 78, 34, 41,
+ 129, 156, 0, 149, 151, 0, 19, 55, 27, 0,
+ 3, 23, 0, 0, 106, 110, 107, 112, 123, 91,
+ 91, 55, 0, 55, 116, 83, 131, 154, 157, 158,
+ 0, 21, 25, 31, 32, 0, 101, 0, 97, 0,
+ 55, 0, 0, 148, 152, 0, 162, 120, 91, 91,
+ 130, 0, 153, 159, 155, 0, 99, 117, 125, 0,
+ 160, 161
};
/* YYPGOTO[NTERM-NUM]. */
static const yytype_int16 yypgoto[] =
{
- -132, -102, -14, -132, -132, -132, -54, -132, -132, -131,
- -132, -132, -132, -40, -132, -132, -132, -132, -132, -132,
- -42, 121, -132, -132, -132, -132, 47, -132, -30, -132,
- 112, -132, -132, 122, -132, -92, -57, -132, -132, -132,
- -132, -11, 78, 130, -132, -132, -35, -132, -132, -33,
- -132, -132, -132, -132, -132, -9, -132, -6, -15, -132,
- -132, -132, -132, -132, -132, -132, -132, -132, -132, -16,
- -132, 13, -132, -132, -132, -132, -132, -132, -132, -132,
- -132, -132, -132, -132, -51, -132, -132, -132, -132, -132,
- -132, -132, -132, -132, 182, -132, -132
+ -124, -99, -19, -124, -124, -124, -51, -124, -124, -123,
+ -124, -124, -124, -40, -124, -124, -124, -124, -124, -124,
+ -43, 118, -124, -124, -124, -124, 39, -124, -30, -124,
+ 91, -124, -124, 114, -124, -92, -55, -124, -124, 74,
+ 119, -124, -124, -35, -124, -124, -33, -124, -124, -124,
+ -124, -124, -15, -124, -14, -17, -124, -124, -124, -124,
+ -124, -124, -124, -124, -124, -124, -25, -124, 12, -124,
+ -124, -124, -124, -124, -124, -124, -124, -124, -124, -124,
+ -124, -49, -124, -124, -124, -124, -124, -124, -124, -124,
+ -124, 174, -124, -124
};
/* YYDEFGOTO[NTERM-NUM]. */
static const yytype_int16 yydefgoto[] =
{
- -1, 135, 121, 54, 102, 31, 187, 76, 77, 136,
- 137, 138, 188, 189, 139, 140, 192, 229, 195, 196,
- 197, 198, 141, 142, 143, 144, 185, 123, 65, 91,
- 60, 61, 92, 103, 158, 104, 38, 69, 117, 106,
- 151, 152, 176, 39, 40, 41, 42, 43, 44, 66,
- 213, 244, 45, 62, 162, 163, 164, 165, 166, 46,
- 214, 47, 48, 64, 169, 212, 125, 126, 127, 22,
- 263, 14, 15, 20, 25, 26, 52, 51, 73, 74,
- 186, 222, 223, 265, 224, 225, 252, 276, 277, 2,
- 3, 8, 9, 11, 12, 17, 23
+ -1, 132, 118, 54, 100, 31, 180, 76, 77, 133,
+ 134, 135, 181, 182, 136, 137, 185, 219, 188, 189,
+ 190, 191, 138, 139, 140, 141, 178, 120, 65, 90,
+ 60, 61, 91, 101, 151, 102, 38, 69, 114, 169,
+ 39, 40, 41, 42, 43, 44, 66, 203, 232, 45,
+ 62, 155, 156, 157, 158, 159, 46, 204, 47, 48,
+ 64, 162, 202, 122, 123, 124, 22, 251, 14, 15,
+ 20, 25, 26, 52, 51, 73, 74, 179, 212, 213,
+ 253, 214, 215, 240, 264, 265, 2, 3, 8, 9,
+ 11, 12, 17, 23
};
/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
number is the opposite. If YYTABLE_NINF, syntax error. */
static const yytype_int16 yytable[] =
{
- 67, 78, 59, 68, 105, 161, 30, 194, 148, 206,
- 226, 199, 203, 215, 113, 221, 1, 153, 114, 281,
- 4, -165, 178, 93, 130, 79, 179, 217, 154, 204,
- 115, 94, 116, 57, 58, 105, 227, 215, 75, 216,
- 118, 95, 149, 105, 6, 131, 132, 133, 219, 5,
- 37, 96, 97, 98, 7, 155, 134, 82, 174, 99,
- 10, 134, 13, 207, 57, 58, 205, 156, 157, 147,
- 100, 150, 208, 16, 101, 170, 209, 172, 167, 168,
- 21, 171, 80, 81, 175, 175, 57, 58, 82, 228,
- 89, 90, 178, 267, 24, 18, 233, 268, 19, 27,
- 79, 105, 256, 83, 84, 161, 161, 32, 161, 29,
- 181, 49, 85, 242, 243, 33, 34, 53, 86, 87,
- 88, 89, 90, 134, 159, 50, 160, 55, 35, 245,
- 246, 70, 56, 63, 72, 71, 36, 107, 108, 109,
- 110, 37, 112, 111, 124, 120, 173, 129, 180, 182,
- 190, 128, 193, 202, 210, 211, 183, 240, 201, 231,
- 241, 184, 274, 191, 218, 134, 230, 260, 262, 251,
- 221, 249, 234, 150, 238, 282, 264, 269, 232, 250,
- 254, 79, 270, 271, 273, 247, 275, 253, 280, 283,
- 255, 200, 235, 177, 122, 239, 220, 79, 236, 266,
- 28, 119, 237, 145, 248, 0, 257, 258, 0, 0,
- 259, 0, 261, 0, 146, 0, 0, 0, 0, 0,
+ 67, 30, 59, 68, 78, 154, 103, 145, 146, 196,
+ 205, 1, 187, 167, 269, 216, 192, 127, 147, 57,
+ 58, 211, 57, 58, 207, 79, 80, -157, 171, 4,
+ 198, 81, 172, 75, 199, 5, 103, 128, 129, 130,
+ 115, 217, 233, 234, 103, 148, 82, 83, 171, 209,
+ 131, 7, 223, 131, 81, 84, 6, 149, 150, 195,
+ 197, 85, 86, 87, 88, 89, 255, 205, 144, 206,
+ 256, 21, 163, 10, 165, 160, 161, 92, 164, 13,
+ 18, 168, 168, 19, 93, 218, 16, 88, 89, 131,
+ 152, 24, 153, 27, 94, 29, 103, 79, 154, 154,
+ 244, 154, 174, 37, 95, 96, 97, 32, 230, 231,
+ 110, 49, 98, 50, 111, 33, 34, 55, 53, 56,
+ 63, 70, 72, 99, 71, 104, 112, 35, 113, 105,
+ 109, 106, 108, 107, 117, 36, 121, 125, 126, 173,
+ 37, 186, 166, 175, 177, 176, 183, 200, 201, 131,
+ 228, 221, 208, 262, 184, 220, 194, 229, 222, 238,
+ 250, 239, 237, 242, 226, 248, 270, 211, 257, 252,
+ 258, 79, 259, 261, 263, 235, 268, 241, 271, 243,
+ 193, 142, 224, 227, 225, 236, 170, 79, 210, 254,
+ 116, 119, 28, 0, 245, 246, 0, 0, 247, 0,
+ 249, 0, 0, 0, 0, 143, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 272, 0, 0, 278, 279
+ 260, 0, 0, 266, 267
};
static const yytype_int16 yycheck[] =
{
- 35, 55, 32, 36, 61, 107, 20, 138, 100, 13,
- 23, 142, 49, 49, 46, 35, 21, 9, 50, 4,
- 41, 41, 49, 14, 4, 55, 53, 63, 20, 66,
- 62, 22, 64, 57, 58, 92, 49, 49, 52, 51,
- 70, 32, 66, 100, 52, 25, 26, 27, 179, 0,
- 41, 42, 43, 44, 17, 47, 41, 24, 51, 50,
- 41, 41, 8, 67, 57, 58, 158, 59, 60, 99,
- 61, 101, 49, 37, 65, 110, 53, 112, 108, 109,
- 5, 111, 18, 19, 114, 115, 57, 58, 24, 191,
- 57, 58, 49, 49, 33, 49, 53, 53, 52, 41,
- 130, 158, 233, 39, 40, 207, 208, 7, 210, 41,
- 124, 13, 48, 11, 12, 15, 16, 47, 54, 55,
- 56, 57, 58, 41, 42, 35, 44, 48, 28, 12,
- 13, 37, 52, 41, 41, 52, 36, 23, 37, 31,
- 30, 41, 10, 34, 26, 46, 41, 52, 52, 52,
- 31, 48, 46, 38, 38, 6, 52, 211, 51, 13,
- 10, 50, 264, 50, 178, 41, 41, 13, 29, 41,
- 35, 51, 202, 203, 209, 277, 53, 13, 52, 52,
- 51, 211, 30, 10, 13, 215, 41, 227, 41, 23,
- 232, 144, 203, 115, 73, 210, 183, 227, 207, 250,
- 18, 71, 208, 91, 220, -1, 241, 242, -1, -1,
- 243, -1, 245, -1, 92, -1, -1, -1, -1, -1,
+ 35, 20, 32, 36, 55, 104, 61, 99, 9, 13,
+ 48, 20, 135, 50, 4, 22, 139, 4, 19, 56,
+ 57, 34, 56, 57, 62, 55, 18, 40, 48, 40,
+ 48, 23, 52, 52, 52, 0, 91, 24, 25, 26,
+ 70, 48, 12, 13, 99, 46, 38, 39, 48, 172,
+ 40, 17, 52, 40, 23, 47, 51, 58, 59, 151,
+ 64, 53, 54, 55, 56, 57, 48, 48, 98, 50,
+ 52, 5, 107, 40, 109, 105, 106, 14, 108, 8,
+ 48, 111, 112, 51, 21, 184, 36, 56, 57, 40,
+ 41, 32, 43, 40, 31, 40, 151, 127, 197, 198,
+ 223, 200, 121, 40, 41, 42, 43, 7, 11, 12,
+ 45, 13, 49, 34, 49, 15, 16, 47, 46, 51,
+ 40, 36, 40, 60, 51, 22, 61, 27, 63, 36,
+ 10, 30, 33, 29, 45, 35, 25, 47, 51, 51,
+ 40, 45, 40, 51, 49, 51, 30, 37, 6, 40,
+ 201, 13, 171, 252, 49, 40, 50, 10, 51, 51,
+ 28, 40, 50, 50, 199, 13, 265, 34, 13, 52,
+ 29, 201, 10, 13, 40, 205, 40, 217, 22, 222,
+ 141, 90, 197, 200, 198, 210, 112, 217, 176, 238,
+ 71, 73, 18, -1, 229, 230, -1, -1, 231, -1,
+ 233, -1, -1, -1, -1, 91, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 262, -1, -1, 270, 271
+ 250, -1, -1, 258, 259
};
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
symbol of state STATE-NUM. */
static const yytype_uint8 yystos[] =
{
- 0, 21, 157, 158, 41, 0, 52, 17, 159, 160,
- 41, 161, 162, 8, 139, 140, 37, 163, 49, 52,
- 141, 5, 137, 164, 33, 142, 143, 41, 162, 41,
- 70, 73, 7, 15, 16, 28, 36, 41, 104, 111,
- 112, 113, 114, 115, 116, 120, 127, 129, 130, 13,
- 35, 145, 144, 47, 71, 48, 52, 57, 58, 96,
- 98, 99, 121, 41, 131, 96, 117, 114, 117, 105,
- 37, 52, 41, 146, 147, 70, 75, 76, 74, 96,
- 18, 19, 24, 39, 40, 48, 54, 55, 56, 57,
- 58, 97, 100, 14, 22, 32, 42, 43, 44, 50,
- 61, 65, 72, 101, 103, 104, 107, 23, 37, 31,
- 30, 34, 10, 46, 50, 62, 64, 106, 96, 111,
- 46, 70, 89, 95, 26, 134, 135, 136, 48, 52,
- 4, 25, 26, 27, 41, 69, 77, 78, 79, 82,
- 83, 90, 91, 92, 93, 98, 101, 96, 103, 66,
- 96, 108, 109, 9, 20, 47, 59, 60, 102, 42,
- 44, 69, 122, 123, 124, 125, 126, 96, 96, 132,
- 114, 96, 114, 41, 51, 96, 110, 110, 49, 53,
- 52, 70, 52, 52, 50, 94, 148, 74, 80, 81,
- 31, 50, 84, 46, 77, 86, 87, 88, 89, 77,
- 94, 51, 38, 49, 66, 103, 13, 67, 49, 53,
- 38, 6, 133, 118, 128, 49, 51, 63, 70, 77,
- 139, 35, 149, 150, 152, 153, 23, 49, 69, 85,
- 41, 13, 52, 53, 96, 109, 123, 125, 114, 126,
- 74, 10, 11, 12, 119, 12, 13, 96, 137, 51,
- 52, 41, 154, 81, 51, 88, 77, 114, 114, 117,
- 13, 117, 29, 138, 53, 151, 152, 49, 53, 13,
- 30, 10, 96, 13, 69, 41, 155, 156, 114, 114,
- 41, 4, 69, 23
+ 0, 20, 151, 152, 40, 0, 51, 17, 153, 154,
+ 40, 155, 156, 8, 133, 134, 36, 157, 48, 51,
+ 135, 5, 131, 158, 32, 136, 137, 40, 156, 40,
+ 67, 70, 7, 15, 16, 27, 35, 40, 101, 105,
+ 106, 107, 108, 109, 110, 114, 121, 123, 124, 13,
+ 34, 139, 138, 46, 68, 47, 51, 56, 57, 93,
+ 95, 96, 115, 40, 125, 93, 111, 108, 111, 102,
+ 36, 51, 40, 140, 141, 67, 72, 73, 71, 93,
+ 18, 23, 38, 39, 47, 53, 54, 55, 56, 57,
+ 94, 97, 14, 21, 31, 41, 42, 43, 49, 60,
+ 69, 98, 100, 101, 22, 36, 30, 29, 33, 10,
+ 45, 49, 61, 63, 103, 93, 105, 45, 67, 86,
+ 92, 25, 128, 129, 130, 47, 51, 4, 24, 25,
+ 26, 40, 66, 74, 75, 76, 79, 80, 87, 88,
+ 89, 90, 95, 98, 93, 100, 9, 19, 46, 58,
+ 59, 99, 41, 43, 66, 116, 117, 118, 119, 120,
+ 93, 93, 126, 108, 93, 108, 40, 50, 93, 104,
+ 104, 48, 52, 51, 67, 51, 51, 49, 91, 142,
+ 71, 77, 78, 30, 49, 81, 45, 74, 83, 84,
+ 85, 86, 74, 91, 50, 100, 13, 64, 48, 52,
+ 37, 6, 127, 112, 122, 48, 50, 62, 67, 74,
+ 133, 34, 143, 144, 146, 147, 22, 48, 66, 82,
+ 40, 13, 51, 52, 117, 119, 108, 120, 71, 10,
+ 11, 12, 113, 12, 13, 93, 131, 50, 51, 40,
+ 148, 78, 50, 85, 74, 108, 108, 111, 13, 111,
+ 28, 132, 52, 145, 146, 48, 52, 13, 29, 10,
+ 93, 13, 66, 40, 149, 150, 108, 108, 40, 4,
+ 66, 22
};
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
static const yytype_uint8 yyr1[] =
{
- 0, 68, 69, 69, 70, 71, 71, 72, 72, 73,
- 74, 75, 76, 77, 77, 77, 77, 77, 78, 79,
- 80, 80, 81, 82, 83, 84, 84, 85, 86, 86,
- 87, 87, 88, 89, 89, 90, 91, 92, 93, 94,
- 94, 95, 96, 96, 97, 97, 97, 97, 97, 97,
- 97, 97, 98, 98, 99, 99, 99, 100, 100, 100,
- 101, 101, 102, 102, 102, 102, 102, 103, 103, 103,
- 103, 103, 103, 103, 103, 103, 104, 105, 105, 106,
- 106, 106, 106, 106, 107, 107, 108, 108, 109, 109,
- 110, 110, 111, 111, 111, 111, 111, 111, 111, 111,
- 112, 113, 114, 115, 115, 116, 117, 118, 118, 119,
- 119, 120, 121, 122, 122, 123, 123, 124, 124, 125,
- 125, 126, 126, 126, 127, 128, 128, 129, 130, 131,
- 132, 133, 133, 134, 135, 136, 137, 137, 138, 138,
- 139, 140, 140, 141, 141, 142, 142, 143, 144, 144,
- 145, 145, 146, 146, 147, 147, 148, 149, 149, 150,
- 150, 151, 151, 152, 153, 153, 154, 154, 155, 156,
- 156, 157, 158, 159, 159, 160, 161, 161, 162, 163,
- 163, 164
+ 0, 65, 66, 66, 67, 68, 68, 69, 69, 70,
+ 71, 72, 73, 74, 74, 74, 74, 74, 75, 76,
+ 77, 77, 78, 79, 80, 81, 81, 82, 83, 83,
+ 84, 84, 85, 86, 86, 87, 88, 89, 90, 91,
+ 91, 92, 93, 93, 94, 94, 94, 94, 94, 94,
+ 94, 95, 95, 96, 96, 96, 97, 97, 97, 98,
+ 98, 99, 99, 99, 99, 99, 100, 100, 100, 100,
+ 100, 100, 100, 100, 101, 102, 102, 103, 103, 103,
+ 103, 103, 104, 104, 105, 105, 105, 105, 105, 105,
+ 105, 105, 106, 107, 108, 109, 109, 110, 111, 112,
+ 112, 113, 113, 114, 115, 116, 116, 117, 117, 118,
+ 118, 119, 119, 120, 120, 120, 121, 122, 122, 123,
+ 124, 125, 126, 127, 127, 128, 129, 130, 131, 131,
+ 132, 132, 133, 134, 134, 135, 135, 136, 136, 137,
+ 138, 138, 139, 139, 140, 140, 141, 141, 142, 143,
+ 143, 144, 144, 145, 145, 146, 147, 147, 148, 148,
+ 149, 150, 150, 151, 152, 153, 153, 154, 155, 155,
+ 156, 157, 157, 158
};
/* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
1, 3, 1, 3, 2, 3, 0, 1, 1, 0,
1, 3, 3, 1, 3, 2, 2, 2, 1, 1,
0, 3, 1, 3, 1, 1, 1, 1, 1, 1,
- 1, 1, 2, 3, 1, 1, 0, 1, 1, 1,
- 1, 3, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 3, 2, 2, 2, 0, 2,
- 3, 1, 3, 2, 2, 3, 1, 3, 1, 3,
- 1, 3, 1, 1, 1, 1, 1, 1, 1, 0,
- 3, 1, 1, 1, 3, 7, 1, 5, 0, 2,
- 0, 5, 1, 1, 3, 3, 0, 1, 3, 1,
- 3, 1, 1, 1, 6, 5, 0, 4, 8, 3,
- 1, 2, 0, 7, 2, 2, 2, 0, 2, 0,
- 4, 2, 0, 3, 0, 2, 0, 1, 3, 0,
- 2, 0, 3, 0, 3, 0, 4, 1, 0, 1,
- 3, 2, 0, 4, 1, 0, 1, 3, 2, 3,
- 0, 8, 2, 1, 0, 3, 1, 3, 2, 2,
- 0, 1
+ 1, 2, 3, 1, 1, 0, 1, 1, 1, 1,
+ 3, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 3, 2, 2, 2, 0, 2, 3, 1,
+ 3, 2, 1, 3, 1, 1, 1, 1, 1, 1,
+ 1, 0, 3, 1, 1, 1, 3, 7, 1, 5,
+ 0, 2, 0, 5, 1, 1, 3, 3, 0, 1,
+ 3, 1, 3, 1, 1, 1, 6, 5, 0, 4,
+ 8, 3, 1, 2, 0, 7, 2, 2, 2, 0,
+ 2, 0, 4, 2, 0, 3, 0, 2, 0, 1,
+ 3, 0, 2, 0, 3, 0, 3, 0, 4, 1,
+ 0, 1, 3, 2, 0, 4, 1, 0, 1, 3,
+ 2, 3, 0, 8, 2, 1, 0, 3, 1, 3,
+ 2, 2, 0, 1
};
switch (yyn)
{
case 2:
-#line 222 "Oberon.y"
+#line 219 "Oberon.y"
{
(yyval.node) = Trees_NewIdent((yyvsp[0].ident));
}
-#line 1717 "y.tab.c"
+#line 1706 "y.tab.c"
break;
case 3:
-#line 226 "Oberon.y"
+#line 223 "Oberon.y"
{
(yyval.node) = Trees_NewIdent(Util_String("%s.%s", (yyvsp[-2].ident), (yyvsp[0].ident)));
}
-#line 1725 "y.tab.c"
+#line 1714 "y.tab.c"
break;
case 4:
-#line 233 "Oberon.y"
+#line 230 "Oberon.y"
{
if (! Table_LocallyDeclared((yyvsp[-1].ident)) || (recordDeclarationStack != NULL)) {
(yyval.node) = Trees_NewIdent((yyvsp[-1].ident));
YYABORT;
}
}
-#line 1744 "y.tab.c"
+#line 1733 "y.tab.c"
break;
case 5:
-#line 251 "Oberon.y"
+#line 248 "Oberon.y"
{
(yyval.integer) = 1;
}
-#line 1752 "y.tab.c"
+#line 1741 "y.tab.c"
break;
case 6:
-#line 255 "Oberon.y"
+#line 252 "Oberon.y"
{
(yyval.integer) = 0;
}
-#line 1760 "y.tab.c"
+#line 1749 "y.tab.c"
break;
case 7:
-#line 265 "Oberon.y"
+#line 262 "Oberon.y"
{
(yyval.node) = Trees_NewInteger((yyvsp[0].integer));
}
-#line 1768 "y.tab.c"
+#line 1757 "y.tab.c"
break;
case 8:
-#line 269 "Oberon.y"
+#line 266 "Oberon.y"
{
(yyval.node) = Trees_NewReal((yyvsp[0].real));
}
-#line 1776 "y.tab.c"
+#line 1765 "y.tab.c"
break;
case 9:
-#line 279 "Oberon.y"
+#line 276 "Oberon.y"
{
if (! (Trees_Exported((yyvsp[-2].node)) && Trees_Local((yyvsp[-2].node)))) {
Trees_SetKind(TREES_CONSTANT_KIND, (yyvsp[-2].node));
YYABORT;
}
}
-#line 1793 "y.tab.c"
+#line 1782 "y.tab.c"
break;
case 10:
-#line 295 "Oberon.y"
+#line 292 "Oberon.y"
{
if (IsConstExpression((yyvsp[0].node))) {
(yyval.node) = (yyvsp[0].node);
YYABORT;
}
}
-#line 1806 "y.tab.c"
+#line 1795 "y.tab.c"
break;
case 11:
-#line 310 "Oberon.y"
+#line 307 "Oberon.y"
{
Trees_Node sourceType;
YYABORT;
}
}
-#line 1830 "y.tab.c"
+#line 1819 "y.tab.c"
break;
case 12:
-#line 333 "Oberon.y"
+#line 330 "Oberon.y"
{
Trees_SetKind(TREES_TYPE_KIND, (yyvsp[-1].node));
currentTypeIdentdef = (yyvsp[-1].node);
Table_Put((yyvsp[-1].node));
(yyval.node) = (yyvsp[-1].node);
}
-#line 1841 "y.tab.c"
+#line 1830 "y.tab.c"
break;
case 18:
-#line 351 "Oberon.y"
+#line 348 "Oberon.y"
{
Trees_Node reversedLengths, length;
exit(EXIT_FAILURE);
}
}
-#line 1862 "y.tab.c"
+#line 1851 "y.tab.c"
break;
case 19:
-#line 371 "Oberon.y"
+#line 368 "Oberon.y"
{
if ((currentTypeIdentdef != NULL) && (Trees_Type(currentTypeIdentdef) == NULL)) {
Trees_SetType(Trees_NewLeaf(ARRAY), currentTypeIdentdef); /*incomplete type*/
}
(yyval.node) = (yyvsp[-1].node);
}
-#line 1873 "y.tab.c"
+#line 1862 "y.tab.c"
break;
case 20:
-#line 381 "Oberon.y"
+#line 378 "Oberon.y"
{
(yyval.node) = Trees_NewNode(TREES_NOSYM, (yyvsp[0].node), NULL);
}
-#line 1881 "y.tab.c"
+#line 1870 "y.tab.c"
break;
case 21:
-#line 385 "Oberon.y"
+#line 382 "Oberon.y"
{
(yyval.node) = Trees_NewNode(TREES_NOSYM, (yyvsp[0].node), (yyvsp[-2].node));
}
-#line 1889 "y.tab.c"
+#line 1878 "y.tab.c"
break;
case 22:
-#line 392 "Oberon.y"
+#line 389 "Oberon.y"
{
if (Types_IsInteger(Trees_Type((yyvsp[0].node)))) {
if (IsInteger((yyvsp[0].node))) {
YYABORT;
}
}
-#line 1910 "y.tab.c"
+#line 1899 "y.tab.c"
break;
case 23:
-#line 412 "Oberon.y"
+#line 409 "Oberon.y"
{
recordDeclarationStack = Trees_Right(recordDeclarationStack);
(yyval.node) = Types_NewRecord(Types_RecordBaseType((yyvsp[-2].node)), (yyvsp[-1].node));
}
-#line 1919 "y.tab.c"
+#line 1908 "y.tab.c"
break;
case 24:
-#line 420 "Oberon.y"
+#line 417 "Oberon.y"
{
(yyval.node) = Types_NewRecord((yyvsp[0].node), NULL);
if ((currentTypeIdentdef != NULL) && (Trees_Type(currentTypeIdentdef) == NULL)) {
}
recordDeclarationStack = Trees_NewNode(TREES_NOSYM, (yyval.node), recordDeclarationStack);
}
-#line 1931 "y.tab.c"
+#line 1920 "y.tab.c"
break;
case 25:
-#line 431 "Oberon.y"
+#line 428 "Oberon.y"
{
(yyval.node) = (yyvsp[-1].node);
}
-#line 1939 "y.tab.c"
+#line 1928 "y.tab.c"
break;
case 26:
-#line 435 "Oberon.y"
+#line 432 "Oberon.y"
{
(yyval.node) = NULL;
}
-#line 1947 "y.tab.c"
+#line 1936 "y.tab.c"
break;
case 27:
-#line 442 "Oberon.y"
+#line 439 "Oberon.y"
{
const char *name;
Trees_Node symbol;
YYABORT;
}
}
-#line 1989 "y.tab.c"
+#line 1978 "y.tab.c"
break;
case 28:
-#line 483 "Oberon.y"
+#line 480 "Oberon.y"
{
Trees_ReverseList(&(yyvsp[0].node)); /*correct order*/
(yyval.node) = (yyvsp[0].node);
}
-#line 1998 "y.tab.c"
+#line 1987 "y.tab.c"
break;
case 29:
-#line 488 "Oberon.y"
+#line 485 "Oberon.y"
{
(yyval.node) = NULL;
}
-#line 2006 "y.tab.c"
+#line 1995 "y.tab.c"
break;
case 30:
-#line 495 "Oberon.y"
+#line 492 "Oberon.y"
{
(yyval.node) = Trees_NewNode(TREES_FIELD_LIST_SEQUENCE, (yyvsp[0].node), NULL);
}
-#line 2014 "y.tab.c"
+#line 2003 "y.tab.c"
break;
case 31:
-#line 499 "Oberon.y"
+#line 496 "Oberon.y"
{
Trees_Node currSeq, currList, currSeqList;
const char *seqIdentName, *listIdentName;
}
(yyval.node) = Trees_NewNode(TREES_FIELD_LIST_SEQUENCE, (yyvsp[0].node), (yyvsp[-2].node));
}
-#line 2043 "y.tab.c"
+#line 2032 "y.tab.c"
break;
case 32:
-#line 527 "Oberon.y"
+#line 524 "Oberon.y"
{
Trees_Node type, tail, ident, p, directBaseType, baseTypeField, baseType;
YYABORT;
}
}
-#line 2093 "y.tab.c"
+#line 2082 "y.tab.c"
break;
case 33:
-#line 576 "Oberon.y"
+#line 573 "Oberon.y"
{
(yyval.node) = Trees_NewNode(TREES_IDENT_LIST, (yyvsp[0].node), NULL);
}
-#line 2101 "y.tab.c"
+#line 2090 "y.tab.c"
break;
case 34:
-#line 580 "Oberon.y"
+#line 577 "Oberon.y"
{
Trees_Node reversedIdents;
reversedIdents = Trees_NewNode(TREES_IDENT_LIST, (yyvsp[0].node), (yyvsp[-2].node));
(yyval.node) = reversedIdents;
}
-#line 2112 "y.tab.c"
+#line 2101 "y.tab.c"
break;
case 35:
-#line 590 "Oberon.y"
+#line 587 "Oberon.y"
{
const char *baseTypeName;
Trees_Node declaredBaseType;
YYABORT;
}
}
-#line 2148 "y.tab.c"
+#line 2137 "y.tab.c"
break;
case 36:
-#line 625 "Oberon.y"
+#line 622 "Oberon.y"
{
if ((currentTypeIdentdef != NULL) && (Trees_Type(currentTypeIdentdef) == NULL)) {
Trees_SetType(Types_NewPointer(NULL), currentTypeIdentdef); /*incomplete type*/
}
}
-#line 2158 "y.tab.c"
+#line 2147 "y.tab.c"
break;
case 37:
-#line 634 "Oberon.y"
+#line 631 "Oberon.y"
{
(yyval.node) = (yyvsp[0].node);
}
-#line 2166 "y.tab.c"
+#line 2155 "y.tab.c"
break;
case 38:
-#line 641 "Oberon.y"
+#line 638 "Oberon.y"
{
(yyval.node) = NULL;
}
-#line 2174 "y.tab.c"
+#line 2163 "y.tab.c"
break;
case 40:
-#line 649 "Oberon.y"
+#line 646 "Oberon.y"
{
(yyval.node) = Trees_NewLeaf(PROCEDURE);
}
-#line 2182 "y.tab.c"
+#line 2171 "y.tab.c"
break;
case 41:
-#line 659 "Oberon.y"
+#line 656 "Oberon.y"
{
Trees_Node type, identList, ident;
exit(EXIT_FAILURE);
}
}
-#line 2218 "y.tab.c"
+#line 2207 "y.tab.c"
break;
case 43:
-#line 698 "Oberon.y"
+#line 695 "Oberon.y"
{
Trees_Node expA, expB, typeA, typeB;
int op = (int) (yyvsp[-1].integer);
YYABORT;
}
}
-#line 2266 "y.tab.c"
+#line 2255 "y.tab.c"
break;
case 44:
-#line 745 "Oberon.y"
+#line 742 "Oberon.y"
{
(yyval.integer) = '=';
}
-#line 2274 "y.tab.c"
+#line 2263 "y.tab.c"
break;
case 45:
-#line 749 "Oberon.y"
+#line 746 "Oberon.y"
{
(yyval.integer) = '#';
}
-#line 2282 "y.tab.c"
+#line 2271 "y.tab.c"
break;
case 46:
-#line 753 "Oberon.y"
+#line 750 "Oberon.y"
{
(yyval.integer) = '<';
}
-#line 2290 "y.tab.c"
+#line 2279 "y.tab.c"
break;
case 47:
-#line 757 "Oberon.y"
+#line 754 "Oberon.y"
{
(yyval.integer) = LE;
}
-#line 2298 "y.tab.c"
+#line 2287 "y.tab.c"
break;
case 48:
-#line 761 "Oberon.y"
+#line 758 "Oberon.y"
{
(yyval.integer) = '>';
}
-#line 2306 "y.tab.c"
+#line 2295 "y.tab.c"
break;
case 49:
-#line 765 "Oberon.y"
+#line 762 "Oberon.y"
{
(yyval.integer) = GE;
}
-#line 2314 "y.tab.c"
+#line 2303 "y.tab.c"
break;
case 50:
-#line 769 "Oberon.y"
+#line 766 "Oberon.y"
{
- (yyval.integer) = IN;
+ (yyval.integer) = IS;
}
-#line 2322 "y.tab.c"
+#line 2311 "y.tab.c"
break;
case 51:
#line 773 "Oberon.y"
- {
- (yyval.integer) = IS;
- }
-#line 2330 "y.tab.c"
- break;
-
- case 52:
-#line 780 "Oberon.y"
{
int op = (int) (yyvsp[-1].integer);
(yyval.node) = (yyvsp[0].node);
}
}
}
-#line 2356 "y.tab.c"
+#line 2337 "y.tab.c"
break;
- case 53:
-#line 802 "Oberon.y"
+ case 52:
+#line 795 "Oberon.y"
{
int op = (int) (yyvsp[-1].integer);
}
assert((yyval.node) != NULL);
}
-#line 2386 "y.tab.c"
+#line 2367 "y.tab.c"
break;
- case 54:
-#line 831 "Oberon.y"
+ case 53:
+#line 824 "Oberon.y"
{
(yyval.integer) = '+';
}
-#line 2394 "y.tab.c"
+#line 2375 "y.tab.c"
break;
- case 55:
-#line 835 "Oberon.y"
+ case 54:
+#line 828 "Oberon.y"
{
(yyval.integer) = '-';
}
-#line 2402 "y.tab.c"
+#line 2383 "y.tab.c"
break;
- case 56:
-#line 839 "Oberon.y"
+ case 55:
+#line 832 "Oberon.y"
{
(yyval.integer) = -1;
}
-#line 2410 "y.tab.c"
+#line 2391 "y.tab.c"
break;
- case 57:
-#line 846 "Oberon.y"
+ case 56:
+#line 839 "Oberon.y"
{
(yyval.integer) = '+';
}
-#line 2418 "y.tab.c"
+#line 2399 "y.tab.c"
break;
- case 58:
-#line 850 "Oberon.y"
+ case 57:
+#line 843 "Oberon.y"
{
(yyval.integer) = '-';
}
-#line 2426 "y.tab.c"
+#line 2407 "y.tab.c"
break;
- case 59:
-#line 854 "Oberon.y"
+ case 58:
+#line 847 "Oberon.y"
{
(yyval.integer) = OR;
}
-#line 2434 "y.tab.c"
+#line 2415 "y.tab.c"
break;
- case 61:
-#line 862 "Oberon.y"
+ case 60:
+#line 855 "Oberon.y"
{
int op = (int) (yyvsp[-1].integer);
assert((yyval.node) != NULL);
}
-#line 2465 "y.tab.c"
+#line 2446 "y.tab.c"
break;
- case 62:
-#line 892 "Oberon.y"
+ case 61:
+#line 885 "Oberon.y"
{
(yyval.integer) = '*';
}
-#line 2473 "y.tab.c"
+#line 2454 "y.tab.c"
break;
- case 63:
-#line 896 "Oberon.y"
+ case 62:
+#line 889 "Oberon.y"
{
(yyval.integer) = '/';
}
-#line 2481 "y.tab.c"
+#line 2462 "y.tab.c"
break;
- case 64:
-#line 900 "Oberon.y"
+ case 63:
+#line 893 "Oberon.y"
{
(yyval.integer) = DIV;
}
-#line 2489 "y.tab.c"
+#line 2470 "y.tab.c"
break;
- case 65:
-#line 904 "Oberon.y"
+ case 64:
+#line 897 "Oberon.y"
{
(yyval.integer) = MOD;
}
-#line 2497 "y.tab.c"
+#line 2478 "y.tab.c"
break;
- case 66:
-#line 908 "Oberon.y"
+ case 65:
+#line 901 "Oberon.y"
{
(yyval.integer) = '&';
}
-#line 2505 "y.tab.c"
+#line 2486 "y.tab.c"
break;
- case 68:
-#line 916 "Oberon.y"
+ case 67:
+#line 909 "Oberon.y"
{
(yyval.node) = Trees_NewString((yyvsp[0].string));
}
-#line 2513 "y.tab.c"
+#line 2494 "y.tab.c"
break;
- case 69:
-#line 920 "Oberon.y"
+ case 68:
+#line 913 "Oberon.y"
{
(yyval.node) = Trees_NewLeaf(NIL);
Trees_SetType(Trees_NewLeaf(TREES_NIL_TYPE), (yyval.node));
}
-#line 2522 "y.tab.c"
+#line 2503 "y.tab.c"
break;
- case 70:
-#line 925 "Oberon.y"
+ case 69:
+#line 918 "Oberon.y"
{
(yyval.node) = Trees_NewBoolean(1);
}
-#line 2530 "y.tab.c"
+#line 2511 "y.tab.c"
break;
- case 71:
-#line 929 "Oberon.y"
+ case 70:
+#line 922 "Oberon.y"
{
(yyval.node) = Trees_NewBoolean(0);
}
-#line 2538 "y.tab.c"
+#line 2519 "y.tab.c"
break;
- case 72:
-#line 933 "Oberon.y"
- {
- (yyval.node) = (yyvsp[0].node);
- Trees_SetType(Trees_NewLeaf(TREES_SET_TYPE), (yyval.node));
- }
-#line 2547 "y.tab.c"
- break;
-
- case 73:
-#line 939 "Oberon.y"
+ case 71:
+#line 927 "Oberon.y"
{
const int isFunctionCall = 1;
Trees_Node designator, actualParameters, ident;
}
assert((yyval.node) != NULL);
}
-#line 2571 "y.tab.c"
+#line 2543 "y.tab.c"
break;
- case 74:
-#line 959 "Oberon.y"
+ case 72:
+#line 947 "Oberon.y"
{
CheckIsValueExpression((yyvsp[-1].node));
(yyval.node) = (yyvsp[-1].node);
}
-#line 2580 "y.tab.c"
+#line 2552 "y.tab.c"
break;
- case 75:
-#line 964 "Oberon.y"
+ case 73:
+#line 952 "Oberon.y"
{
(yyval.node) = NULL;
CheckIsValueExpression((yyvsp[0].node));
}
assert((yyval.node) != NULL);
}
-#line 2601 "y.tab.c"
+#line 2573 "y.tab.c"
break;
- case 76:
-#line 985 "Oberon.y"
+ case 74:
+#line 973 "Oberon.y"
{
Trees_Node designator, identType, actualParameters;
int parameterListFound; /*possibly empty*/
(yyval.node) = designator;
}
}
-#line 2622 "y.tab.c"
+#line 2594 "y.tab.c"
break;
- case 77:
-#line 1005 "Oberon.y"
+ case 75:
+#line 993 "Oberon.y"
{
Trees_Node curr;
(yyval.node) = Trees_NewNode(Trees_Symbol((yyvsp[0].node)), Trees_Left((yyvsp[0].node)), (yyvsp[-1].node));
}
}
-#line 2644 "y.tab.c"
+#line 2616 "y.tab.c"
break;
- case 78:
-#line 1023 "Oberon.y"
+ case 76:
+#line 1011 "Oberon.y"
{
(yyval.node) = NULL;
}
-#line 2652 "y.tab.c"
+#line 2624 "y.tab.c"
break;
- case 79:
-#line 1030 "Oberon.y"
+ case 77:
+#line 1018 "Oberon.y"
{
Trees_Node field;
Trees_SetKind(TREES_FIELD_KIND, field);
(yyval.node) = Trees_NewNode('.', field, NULL);
}
-#line 2664 "y.tab.c"
+#line 2636 "y.tab.c"
break;
- case 80:
-#line 1038 "Oberon.y"
+ case 78:
+#line 1026 "Oberon.y"
{
Trees_Node curr, exp;
curr = Trees_Right(curr);
} while (curr != NULL);
}
-#line 2686 "y.tab.c"
+#line 2658 "y.tab.c"
break;
- case 81:
-#line 1056 "Oberon.y"
+ case 79:
+#line 1044 "Oberon.y"
{
(yyval.node) = Trees_NewNode('^', NULL, NULL);
}
-#line 2694 "y.tab.c"
+#line 2666 "y.tab.c"
break;
- case 82:
-#line 1061 "Oberon.y"
+ case 80:
+#line 1049 "Oberon.y"
{
Trees_ReverseList(&(yyvsp[-1].node)); /*correct order*/
(yyval.node) = Trees_NewNode('(', (yyvsp[-1].node), NULL);
}
-#line 2703 "y.tab.c"
+#line 2675 "y.tab.c"
break;
- case 83:
-#line 1066 "Oberon.y"
+ case 81:
+#line 1054 "Oberon.y"
{
(yyval.node) = Trees_NewNode('(', NULL, NULL);
}
-#line 2711 "y.tab.c"
+#line 2683 "y.tab.c"
break;
- case 84:
-#line 1073 "Oberon.y"
- {
- (yyval.node) = Trees_NewSet(0x0u);
- }
-#line 2719 "y.tab.c"
- break;
-
- case 85:
-#line 1077 "Oberon.y"
- {
- (yyval.node) = (yyvsp[-1].node);
- }
-#line 2727 "y.tab.c"
- break;
-
- case 87:
-#line 1085 "Oberon.y"
- {
- if ((Trees_Symbol((yyvsp[-2].node)) == TREES_SET_CONSTANT)
- && (Trees_Symbol((yyvsp[0].node)) == TREES_SET_CONSTANT)) {
- (yyval.node) = Trees_NewSet(Trees_Set((yyvsp[-2].node)) | Trees_Set((yyvsp[0].node)));
- } else {
- (yyval.node) = Trees_NewNode('+', (yyvsp[-2].node), (yyvsp[0].node));
- Trees_SetType(Trees_NewLeaf(TREES_SET_TYPE), (yyval.node));
- }
- }
-#line 2741 "y.tab.c"
- break;
-
- case 88:
-#line 1098 "Oberon.y"
- {
- OBNC_INTEGER i;
- Trees_Node type;
-
- CheckIsValueExpression((yyvsp[0].node));
- (yyval.node) = NULL;
- type = Trees_Type((yyvsp[0].node));
- if (IsInteger((yyvsp[0].node))) {
- i = Trees_Integer((yyvsp[0].node));
- Range_CheckSetElement(i);
- (yyval.node) = Trees_NewSet(1u << i);
- } else if (Types_IsInteger(type)) {
- (yyval.node) = Trees_NewNode(TREES_SINGLE_ELEMENT_SET, (yyvsp[0].node), NULL);
- Trees_SetType(Trees_NewLeaf(TREES_SET_TYPE), (yyval.node));
- } else {
- Oberon_PrintError("error: element must have integer type");
- YYABORT;
- }
- }
-#line 2765 "y.tab.c"
- break;
-
- case 89:
-#line 1118 "Oberon.y"
- {
- CheckIsValueExpression((yyvsp[-2].node));
- CheckIsValueExpression((yyvsp[0].node));
- (yyval.node) = NULL;
- if (IsInteger((yyvsp[-2].node))) {
- Range_CheckSetElement(Trees_Integer((yyvsp[-2].node)));
- }
- if (IsInteger((yyvsp[0].node))) {
- Range_CheckSetElement(Trees_Integer((yyvsp[0].node)));
- }
- if (IsInteger((yyvsp[-2].node)) && IsInteger((yyvsp[0].node))) {
- (yyval.node) = Trees_NewSet(OBNC_RANGE(Trees_Integer((yyvsp[-2].node)), Trees_Integer((yyvsp[0].node))));
- } else if (Types_IsInteger(Trees_Type((yyvsp[-2].node))) && Types_IsInteger(Trees_Type((yyvsp[0].node)))) {
- (yyval.node) = Trees_NewNode(TREES_RANGE_SET, (yyvsp[-2].node), (yyvsp[0].node));
- Trees_SetType(Trees_NewLeaf(TREES_SET_TYPE), (yyval.node));
- } else {
- Oberon_PrintError("error: element must have integer type");
- YYABORT;
- }
- }
-#line 2790 "y.tab.c"
- break;
-
- case 90:
-#line 1142 "Oberon.y"
+ case 82:
+#line 1061 "Oberon.y"
{
(yyval.node) = Trees_NewNode(TREES_EXP_LIST, (yyvsp[0].node), NULL);
Trees_SetType(Trees_Type((yyvsp[0].node)), (yyval.node));
}
-#line 2799 "y.tab.c"
+#line 2692 "y.tab.c"
break;
- case 91:
-#line 1147 "Oberon.y"
+ case 83:
+#line 1066 "Oberon.y"
{
Trees_Node reversedList;
(yyval.node) = reversedList;
Trees_SetType(Trees_Type((yyvsp[0].node)), (yyval.node));
}
-#line 2811 "y.tab.c"
+#line 2704 "y.tab.c"
break;
- case 99:
-#line 1168 "Oberon.y"
+ case 91:
+#line 1087 "Oberon.y"
{
(yyval.node) = NULL;
}
-#line 2819 "y.tab.c"
+#line 2712 "y.tab.c"
break;
- case 100:
-#line 1175 "Oberon.y"
+ case 92:
+#line 1094 "Oberon.y"
{
Trees_Node designator, ident, designatorType, exp;
assert(0);
}
}
-#line 2862 "y.tab.c"
+#line 2755 "y.tab.c"
break;
- case 101:
-#line 1218 "Oberon.y"
+ case 93:
+#line 1137 "Oberon.y"
{
const int isFunctionCall = 0;
Trees_Node designator, actualParameters;
HandleProcedureCall(designator, actualParameters, isFunctionCall, &(yyval.node));
assert((yyval.node) != NULL);
}
-#line 2881 "y.tab.c"
+#line 2774 "y.tab.c"
break;
- case 102:
-#line 1236 "Oberon.y"
+ case 94:
+#line 1155 "Oberon.y"
{
Trees_ReverseList(&(yyvsp[0].node)); /*correct order*/
(yyval.node) = (yyvsp[0].node);
}
-#line 2890 "y.tab.c"
+#line 2783 "y.tab.c"
break;
- case 103:
-#line 1244 "Oberon.y"
+ case 95:
+#line 1163 "Oberon.y"
{
if ((yyvsp[0].node) == NULL) {
(yyval.node) = NULL;
(yyval.node) = Trees_NewNode(TREES_STATEMENT_SEQUENCE, (yyvsp[0].node), NULL);
}
}
-#line 2902 "y.tab.c"
+#line 2795 "y.tab.c"
break;
- case 104:
-#line 1252 "Oberon.y"
+ case 96:
+#line 1171 "Oberon.y"
{
if ((yyvsp[0].node) != NULL) {
(yyval.node) = Trees_NewNode(TREES_STATEMENT_SEQUENCE, (yyvsp[0].node), (yyvsp[-2].node));
(yyval.node) = (yyvsp[-2].node);
}
}
-#line 2914 "y.tab.c"
+#line 2807 "y.tab.c"
break;
- case 105:
-#line 1263 "Oberon.y"
+ case 97:
+#line 1182 "Oberon.y"
{
Trees_Node currElsif, currExp, currThen, currStmt;
(yyval.node) = Trees_NewNode(IF, (yyvsp[-5].node), Trees_NewNode(THEN, (yyvsp[-3].node), (yyval.node)));
}
}
-#line 2938 "y.tab.c"
+#line 2831 "y.tab.c"
break;
- case 106:
-#line 1286 "Oberon.y"
+ case 98:
+#line 1205 "Oberon.y"
{
CheckIsValueExpression((yyvsp[0].node));
if (Types_IsBoolean(Trees_Type((yyvsp[0].node)))) {
YYABORT;
}
}
-#line 2952 "y.tab.c"
+#line 2845 "y.tab.c"
break;
- case 107:
-#line 1299 "Oberon.y"
+ case 99:
+#line 1218 "Oberon.y"
{
(yyval.node) = Trees_NewNode(ELSIF, (yyvsp[-2].node), Trees_NewNode(THEN, (yyvsp[0].node), (yyvsp[-4].node)));
}
-#line 2960 "y.tab.c"
+#line 2853 "y.tab.c"
break;
- case 108:
-#line 1303 "Oberon.y"
+ case 100:
+#line 1222 "Oberon.y"
{
(yyval.node) = NULL;
}
-#line 2968 "y.tab.c"
+#line 2861 "y.tab.c"
break;
- case 109:
-#line 1310 "Oberon.y"
+ case 101:
+#line 1229 "Oberon.y"
{
(yyval.node) = Trees_NewNode(ELSE, (yyvsp[0].node), NULL);
}
-#line 2976 "y.tab.c"
+#line 2869 "y.tab.c"
break;
- case 110:
-#line 1314 "Oberon.y"
+ case 102:
+#line 1233 "Oberon.y"
{
(yyval.node) = NULL;
}
-#line 2984 "y.tab.c"
+#line 2877 "y.tab.c"
break;
- case 111:
-#line 1321 "Oberon.y"
+ case 103:
+#line 1240 "Oberon.y"
{
Trees_Node expType, caseVariable;
}
(yyval.node) = Trees_NewNode(CASE, (yyvsp[-3].node), (yyvsp[-1].node));
}
-#line 3006 "y.tab.c"
+#line 2899 "y.tab.c"
break;
- case 112:
-#line 1342 "Oberon.y"
+ case 104:
+#line 1261 "Oberon.y"
{
Trees_Node typeStruct, caseVariable;
YYABORT;
}
}
-#line 3045 "y.tab.c"
+#line 2938 "y.tab.c"
break;
- case 113:
-#line 1380 "Oberon.y"
+ case 105:
+#line 1299 "Oberon.y"
{
if ((yyvsp[0].node) != NULL) {
(yyval.node) = Trees_NewNode(TREES_CASE_REP, (yyvsp[0].node), NULL);
(yyval.node) = NULL;
}
}
-#line 3057 "y.tab.c"
+#line 2950 "y.tab.c"
break;
- case 114:
-#line 1388 "Oberon.y"
+ case 106:
+#line 1307 "Oberon.y"
{
if ((yyvsp[0].node) != NULL) {
if ((yyvsp[-2].node) != NULL) {
(yyval.node) = NULL;
}
}
-#line 3073 "y.tab.c"
+#line 2966 "y.tab.c"
break;
- case 115:
-#line 1403 "Oberon.y"
+ case 107:
+#line 1322 "Oberon.y"
{
Trees_ReverseList(&(yyvsp[-2].node)); /*correct order*/
(yyval.node) = Trees_NewNode(TREES_CASE, (yyvsp[-2].node), (yyvsp[0].node));
}
-#line 3082 "y.tab.c"
+#line 2975 "y.tab.c"
break;
- case 116:
-#line 1408 "Oberon.y"
+ case 108:
+#line 1327 "Oberon.y"
{
(yyval.node) = NULL;
}
-#line 3090 "y.tab.c"
+#line 2983 "y.tab.c"
break;
- case 117:
-#line 1415 "Oberon.y"
+ case 109:
+#line 1334 "Oberon.y"
{
(yyval.node) = Trees_NewNode(TREES_CASE_LABEL_LIST, (yyvsp[0].node), NULL);
}
-#line 3098 "y.tab.c"
+#line 2991 "y.tab.c"
break;
- case 118:
-#line 1419 "Oberon.y"
+ case 110:
+#line 1338 "Oberon.y"
{
switch (Trees_Symbol((yyvsp[0].node))) {
case INTEGER:
YYABORT;
}
}
-#line 3115 "y.tab.c"
+#line 3008 "y.tab.c"
break;
- case 119:
-#line 1435 "Oberon.y"
+ case 111:
+#line 1354 "Oberon.y"
{
(yyval.node) = (yyvsp[0].node);
CheckCaseLabelUniqueness((yyvsp[0].node));
Trees_NewNode(TREES_NOSYM, (yyvsp[0].node), Trees_Left(caseLabelsStack)),
Trees_Right(caseLabelsStack));
}
-#line 3128 "y.tab.c"
+#line 3021 "y.tab.c"
break;
- case 120:
-#line 1444 "Oberon.y"
+ case 112:
+#line 1363 "Oberon.y"
{
const int rangeLenMax = 255;
int leftSym, rightSym;
Trees_NewNode(TREES_NOSYM, (yyval.node), Trees_Left(caseLabelsStack)),
Trees_Right(caseLabelsStack));
}
-#line 3176 "y.tab.c"
+#line 3069 "y.tab.c"
break;
- case 121:
-#line 1491 "Oberon.y"
+ case 113:
+#line 1410 "Oberon.y"
{
if (Types_IsInteger(Trees_Type(Trees_Left(caseExpressionStack)))) {
(yyval.node) = Trees_NewInteger((yyvsp[0].integer));
YYABORT;
}
}
-#line 3189 "y.tab.c"
+#line 3082 "y.tab.c"
break;
- case 122:
-#line 1500 "Oberon.y"
+ case 114:
+#line 1419 "Oberon.y"
{
if (Types_IsChar(Trees_Type(Trees_Left(caseExpressionStack)))) {
if (strlen((yyvsp[0].string)) <= 1) {
YYABORT;
}
}
-#line 3207 "y.tab.c"
+#line 3100 "y.tab.c"
break;
- case 123:
-#line 1514 "Oberon.y"
+ case 115:
+#line 1433 "Oberon.y"
{
Trees_Node caseExp, constValue, caseVariable;
YYABORT;
}
}
-#line 3293 "y.tab.c"
+#line 3186 "y.tab.c"
break;
- case 124:
-#line 1599 "Oberon.y"
+ case 116:
+#line 1518 "Oberon.y"
{
(yyval.node) = Trees_NewNode(WHILE, (yyvsp[-4].node), Trees_NewNode(DO, (yyvsp[-2].node), (yyvsp[-1].node)));
}
-#line 3301 "y.tab.c"
+#line 3194 "y.tab.c"
break;
- case 125:
-#line 1606 "Oberon.y"
+ case 117:
+#line 1525 "Oberon.y"
{
(yyval.node) = Trees_NewNode(ELSIF, (yyvsp[-2].node), Trees_NewNode(THEN, (yyvsp[0].node), (yyvsp[-4].node)));
}
-#line 3309 "y.tab.c"
+#line 3202 "y.tab.c"
break;
- case 126:
-#line 1610 "Oberon.y"
+ case 118:
+#line 1529 "Oberon.y"
{
(yyval.node) = NULL;
}
-#line 3317 "y.tab.c"
+#line 3210 "y.tab.c"
break;
- case 127:
-#line 1617 "Oberon.y"
+ case 119:
+#line 1536 "Oberon.y"
{
CheckIsValueExpression((yyvsp[0].node));
(yyval.node) = NULL;
YYABORT;
}
}
-#line 3332 "y.tab.c"
+#line 3225 "y.tab.c"
break;
- case 128:
-#line 1632 "Oberon.y"
+ case 120:
+#line 1551 "Oberon.y"
{
Trees_Node byExp;
(yyvsp[-4].node),
Trees_NewNode(BY, byExp, (yyvsp[-1].node))));
}
-#line 3351 "y.tab.c"
+#line 3244 "y.tab.c"
break;
- case 129:
-#line 1650 "Oberon.y"
+ case 121:
+#line 1569 "Oberon.y"
{
Trees_Node ctrlVar, ctrlVarType;
YYABORT;
}
}
-#line 3379 "y.tab.c"
+#line 3272 "y.tab.c"
break;
- case 130:
-#line 1676 "Oberon.y"
+ case 122:
+#line 1595 "Oberon.y"
{
CheckIsValueExpression((yyvsp[0].node));
if (! Types_IsInteger(Trees_Type((yyvsp[0].node)))) {
YYABORT;
}
}
-#line 3391 "y.tab.c"
+#line 3284 "y.tab.c"
break;
- case 131:
-#line 1687 "Oberon.y"
+ case 123:
+#line 1606 "Oberon.y"
{
if (Types_IsInteger(Trees_Type((yyvsp[0].node)))) {
if (IsInteger((yyvsp[0].node))) {
YYABORT;
}
}
-#line 3412 "y.tab.c"
+#line 3305 "y.tab.c"
break;
- case 132:
-#line 1704 "Oberon.y"
+ case 124:
+#line 1623 "Oberon.y"
{
(yyval.node) = NULL;
}
-#line 3420 "y.tab.c"
+#line 3313 "y.tab.c"
break;
- case 133:
-#line 1714 "Oberon.y"
+ case 125:
+#line 1633 "Oberon.y"
{
Trees_Node procIdent, procType, resultType, procStatements, returnExp;
const char *procName;
YYABORT;
}
}
-#line 3471 "y.tab.c"
+#line 3364 "y.tab.c"
break;
- case 134:
-#line 1764 "Oberon.y"
+ case 126:
+#line 1683 "Oberon.y"
{
Trees_Node paramList, param;
Generate_ProcedureHeading((yyvsp[-1].node));
(yyval.node) = (yyvsp[-1].node);
}
-#line 3493 "y.tab.c"
+#line 3386 "y.tab.c"
break;
- case 135:
-#line 1785 "Oberon.y"
+ case 127:
+#line 1704 "Oberon.y"
{
if (! (Trees_Exported((yyvsp[0].node)) && Trees_Local((yyvsp[0].node)))) {
Trees_SetKind(TREES_PROCEDURE_KIND, (yyvsp[0].node));
}
(yyval.node) = (yyvsp[0].node);
}
-#line 3509 "y.tab.c"
+#line 3402 "y.tab.c"
break;
- case 136:
-#line 1800 "Oberon.y"
+ case 128:
+#line 1719 "Oberon.y"
{
(yyval.node) = (yyvsp[0].node);
}
-#line 3517 "y.tab.c"
+#line 3410 "y.tab.c"
break;
- case 137:
-#line 1804 "Oberon.y"
+ case 129:
+#line 1723 "Oberon.y"
{
(yyval.node) = NULL;
}
-#line 3525 "y.tab.c"
+#line 3418 "y.tab.c"
break;
- case 138:
-#line 1811 "Oberon.y"
+ case 130:
+#line 1730 "Oberon.y"
{
(yyval.node) = (yyvsp[0].node);
}
-#line 3533 "y.tab.c"
+#line 3426 "y.tab.c"
break;
- case 139:
-#line 1815 "Oberon.y"
+ case 131:
+#line 1734 "Oberon.y"
{
(yyval.node) = NULL;
}
-#line 3541 "y.tab.c"
+#line 3434 "y.tab.c"
break;
- case 145:
-#line 1836 "Oberon.y"
+ case 137:
+#line 1755 "Oberon.y"
{
Trees_Node unresolvedPointerType, undeclaredBaseType;
YYABORT;
}
}
-#line 3556 "y.tab.c"
+#line 3449 "y.tab.c"
break;
- case 146:
-#line 1847 "Oberon.y"
+ case 138:
+#line 1766 "Oberon.y"
{
(yyval.node) = NULL;
}
-#line 3564 "y.tab.c"
+#line 3457 "y.tab.c"
break;
- case 147:
-#line 1854 "Oberon.y"
+ case 139:
+#line 1773 "Oberon.y"
{
unresolvedPointerTypes = NULL;
}
-#line 3572 "y.tab.c"
+#line 3465 "y.tab.c"
break;
- case 156:
-#line 1881 "Oberon.y"
+ case 148:
+#line 1800 "Oberon.y"
{
(yyval.node) = Types_NewProcedure((yyvsp[-2].node), (yyvsp[0].node));
}
-#line 3580 "y.tab.c"
+#line 3473 "y.tab.c"
break;
- case 157:
-#line 1888 "Oberon.y"
+ case 149:
+#line 1807 "Oberon.y"
{
Trees_ReverseList(&(yyvsp[0].node)); /*correct order*/
(yyval.node) = (yyvsp[0].node);
}
-#line 3589 "y.tab.c"
+#line 3482 "y.tab.c"
break;
- case 158:
-#line 1893 "Oberon.y"
+ case 150:
+#line 1812 "Oberon.y"
{
(yyval.node) = NULL;
}
-#line 3597 "y.tab.c"
+#line 3490 "y.tab.c"
break;
- case 159:
-#line 1900 "Oberon.y"
+ case 151:
+#line 1819 "Oberon.y"
{
(yyval.node) = (yyvsp[0].node);
Trees_ReverseList(&(yyval.node));
}
-#line 3606 "y.tab.c"
+#line 3499 "y.tab.c"
break;
- case 160:
-#line 1905 "Oberon.y"
+ case 152:
+#line 1824 "Oberon.y"
{
Trees_Node p, p1;
const char *paramName, *paramName1;
} while (p != NULL);
/*$$ in reversed order*/
}
-#line 3640 "y.tab.c"
+#line 3533 "y.tab.c"
break;
- case 161:
-#line 1938 "Oberon.y"
+ case 153:
+#line 1857 "Oberon.y"
{
(yyval.node) = ResolvedType((yyvsp[0].node), 0);
if ((yyval.node) != NULL) {
YYABORT;
}
}
-#line 3663 "y.tab.c"
+#line 3556 "y.tab.c"
break;
- case 162:
-#line 1957 "Oberon.y"
+ case 154:
+#line 1876 "Oberon.y"
{
(yyval.node) = NULL;
}
-#line 3671 "y.tab.c"
+#line 3564 "y.tab.c"
break;
- case 163:
-#line 1964 "Oberon.y"
+ case 155:
+#line 1883 "Oberon.y"
{
Trees_Node curr, ident;
(yyval.node) = (yyvsp[-2].node);
}
-#line 3691 "y.tab.c"
+#line 3584 "y.tab.c"
break;
- case 164:
-#line 1983 "Oberon.y"
+ case 156:
+#line 1902 "Oberon.y"
{
(yyval.integer) = TREES_VAR_PARAM_KIND;
}
-#line 3699 "y.tab.c"
+#line 3592 "y.tab.c"
break;
- case 165:
-#line 1987 "Oberon.y"
+ case 157:
+#line 1906 "Oberon.y"
{
(yyval.integer) = TREES_VALUE_PARAM_KIND;
}
-#line 3707 "y.tab.c"
+#line 3600 "y.tab.c"
break;
- case 166:
-#line 1994 "Oberon.y"
+ case 158:
+#line 1913 "Oberon.y"
{
(yyval.node) = Trees_NewNode(TREES_IDENT_LIST, Trees_NewIdent((yyvsp[0].ident)), NULL);
}
-#line 3715 "y.tab.c"
+#line 3608 "y.tab.c"
break;
- case 167:
-#line 1998 "Oberon.y"
+ case 159:
+#line 1917 "Oberon.y"
{
Trees_Node curr;
const char *identName;
(yyval.node) = Trees_NewNode(TREES_IDENT_LIST, Trees_NewIdent((yyvsp[0].ident)), (yyvsp[-2].node));
}
-#line 3737 "y.tab.c"
+#line 3630 "y.tab.c"
break;
- case 168:
-#line 2019 "Oberon.y"
+ case 160:
+#line 1938 "Oberon.y"
{
(yyval.node) = ResolvedType((yyvsp[0].node), 0);
if ((yyval.node) != NULL) {
exit(EXIT_FAILURE);
}
}
-#line 3754 "y.tab.c"
+#line 3647 "y.tab.c"
break;
- case 169:
-#line 2035 "Oberon.y"
+ case 161:
+#line 1954 "Oberon.y"
{
(yyval.node) = Trees_NewNode(ARRAY, NULL, (yyvsp[-2].node));
}
-#line 3762 "y.tab.c"
+#line 3655 "y.tab.c"
break;
- case 170:
-#line 2039 "Oberon.y"
+ case 162:
+#line 1958 "Oberon.y"
{
(yyval.node) = NULL;
}
-#line 3770 "y.tab.c"
+#line 3663 "y.tab.c"
break;
- case 171:
-#line 2049 "Oberon.y"
+ case 163:
+#line 1968 "Oberon.y"
{
const char *symfilePath;
YYABORT;
}
}
-#line 3797 "y.tab.c"
+#line 3690 "y.tab.c"
break;
- case 172:
-#line 2076 "Oberon.y"
+ case 164:
+#line 1995 "Oberon.y"
{
if (strcmp((yyvsp[0].ident), inputModuleName) == 0) {
if (parseMode != OBERON_IMPORT_LIST_MODE) {
YYABORT;
}
}
-#line 3812 "y.tab.c"
+#line 3705 "y.tab.c"
break;
- case 173:
-#line 2090 "Oberon.y"
+ case 165:
+#line 2009 "Oberon.y"
{
if (parseMode == OBERON_IMPORT_LIST_MODE) {
YYACCEPT;
}
}
-#line 3822 "y.tab.c"
+#line 3715 "y.tab.c"
break;
- case 174:
-#line 2096 "Oberon.y"
+ case 166:
+#line 2015 "Oberon.y"
{
if (parseMode == OBERON_IMPORT_LIST_MODE) {
YYACCEPT;
}
}
-#line 3832 "y.tab.c"
+#line 3725 "y.tab.c"
break;
- case 175:
-#line 2105 "Oberon.y"
+ case 167:
+#line 2024 "Oberon.y"
{
const char *impfilePath;
Trees_Node moduleAndDirPath, module, p;
}
}
}
-#line 3869 "y.tab.c"
+#line 3762 "y.tab.c"
break;
- case 176:
-#line 2141 "Oberon.y"
+ case 168:
+#line 2060 "Oberon.y"
{
if ((yyvsp[0].node) != NULL) {
(yyval.node) = Trees_NewNode(TREES_NOSYM, (yyvsp[0].node), NULL);
(yyval.node) = NULL;
}
}
-#line 3881 "y.tab.c"
+#line 3774 "y.tab.c"
break;
- case 177:
-#line 2149 "Oberon.y"
+ case 169:
+#line 2068 "Oberon.y"
{
if ((yyvsp[0].node) != NULL) {
(yyval.node) = Trees_NewNode(TREES_NOSYM, (yyvsp[0].node), (yyvsp[-2].node));
(yyval.node) = (yyvsp[-2].node);
}
}
-#line 3893 "y.tab.c"
+#line 3786 "y.tab.c"
break;
- case 178:
-#line 2160 "Oberon.y"
+ case 170:
+#line 2079 "Oberon.y"
{
static Maps_Map importedModules = NULL;
const char *module, *qualifier, *symbolFileDir, *symbolFileName, *moduleDirPath;
YYABORT;
}
}
-#line 3969 "y.tab.c"
+#line 3862 "y.tab.c"
break;
- case 179:
-#line 2235 "Oberon.y"
+ case 171:
+#line 2154 "Oberon.y"
{
(yyval.ident) = (yyvsp[0].ident);
}
-#line 3977 "y.tab.c"
+#line 3870 "y.tab.c"
break;
- case 180:
-#line 2239 "Oberon.y"
+ case 172:
+#line 2158 "Oberon.y"
{
(yyval.ident) = NULL;
}
-#line 3985 "y.tab.c"
+#line 3878 "y.tab.c"
break;
- case 181:
-#line 2246 "Oberon.y"
+ case 173:
+#line 2165 "Oberon.y"
{
Generate_ModuleStatements((yyvsp[0].node));
}
-#line 3993 "y.tab.c"
+#line 3886 "y.tab.c"
break;
-#line 3997 "y.tab.c"
+#line 3890 "y.tab.c"
default: break;
}
#endif
return yyresult;
}
-#line 2251 "Oberon.y"
+#line 2170 "Oberon.y"
void Oberon_Init(void)
}
-static int IsSet(Trees_Node node)
-{
- return Trees_Symbol(node) == TREES_SET_CONSTANT;
-}
-
-
/*functions for type declaration productions*/
static Trees_Node ResolvedType(Trees_Node type, int isTypeDecl)
case TREES_BYTE_TYPE:
result = Util_String("BYTE");
break;
- case TREES_SET_TYPE:
- result = Util_String("SET");
- break;
case ARRAY:
if (Types_IsOpenArray(type)) {
result = Util_String("open array type");
case TREES_CHAR_CONSTANT:
case INTEGER:
case REAL:
- case TREES_SET_CONSTANT:
case NIL:
case TREES_SIZE_PROC: /*type sizes cannot always be evaluated in the Oberon-to-C translation*/
result = 1;
result = Trees_NewLeaf((Trees_Real(expA) == Trees_Real(expB))? TRUE: FALSE);
}
break;
- case TREES_SET_CONSTANT:
- if (IsSet(expB)) {
- result = Trees_NewLeaf((Trees_Set(expA) == Trees_Set(expB))? TRUE: FALSE);
- }
- break;
case STRING:
if (IsChar(expB)) {
result = Trees_NewLeaf((Trees_String(expA)[0] == Trees_Char(expB))? TRUE: FALSE);
result = Trees_NewLeaf((Trees_Real(expA) != Trees_Real(expB))? TRUE: FALSE);
}
break;
- case TREES_SET_CONSTANT:
- if (IsSet(expB)) {
- result = Trees_NewLeaf((Trees_Set(expA) != Trees_Set(expB))? TRUE: FALSE);
- }
- break;
case STRING:
if (IsChar(expB)) {
result = Trees_NewLeaf((Trees_String(expA)[0] != Trees_Char(expB))? TRUE: FALSE);
break;
}
break;
- case IN:
- if (IsInteger(expA)) {
- Range_CheckSetElement(Trees_Integer(expA));
- if (IsSet(expB)) {
- result = Trees_NewLeaf(OBNC_IN(Trees_Integer(expA), Trees_Set(expB))? TRUE: FALSE);
- }
- }
- break;
}
if (result != NULL) {
Trees_SetType(Trees_NewLeaf(TREES_BOOLEAN_TYPE), result);
result = Trees_NewReal(Trees_Real(expA) + Trees_Real(expB));
}
break;
- case TREES_SET_CONSTANT:
- if (expB == NULL) {
- result = expA;
- } else if (IsSet(expB)) {
- result = Trees_NewSet(Trees_Set(expA) | Trees_Set(expB));
- }
- break;
}
break;
case '-':
result = Trees_NewReal(Trees_Real(expA) - Trees_Real(expB));
}
break;
- case TREES_SET_CONSTANT:
- if (expB == NULL) {
- result = Trees_NewSet(~Trees_Set(expA));
- } else if (IsSet(expB)) {
- result = Trees_NewSet(Trees_Set(expA) & ~Trees_Set(expB));
- }
- break;
}
break;
case OR:
result = Trees_NewReal(Trees_Real(expA) * Trees_Real(expB));
}
break;
- case TREES_SET_CONSTANT:
- if (IsSet(expB)) {
- result = Trees_NewSet(Trees_Set(expA) & Trees_Set(expB));
- }
- break;
}
break;
case '/':
}
}
break;
- case TREES_SET_CONSTANT:
- if (IsSet(expB)) {
- result = Trees_NewSet(Trees_Set(expA) ^ Trees_Set(expB));
- }
- break;
}
break;
case DIV:
case GE:
result = ">=";
break;
- case IN:
- result = "IN";
- break;
case IS:
result = "IS";
break;
case TREES_BYTE_TYPE:
result = sizeof (unsigned char);
break;
- case TREES_SET_TYPE:
- result = sizeof (unsigned OBNC_INTEGER);
- break;
case ARRAY:
result = Trees_Integer(Types_ArrayLength(type)) * TypeSize(Types_ElementType(type));
break;
resultType = paramTypes[0];
}
break;
- case TREES_ODD_PROC:
- ValidateProcedureKind(procName, 1, isFunctionCall);
- ValidateParameterCount(procName, 1, 1, paramCount);
- ValidateValueParameter(procName, param[0], 0);
- ValidateIntegerParameter(procName, param[0], 0);
- if (IsInteger(param[0])) {
- result = Trees_NewBoolean(OBNC_ODD(Trees_Integer(param[0])));
- } else {
- resultType = Trees_NewLeaf(TREES_BOOLEAN_TYPE);
- }
- break;
case TREES_LEN_PROC:
ValidateProcedureKind(procName, 1, isFunctionCall);
ValidateParameterCount(procName, 1, 1, paramCount);
exit(EXIT_FAILURE);
}
break;
- case TREES_LSL_PROC: /*fall through*/
- case TREES_ASR_PROC: /*fall through*/
- case TREES_ROR_PROC:
- ValidateProcedureKind(procName, 1, isFunctionCall);
- ValidateParameterCount(procName, 2, 2, paramCount);
- ValidateValueParameter(procName, param[0], 0);
- ValidateIntegerParameter(procName, param[0], 0);
- ValidateValueParameter(procName, param[1], 1);
- ValidateIntegerParameter(procName, param[1], 1);
- if (IsInteger(param[1])) {
- switch (symbol) {
- case TREES_LSL_PROC:
- Range_CheckLSL(Trees_Integer(param[1]));
- break;
- case TREES_ASR_PROC:
- Range_CheckASR(Trees_Integer(param[1]));
- break;
- case TREES_ROR_PROC:
- Range_CheckROR(Trees_Integer(param[1]));
- break;
- default:
- assert(0);
- }
- }
- if (IsInteger(param[0]) && IsInteger(param[1])) {
- switch (symbol) {
- case TREES_LSL_PROC:
- result = Trees_NewInteger(OBNC_LSL(Trees_Integer(param[0]), Trees_Integer(param[1])));
- break;
- case TREES_ASR_PROC:
- result = Trees_NewInteger(OBNC_ASR(Trees_Integer(param[0]), Trees_Integer(param[1])));
- break;
- case TREES_ROR_PROC:
- result = Trees_NewInteger(OBNC_ROR(Trees_Integer(param[0]), Trees_Integer(param[1])));
- break;
- default:
- assert(0);
- }
- }
- if (result == NULL) {
- resultType = paramTypes[0];
- }
- break;
case TREES_FLOOR_PROC:
ValidateProcedureKind(procName, 1, isFunctionCall);
ValidateParameterCount(procName, 1, 1, paramCount);
result = Trees_NewInteger(0);
}
break;
- case TREES_SET_TYPE:
- if (IsSet(param[0])) {
- result = Trees_NewInteger((OBNC_INTEGER) Trees_Set(param[0]));
- }
- break;
default:
Oberon_PrintError("error: character parameter expected: %s", procName);
exit(EXIT_FAILURE);
ValidateIntegerParameter(procName, param[1], 1);
}
break;
- case TREES_INCL_PROC: /*fall through*/
- case TREES_EXCL_PROC:
- ValidateProcedureKind(procName, 0, isFunctionCall);
- ValidateParameterCount(procName, 1, 2, paramCount);
- ValidateVariableParameter(procName, param[0], 0);
- ValidateValueParameter(procName, param[1], 1);
- if (Types_IsSet(paramTypes[0])) {
- if (IsInteger(param[1])) {
- Range_CheckSetElement(Trees_Integer(param[1]));
- } else {
- ValidateIntegerParameter(procName, param[1], 1);
- }
- } else {
- Oberon_PrintError("error: set expected in substitution of parameter 1: %s", procName);
- exit(EXIT_FAILURE);
- }
- break;
case TREES_ASSERT_PROC:
ValidateProcedureKind(procName, 0, isFunctionCall);
ValidateParameterCount(procName, 1, 1, paramCount);
exit(EXIT_FAILURE);
}
break;
- case TREES_PACK_PROC:
- ValidateProcedureKind(procName, 0, isFunctionCall);
- ValidateParameterCount(procName, 2, 2, paramCount);
- ValidateVariableParameter(procName, param[0], 0);
- ValidateRealParameter(procName, param[0], 0);
- ValidateValueParameter(procName, param[1], 1);
- ValidateIntegerParameter(procName, param[1], 1);
- break;
- case TREES_UNPK_PROC:
- ValidateProcedureKind(procName, 0, isFunctionCall);
- ValidateParameterCount(procName, 2, 2, paramCount);
- ValidateVariableParameter(procName, param[0], 0);
- ValidateRealParameter(procName, param[0], 0);
- ValidateVariableParameter(procName, param[1], 1);
- ValidateIntegerParameter(procName, param[1], 1);
- break;
case TREES_ADR_PROC:
ValidateProcedureKind(procName, 1, isFunctionCall);
ValidateParameterCount(procName, 1, 1, paramCount);