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

📄 chanimy.cpp

📁 Windows上的MUD客户端程序
💻 CPP
📖 第 1 页 / 共 3 页
字号:
/*----------------------------------------------------------------------------
                        _                              _ _       
        /\             | |                            | (_)      
       /  \   _ __   __| |_ __ ___  _ __ ___   ___  __| |_  __ _ 
      / /\ \ | '_ \ / _` | '__/ _ \| '_ ` _ \ / _ \/ _` | |/ _` |
     / ____ \| | | | (_| | | | (_) | | | | | |  __/ (_| | | (_| |
    /_/    \_\_| |_|\__,_|_|  \___/|_| |_| |_|\___|\__,_|_|\__,_|

    The contents of this file are subject to the Andromedia Public
	License Version 1.0 (the "License"); you may not use this file
	except in compliance with the License. You may obtain a copy of
	the License at http://www.andromedia.com/APL/

    Software distributed under the License is distributed on an
	"AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
	implied. See the License for the specific language governing
	rights and limitations under the License.

    The Original Code is Pueblo client code, released November 4, 1998.

    The Initial Developer of the Original Code is Andromedia Incorporated.
	Portions created by Andromedia are Copyright (C) 1998 Andromedia
	Incorporated.  All Rights Reserved.

	Andromedia Incorporated                         415.365.6700
	818 Mission Street - 2nd Floor                  415.365.6701 fax
	San Francisco, CA 94103

    Contributor(s):
	--------------------------------------------------------------------------
	   Chaco team:  Dan Greening, Glenn Crocker, Jim Doubek,
	                Coyote Lussier, Pritham Shetty.

					Wrote and designed original codebase.

------------------------------------------------------------------------------

	Animation parser.

----------------------------------------------------------------------------*/

#include "grheader.h"
#include "ChAnim.h"
#include "ChGrMod.h"
#include "ChAniPrs.h"
#pragma warning( disable: 4068 )

/* redefine these values so they don't globally conflict -
   This is necessary for yacc. Can change when we go to bison.
 */

#define yyparse  	ChAnimParser::yyparse
#define yycvtok		ChAnimParser::yycvtok

// end of predefinitions
// ==================================================================
# define ANCHOR 257
# define ANCHORLIST 258
# define BACKGROUND 259
# define CAST 260
# define CASTID 261
# define CMDARG 262
# define COLUMNS 263
# define CURSOR 264
# define FALSEVAL 265
# define FILE 266
# define FLOAT 267
# define FORMAT 268
# define FRAMERATE 269
# define FRAMES 270
# define FRAMEVAL 271
# define GOTO 272
# define HINT 273
# define HOTCAST 274
# define HOTRECT 275
# define INT 276
# define ISANIMATING 277
# define ISDRAGGABLE 278
# define ISVISIBLE 279
# define MAZE 280
# define NAME 281
# define NODEID 282
# define ROWS 283
# define SCENE 284
# define SCRIPT 285
# define SCRIPTREF 286
# define SPRITE 287
# define STARTFRAME 288
# define STOP 289
# define STRING 290
# define TRUEVAL 291

#ifdef __STDC__
#include <stdlib.h>
#include <string.h>
#else
#include <malloc.h>
#include <memory.h>
#endif

#include <values.h>

#ifdef __cplusplus

#ifndef yyerror
	void yyerror(const char *);
#endif

#ifndef yylex
#ifdef __EXTERN_C__
	extern "C" { int yylex(void); }
#else
	int yylex(void);
#endif
#endif
	int yyparse(void);

#endif
#define yyclearin yychar = -1
#define yyerrok yyerrflag = 0
extern int yychar;
extern int yyerrflag;
#ifndef YYSTYPE
#define YYSTYPE int
#endif
YYSTYPE yylval;
YYSTYPE yyval;
typedef int yytabelem;
#ifndef YYMAXDEPTH
#define YYMAXDEPTH 150
#endif
#if YYMAXDEPTH > 0
int yy_yys[YYMAXDEPTH], *yys = yy_yys;
YYSTYPE yy_yyv[YYMAXDEPTH], *yyv = yy_yyv;
#else	/* user does initial allocation */
int *yys;
YYSTYPE *yyv;
#endif
static int yymaxdepth = YYMAXDEPTH;
# define YYERRCODE 256
yytabelem yyexca[] ={
-1, 1,
	0, -1,
	-2, 0,
	};
# define YYNPROD 85
# define YYLAST 208
yytabelem yyact[]={

   112,    90,    87,    62,    88,   126,   118,    13,    55,   117,
    65,   116,   111,    86,    89,    85,    37,    38,    36,   108,
    34,    33,    84,   106,     9,    58,    35,   136,    91,    61,
    46,    48,   135,     7,   122,     8,   107,   100,   134,   133,
    73,   132,    34,    33,   131,   130,   129,   128,   125,    47,
    73,    49,   124,   121,   120,    34,    33,    99,   119,     6,
     9,   115,   114,    68,    67,    57,   109,     7,    20,     8,
    52,    23,    69,    59,    54,    51,    12,    11,    10,   102,
    71,    40,    25,    27,    26,    72,    93,    60,    22,    16,
    29,     5,    18,     4,    17,     3,    75,    42,    41,   105,
   104,   103,   101,    45,    44,    50,    43,    56,    39,    98,
    53,    97,    92,    32,    31,    30,    28,    24,    70,    83,
    82,    66,    81,    42,    41,    63,    64,    80,    79,    78,
    77,    76,    74,    21,    19,    15,    90,    87,     2,    88,
     1,     0,     0,    95,    94,    96,     0,     0,    86,    89,
    85,   110,   108,     0,    46,    48,   106,    84,     0,     0,
    37,    38,    36,    91,    34,    33,    34,    33,     9,   107,
    35,   113,   100,    47,    14,    73,    95,    94,    96,   123,
     0,   127,     0,     0,     7,    20,     8,     0,     0,     0,
    34,    33,    99,     0,     0,     0,     0,     0,     0,     0,
     0,     0,    23,     0,     0,     0,     0,    73 };
yytabelem yypact[]={

  -225,-10000000,-10000000,-10000000,-10000000,-10000000,   -45,   -46,   -47,  -116,
  -191,  -186,  -261,  -239,-10000000,   -74,-10000000,-10000000,-10000000,-10000000,
   -48,   -55,-10000000,   -49,  -117,-10000000,-10000000,-10000000,-10000000,-10000000,
-10000000,-10000000,-10000000,  -211,  -265,   -50,  -262,  -262,  -262,  -115,
-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,  -212,  -213,   -51,-10000000,
-10000000,  -216,-10000000,-10000000,  -260,-10000000,-10000000,-10000000,-10000000,  -226,
-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,  -253,
   -59,-10000000,-10000000,  -278,  -125,-10000000,-10000000,-10000000,-10000000,-10000000,
-10000000,-10000000,-10000000,-10000000,  -214,  -215,  -279,  -281,  -284,  -218,
  -222,  -223,   -91,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,  -224,
  -228,  -120,-10000000,-10000000,-10000000,-10000000,  -229,-10000000,  -230,-10000000,
-10000000,-10000000,-10000000,-10000000,-10000000,  -231,-10000000,-10000000,-10000000,-10000000,
-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,-10000000,  -232,-10000000,
  -235,  -237,  -238,  -244,-10000000,  -249,-10000000 };
yytabelem yypgo[]={

     0,   140,   138,    94,    92,    90,   135,    89,   134,   133,
    88,   132,    96,   131,   130,   129,   128,   127,   122,   120,
   119,   118,    80,    85,   117,    82,    84,    83,   116,   115,
   114,   113,    87,   112,    86,   111,   109,   108,    81,   106,
   104,   103,   102,    79,   101,   100,    99 };
yytabelem yyr1[]={

     0,     1,     1,     1,     1,     2,     6,     6,     7,     7,
     7,     3,     9,     9,    10,    11,    11,    12,    12,    12,
    12,    12,    12,    12,    12,    13,    14,    15,    16,    17,
    18,    19,    20,     8,    21,    21,    22,     4,    24,    24,
    25,    25,    25,    25,    25,    25,    25,    26,    27,    29,
    30,    31,    32,    32,    28,    33,    33,    34,    34,    34,
    34,    34,    23,    35,    36,     5,     5,    37,    37,    38,
    38,    38,    38,    38,    39,    40,    41,    42,    42,    43,
    43,    43,    44,    45,    46 };
yytabelem yyr2[]={

     0,     3,     3,     3,     3,     9,     4,     3,     2,     2,
     2,     9,     4,     2,     9,     5,     3,     2,     2,     2,
     2,     2,     2,     2,     2,     5,    11,     5,     5,     5,
     5,     5,     5,     9,     5,     3,     2,     9,     5,     3,
     2,     2,     2,     2,     2,     2,     2,     5,     5,     5,
     5,     5,     3,     3,     9,     5,     3,     2,     2,     2,
     2,     2,     5,     5,     5,     9,     5,     5,     3,     2,
     2,     2,     2,     2,     5,     5,     9,     5,     3,     2,
     2,     2,    13,     3,     5 };
yytabelem yychk[]={

-10000000,    -1,    -2,    -3,    -4,    -5,   284,   258,   260,   285,
   123,   123,   123,   123,   290,    -6,    -7,    -3,    -4,    -8,
   259,    -9,   -10,   257,   -24,   -25,   -26,   -27,   -28,    -5,
   -29,   -30,   -31,   282,   281,   287,   279,   277,   278,   -37,
   -38,   -26,   -27,   -39,   -40,   -41,   269,   288,   270,   125,
    -7,   123,   125,   -10,   123,   125,   -25,   276,   290,   123,
   -32,   291,   265,   -32,   -32,   125,   -38,   276,   276,   123,
   -21,   -22,   -23,   266,   -11,   -12,   -13,   -14,   -15,   -16,
   -17,   -18,   -19,   -20,   282,   275,   273,   262,   264,   274,
   261,   288,   -33,   -34,   -26,   -27,   -23,   -35,   -36,   283,
   263,   -42,   -43,   -44,   -45,   -46,   276,   289,   272,   125,
   -22,   290,   125,   -12,   276,   276,   290,   290,   290,   276,
   276,   276,   125,   -34,   276,   276,   125,   -43,   276,   276,
   276,   276,   276,   276,   276,   276,   276 };
yytabelem yydef[]={

     0,    -2,     1,     2,     3,     4,     0,     0,     0,     0,
     0,     0,     0,     0,    66,     0,     7,     8,     9,    10,
     0,     0,    13,     0,     0,    39,    40,    41,    42,    43,
    44,    45,    46,     0,     0,     0,     0,     0,     0,     0,
    68,    69,    70,    71,    72,    73,     0,     0,     0,     5,
     6,     0,    11,    12,     0,    37,    38,    47,    48,     0,
    49,    52,    53,    50,    51,    65,    67,    74,    75,     0,
     0,    35,    36,     0,     0,    16,    17,    18,    19,    20,
    21,    22,    23,    24,     0,     0,     0,     0,     0,     0,
     0,     0,     0,    56,    57,    58,    59,    60,    61,     0,
     0,     0,    78,    79,    80,    81,     0,    83,     0,    33,
    34,    62,    14,    15,    25,     0,    27,    28,    29,    30,
    31,    32,    54,    55,    63,    64,    76,    77,     0,    84,
     0,     0,     0,     0,    26,     0,    82 };
typedef struct
#ifdef __cplusplus
	yytoktype
#endif
{ char *t_name; int t_val; } yytoktype;
#ifndef YYDEBUG
#	define YYDEBUG	0	/* don't allow debugging */
#endif

#if YYDEBUG

yytoktype yytoks[] =
{
	"ANCHOR",	257,
	"ANCHORLIST",	258,
	"BACKGROUND",	259,
	"CAST",	260,
	"CASTID",	261,
	"CMDARG",	262,
	"COLUMNS",	263,
	"CURSOR",	264,
	"FALSEVAL",	265,
	"FILE",	266,
	"FLOAT",	267,
	"FORMAT",	268,
	"FRAMERATE",	269,
	"FRAMES",	270,
	"FRAMEVAL",	271,
	"GOTO",	272,
	"HINT",	273,
	"HOTCAST",	274,
	"HOTRECT",	275,
	"INT",	276,
	"ISANIMATING",	277,
	"ISDRAGGABLE",	278,
	"ISVISIBLE",	279,
	"MAZE",	280,
	"NAME",	281,
	"NODEID",	282,
	"ROWS",	283,
	"SCENE",	284,
	"SCRIPT",	285,
	"SCRIPTREF",	286,
	"SPRITE",	287,
	"STARTFRAME",	288,
	"STOP",	289,
	"STRING",	290,
	"TRUEVAL",	291,
	"-unknown-",	-1	/* ends search */
};

char * yyreds[] =
{
	"-no such reduction-",
	"GraphicsFile : Scene",
	"GraphicsFile : AnchorListNode",
	"GraphicsFile : CastMember",
	"GraphicsFile : CastScript",
	"Scene : SCENE '{' SceneList '}'",
	"SceneList : SceneList SceneNode",
	"SceneList : SceneNode",
	"SceneNode : AnchorListNode",
	"SceneNode : CastMember",
	"SceneNode : Background",
	"AnchorListNode : ANCHORLIST '{' Anchors '}'",
	"Anchors : Anchors Anchor",
	"Anchors : Anchor",
	"Anchor : ANCHOR '{' AnchorDecls '}'",
	"AnchorDecls : AnchorDecls AnchorDecl",
	"AnchorDecls : AnchorDecl",
	"AnchorDecl : AnchorIdentifier",
	"AnchorDecl : AnchorRect",
	"AnchorDecl : AnchorHint",
	"AnchorDecl : AnchorCmdArg",
	"AnchorDecl : AnchorCursor",
	"AnchorDecl : AnchorHotCast",
	"AnchorDecl : AnchorCast",
	"AnchorDecl : AnchorStartFrame",
	"AnchorIdentifier : NODEID INT",
	"AnchorRect : HOTRECT INT INT INT INT",
	"AnchorHint : HINT STRING",
	"AnchorCmdArg : CMDARG STRING",
	"AnchorCursor : CURSOR STRING",
	"AnchorHotCast : HOTCAST INT",
	"AnchorCast : CASTID INT",
	"AnchorStartFrame : STARTFRAME INT",
	"Background : BACKGROUND '{' BackgroundDecls '}'",
	"BackgroundDecls : BackgroundDecls BackgroundDecl",
	"BackgroundDecls : BackgroundDecl",
	"BackgroundDecl : FileSpec",
	"CastMember : CAST '{' CastDecls '}'",
	"CastDecls : CastDecls CastDecl",
	"CastDecls : CastDecl",
	"CastDecl : NodeId",
	"CastDecl : NodeName",
	"CastDecl : Sprite",
	"CastDecl : CastScript",
	"CastDecl : IsVisible",
	"CastDecl : IsAnimating",
	"CastDecl : IsDraggable",
	"NodeId : NODEID INT",
	"NodeName : NAME STRING",
	"IsVisible : ISVISIBLE BoolValue",
	"IsAnimating : ISANIMATING BoolValue",
	"IsDraggable : ISDRAGGABLE BoolValue",
	"BoolValue : TRUEVAL",
	"BoolValue : FALSEVAL",
	"Sprite : SPRITE '{' SpriteDecls '}'",
	"SpriteDecls : SpriteDecls SpriteDecl",
	"SpriteDecls : SpriteDecl",
	"SpriteDecl : NodeId",
	"SpriteDecl : NodeName",
	"SpriteDecl : FileSpec",
	"SpriteDecl : Rows",
	"SpriteDecl : Columns",

⌨️ 快捷键说明

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