⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 y.tab.c

📁 用YACC写的语法分析器
💻 C
📖 第 1 页 / 共 4 页
字号:
#ifndef lint
static char const 
yyrcsid[] = "$FreeBSD: src/usr.bin/yacc/skeleton.c,v 1.28 2000/01/17 02:04:06 bde Exp $";
#endif
#include <stdlib.h>
#define YYBYACC 1
#define YYMAJOR 1
#define YYMINOR 9
#define YYLEX yylex()
#define YYEMPTY -1
#define yyclearin (yychar=(YYEMPTY))
#define yyerrok (yyerrflag=0)
#define YYRECOVERING() (yyerrflag!=0)
static int yygrowstack();
#define YYPREFIX "yy"
#line 2 "pascal.y.txt"
/*
 * grammar.y
 *
 * Pascal grammar in Yacc format, based originally on BNF given
 * in "Standard Pascal -- User Reference Manual", by Doug Cooper.
 * This in turn is the BNF given by the ANSI and ISO Pascal standards,
 * and so, is PUBLIC DOMAIN. The grammar is for ISO Level 0 Pascal.
 * The grammar has been massaged somewhat to make it LALR, and added
 * the following extensions.
 *
 * constant expressions
 * otherwise statement in a case
 * productions to correctly match else's with if's
 * beginnings of a separate compilation facility
 */

#line 34 "y.tab.c"
#define YYERRCODE 256
#define AND 257
#define ARRAY 258
#define ASSIGNMENT 259
#define CASE 260
#define CHARACTER_STRING 261
#define COLON 262
#define COMMA 263
#define CONST 264
#define DIGSEQ 265
#define DIV 266
#define DO 267
#define DOT 268
#define DOTDOT 269
#define DOWNTO 270
#define ELSE 271
#define END 272
#define EQUAL 273
#define EXTERNAL 274
#define FOR 275
#define FORWARD 276
#define FUNCTION 277
#define GE 278
#define GOTO 279
#define GT 280
#define IDENTIFIER 281
#define IF 282
#define IN 283
#define LABEL 284
#define LBRAC 285
#define LE 286
#define LPAREN 287
#define LT 288
#define MINUS 289
#define MOD 290
#define NIL 291
#define NOT 292
#define NOTEQUAL 293
#define OF 294
#define OR 295
#define OTHERWISE 296
#define PACKED 297
#define PBEGIN 298
#define PFILE 299
#define PLUS 300
#define PROCEDURE 301
#define PROGRAM 302
#define RBRAC 303
#define REALNUMBER 304
#define RECORD 305
#define REPEAT 306
#define RPAREN 307
#define SEMICOLON 308
#define SET 309
#define SLASH 310
#define STAR 311
#define STARSTAR 312
#define THEN 313
#define TO 314
#define TYPE 315
#define UNTIL 316
#define UPARROW 317
#define VAR 318
#define WHILE 319
#define WITH 320
const short yylhs[] = {                                        -1,
    0,    0,    1,    3,    3,    7,    7,    5,    2,    9,
    9,   15,   15,   16,   10,   10,   17,   17,   18,   19,
   19,   20,   20,   22,   22,   24,   24,   27,   27,   28,
   28,   28,   28,   30,   30,   30,   26,   26,   31,   31,
   31,   11,   11,   32,   32,   33,   34,   34,   35,   35,
   35,   36,   36,   39,   40,   37,   37,   41,   41,   41,
   41,   42,   46,   46,   48,   49,   49,   47,   43,   43,
   43,   50,   50,   52,   51,   51,   51,   53,   53,   54,
   54,   57,   57,   57,   58,   58,   59,   59,   55,   56,
   44,   60,   45,   38,   61,   12,   12,   62,   62,   63,
   13,   13,   64,   64,   65,   65,   66,   66,   68,   68,
   69,   69,   72,   73,   73,   74,   74,   74,   74,   75,
   76,   77,   78,   71,   70,   67,   67,   67,   79,   79,
   82,   80,   81,   14,   83,   84,   84,   85,   85,   86,
   86,   87,   87,   89,   89,   89,   89,   89,   89,   89,
   89,   89,   89,   89,   88,   88,   88,   88,   94,  101,
   97,  102,   98,   99,   95,  100,  100,   96,   90,  109,
  109,  109,  109,  111,  113,  113,  114,  112,   91,   91,
  115,  116,  116,  117,  117,  117,   92,   93,   93,   93,
   93,  118,  119,  119,  121,  120,  120,  104,  105,  106,
  106,  107,  108,  108,  103,  110,  110,  122,  122,  123,
  123,  124,  124,  125,  125,  126,  126,  126,  126,  126,
  126,   29,   29,   29,  129,  129,  130,  131,  127,  128,
  128,  132,  132,  133,  133,   23,   23,   23,   25,   25,
   25,   25,   25,   21,   21,   21,   21,   21,   21,   21,
    6,    4,    8,
};
const short yylen[] = {                                         2,
    1,    1,    4,    2,    5,    3,    1,    6,    4,    3,
    0,    3,    1,    1,    2,    0,    2,    1,    4,    1,
    3,    1,    3,    1,    3,    2,    1,    1,    3,    1,
    3,    1,    2,    1,    2,    1,    1,    1,    1,    1,
    1,    2,    0,    2,    1,    4,    1,    1,    1,    1,
    1,    1,    1,    3,    3,    1,    2,    1,    1,    1,
    1,    6,    3,    1,    1,    1,    1,    1,    3,    5,
    3,    3,    1,    3,    5,    4,    0,    3,    1,    3,
    1,    5,    7,    5,    3,    1,    1,    3,    1,    1,
    3,    1,    3,    2,    1,    3,    0,    3,    1,    3,
    2,    0,    3,    1,    1,    1,    3,    3,    1,    2,
    1,    1,    3,    3,    1,    1,    1,    1,    1,    3,
    4,    1,    1,    2,    1,    3,    3,    3,    4,    5,
    1,    2,    1,    1,    3,    3,    1,    1,    1,    3,
    1,    3,    1,    1,    1,    1,    1,    1,    1,    1,
    1,    1,    1,    0,    1,    1,    1,    1,    4,    4,
    4,    8,    8,    4,    4,    4,    6,    6,    3,    1,
    1,    1,    2,    4,    3,    1,    1,    3,    2,    1,
    3,    3,    1,    1,    3,    5,    2,    5,    6,    8,
    9,    1,    3,    1,    3,    1,    2,    1,    1,    1,
    1,    1,    3,    1,    1,    1,    3,    1,    3,    1,
    3,    2,    1,    1,    3,    1,    1,    1,    1,    3,
    2,    1,    1,    1,    1,    1,    1,    1,    2,    3,
    2,    3,    1,    3,    1,    1,    1,    1,    1,    1,
    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
    1,    1,    1,
};
const short yydefred[] = {                                      0,
    0,    0,    0,    1,    2,    0,    0,  251,    0,    0,
   18,    0,  252,    0,    0,    0,    0,   17,    0,    0,
    0,    0,    0,    0,   45,    0,    0,  223,  227,    0,
   38,  224,    0,   37,  228,   30,    0,    0,    0,   24,
    0,   27,    0,   32,  222,  225,  226,    7,    0,   14,
    0,   13,    3,    0,    0,   44,    0,    0,   99,    0,
    0,    9,    0,  104,  105,  106,    0,    0,    0,    0,
    0,   33,   19,  244,  249,  247,  250,  248,  246,  237,
  245,  238,  236,    0,    0,  243,  241,  242,  240,  239,
    0,   26,    0,  253,    5,    0,   10,    0,    0,    0,
   36,   39,    0,    0,    0,   41,    0,    0,    0,    0,
    0,    0,   34,    0,   48,   49,   50,   51,   52,   53,
   56,   58,   59,   60,   61,    0,    0,    0,  124,    0,
    0,    0,  110,    0,    0,   31,    0,    0,   25,   29,
    6,   12,    0,    0,    0,   57,    0,    0,    0,    0,
    0,   73,    0,   95,   94,   40,   35,    0,   46,  100,
   98,    0,    0,  103,  112,  111,  125,  107,  108,    0,
    0,    0,  122,    0,  115,  116,  117,  118,  119,  123,
  133,  126,  128,  127,    0,    0,   66,    0,   64,   65,
   54,   68,   93,    0,    0,    0,   79,    0,   69,    0,
   71,   92,   91,   55,  131,  129,    0,    0,    0,    0,
  113,    0,    0,    8,  134,    0,    0,    0,    0,   74,
    0,   72,  130,    0,  120,  114,    0,    0,    0,    0,
    0,    0,    0,    0,    0,  147,    0,  137,  138,  139,
  141,  143,  144,  145,  146,  148,  149,  150,  151,  152,
  153,  155,  156,  157,  158,    0,  171,  172,    0,   63,
    0,    0,   81,    0,   86,   90,   78,   70,  121,    0,
    0,    0,    0,    0,  217,    0,  192,    0,    0,    0,
  210,  213,    0,  218,  219,  198,    0,  187,    0,  205,
    0,    0,  170,    0,    0,    0,  179,    0,  135,    0,
    0,    0,    0,  173,   62,    0,    0,    0,    0,  231,
  235,    0,    0,    0,  221,  229,  212,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
  183,  140,  142,  136,  169,  178,  177,    0,  176,   88,
   80,    0,   85,  230,    0,    0,  220,    0,    0,  194,
    0,    0,  211,  215,    0,  199,  166,    0,  159,  160,
  161,  164,  165,    0,    0,  181,    0,  174,    0,    0,
    0,    0,  234,    0,  188,    0,    0,  201,  200,    0,
    0,    0,  182,  175,   82,    0,   84,  195,  189,    0,
    0,  193,    0,  202,  167,  168,    0,    0,  197,    0,
    0,  186,   83,  190,    0,  162,  163,  191,
};
const short yydgoto[] = {                                       3,
    4,    5,    6,  300,  181,  273,  149,   96,   22,    7,
   16,   27,   62,  214,   51,  235,   10,   11,   37,   38,
   84,   39,   85,   40,   91,  274,   42,   43,  275,  112,
  113,   24,   25,  192,  115,  116,  117,  118,  119,  120,
  121,  122,  123,  124,  125,  188,  193,  189,  190,  150,
  151,  152,  195,  262,  196,  197,  263,  264,  265,  203,
  155,   58,   59,   63,   64,   65,   66,   67,  168,  169,
   68,  163,  174,  175,  176,  177,  178,  179,   69,   70,
  183,  206,  236,  237,  238,  239,  240,  241,  242,  243,
  244,  245,  246,  247,  248,  249,  250,  251,  252,  253,
  254,  255,  289,  287,  355,  380,  393,  294,  276,  290,
  257,  258,  338,  339,  297,  330,  331,  278,  349,  391,
  350,  279,  280,  281,  282,  283,  284,  285,   45,   46,
   47,  312,  313,
};
const short yysindex[] = {                                    -76,
 -229, -229,    0,    0,    0, -246, -244,    0, -136, -229,
    0, -145,    0, -128, -229, -142,  146,    0, -229,  -80,
  -73,  -57,   -8, -229,    0, -229,  -48,    0,    0,  146,
    0,    0,  167,    0,    0,    0, -246,  685,  -65,    0,
  146,    0,  -51,    0,    0,    0,    0,    0, -156,    0,
 -222,    0,    0, -244,  384,    0,   56, -246,    0, -229,
 -229,    0, -246,    0,    0,    0, -246,  -18, -246, -246,
  -36,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,  146,  146,    0,    0,    0,    0,    0,
  146,    0,  167,    0,    0, -229,    0,  -80, -142,  -11,
    0,    0, -229, -169,  -14,    0, -190,   51, -229,    0,
   -6,   18,    0, -246,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,  384, -229,  -47,    0,  -48,
  -27,  -25,    0,  -27, -128,    0,  202,  -65,    0,    0,
    0,    0,  -48,   88, -140,    0,  384, -229,   75, -226,
   10,    0,   88,    0,    0,    0,    0,  113,    0,    0,
    0, -229,   40,    0,    0,    0,    0,    0,    0, -229,
 -229,   93,    0,  -12,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,   32,    0,    0, -227,    0,    0,
    0,    0,    0,    0,   92,  135,    0,  384,    0, -190,
    0,    0,    0,    0,    0,    0, -229,  -47,  157, -229,
    0,  -25,  124,    0,    0,  101,   88,  113, -229,    0,
  129,    0,    0, -229,    0,    0,  629, -229,  -80,  629,
  124,  629, -229,  117,  159,    0, -214,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0, -221,    0,    0,  384,    0,
  178, -246,    0,  161,    0,    0,    0,    0,    0,  604,
  629,  164,  117,  629,    0, -213,    0,  140,  685,  -65,
    0,    0,  145,    0,    0,    0,  206,    0,  148,    0,
 -265,  222,    0,   69, -213,  629,    0,  133,    0,  124,
  629, -229,  629,    0,    0,  113,  113,  187,  113,    0,
    0, -206,  225,  194,    0,    0,    0,  113,  629,  629,
  629,  164,  629,  124,  629,  124,  124, -229,  249, -124,
    0,    0,    0,    0,    0,    0,    0, -135,    0,    0,
    0, -190,    0,    0,  629,  629,    0,  207,  -88,    0,
  202,  -65,    0,    0, -120,    0,    0,  241,    0,    0,
    0,    0,    0, -213,  629,    0,  629,    0,  629,   50,
  208,  225,    0,  124,    0,  242,   83,    0,    0,  629,
  124,  254,    0,    0,    0, -190,    0,    0,    0,  257,
  124,    0,  261,    0,    0,    0,  629,  224,    0,  -64,
  124,    0,    0,    0,  260,    0,    0,    0,
};
const short yyrindex[] = {                                     13,
    0,    0,    0,    0,    0,    0,   11,    0,    0,    6,
    0,  221,    0,  -77,    0,    8,    0,    0,    0,    0,
    0,  -34,    0,    2,    0,    0,  533,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,  177,  639,    0,
    0,    0,  520,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,   -7,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,  179,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,  165,    0,
    0,    0,    0,    0,    0,    0,  262,    0,    0,   74,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,   12,  227,    0,   17,
  -77,    0,    0,  -77,  -77,    0,  199,  662,    0,    0,
    0,    0,  238,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -