mix_scanner.c

来自「汇编语言编程源代码」· C语言 代码 · 共 1,590 行 · 第 1/5 页

C
1,590
字号
      270,    0,  270,  270,  395,  270,  271,  271,  395,  271,      271,  271,  271,  272,  272,  272,  272,  273,  273,  273,      274,  274,  274,  275,  275,  275,  277,  277,  277,    0,        0,  277,    0,  277,  277,  277,  277,  277,    0,  277,      277,  279,  279,  279,  281,  281,  281,  283,  283,  283,      285,  285,    0,  285,  285,    0,  285,  285,  286,  286,        0,  286,  286,  286,  286,  286,  287,  287,    0,  287,      287,  287,  287,  287,  289,  289,  289,    0,    0,  289,        0,  289,  289,    0,  289,  289,    0,  289,  290,  290,      290,    0,    0,  290,    0,  290,  290,    0,  290,  290,      290,  290,  291,  291,  291,    0,  291,  291,    0,  291,      292,  292,  292,    0,  292,  292,  292,  292,  294,  294,      294,  295,  295,  295,    0,    0,  295,  295,  295,  295,      295,  295,  295,  399,  295,  297,  297,  399,  297,  297,      400,  297,  298,  298,  400,  298,  298,  298,  298,  299,      299,    0,  299,  299,  299,  299,  303,  303,  303,    0,      303,  303,    0,  303,  304,  304,  304,    0,  304,  304,      304,  304,  305,    0,  305,  305,  305,  305,  305,    0,      305,  306,    0,  306,  306,  306,  306,  306,  306,  306,      307,  307,  309,  307,    0,  307,  309,  309,  310,    0,      310,  310,  310,  310,  310,    0,  310,  311,    0,  311,      311,  311,  311,  311,  311,  311,  319,  319,  319,  321,      321,    0,  321,  321,    0,  321,  321,  322,  322,    0,      322,  322,  322,  322,  322,  324,  324,    0,  324,  324,      404,  324,  325,  325,  404,  325,  325,  325,  325,  326,      326,  326,    0,  326,  326,    0,  326,  327,  327,  327,        0,  327,  327,  327,  327,  328,  328,  328,    0,  328,      328,  328,  328,  329,  329,  329,    0,  329,  329,  419,      329,  330,  330,  419,  330,    0,  330,  331,  331,  331,        0,  331,  331,    0,  331,  332,  332,  332,    0,  332,      332,  332,  332,  333,    0,  333,  333,  333,  333,  333,        0,  333,  334,    0,  334,  334,  334,  334,  334,  334,      334,  335,    0,  335,  335,  335,  335,  335,  335,  335,      338,  338,  338,    0,  338,  338,    0,  338,  339,  339,      339,    0,  339,  339,  339,  339,  342,  357,  357,  357,      342,  342,  343,  343,  343,    0,  343,  343,    0,  343,      344,  344,  344,    0,  344,  344,  344,  344,  345,    0,      345,  345,  345,  345,  345,    0,  345,  346,    0,  346,      346,  346,  346,  346,  346,  346,  349,  349,  349,    0,      349,  349,  349,  349,  350,  350,  350,    0,  350,  350,      350,  350,  352,  352,  352,    0,  352,  352,    0,  352,      353,  353,  353,    0,  353,  353,  353,  353,  358,  358,      358,  361,  361,  361,  365,  365,  365,  365,  365,  365,      365,  365,  365,  365,  365,  365,  365,  365,  366,  366,        0,  366,  366,  366,  366,  366,  366,  366,  366,  366,      366,  366,  368,  429,  368,  433,  446,  429,  450,  433,      446,    0,  450,  368,  370,  370,  370,    0,    0,  460,        0,  370,  370,  460,  370,  370,  371,  371,  371,    0,        0,    0,    0,  371,  371,    0,  371,  371,  372,  372,        0,    0,  372,  373,  373,    0,    0,  373,  375,  375,      375,    0,    0,  375,    0,  375,  375,    0,  375,  375,      377,  377,  377,    0,  377,  377,  382,  382,    0,    0,      382,  384,    0,  384,  384,  384,  384,  384,  385,    0,      385,    0,    0,    0,    0,    0,    0,    0,    0,  385,      387,  387,    0,  387,  387,  388,  388,  388,    0,    0,        0,    0,  388,  388,    0,  388,  388,  390,  390,  390,      390,  390,  390,  390,  390,  390,  390,  390,  390,  390,      390,  391,  391,    0,  391,  391,  391,  392,  392,  392,        0,    0,  392,    0,  392,  392,  392,  392,  392,  392,      394,  394,  394,    0,    0,  394,    0,  394,  394,    0,      394,  394,  396,  396,  396,    0,  396,  396,  401,  401,        0,  401,  401,  402,  402,  402,    0,    0,  402,  402,      402,  402,  402,  402,  402,  403,  403,    0,    0,  403,      405,  405,    0,    0,  405,  406,    0,  406,  406,  406,      406,  406,  407,  407,  407,  407,  407,  407,  407,  407,      407,  407,  407,  407,  407,  407,  408,    0,  408,  408,      408,  408,  408,  409,  409,  409,  409,  409,  409,  409,      409,  409,  409,  409,  409,  409,  409,  410,  410,  410,      410,  410,  410,  410,  410,  410,  410,  410,  410,  410,      410,  411,  411,  411,  411,  411,  411,  411,  411,  411,      411,  411,  411,  411,  411,  412,  412,    0,  412,  412,      413,  413,    0,  413,  413,  414,  414,    0,  414,  414,      415,  415,    0,  415,  415,  416,  416,  416,    0,    0,        0,    0,  416,  416,    0,  416,  416,  417,  417,  417,      417,  417,  417,  417,  417,  417,  417,  417,  417,  417,      417,  418,  418,  418,  418,  418,  418,  418,  418,  418,      418,  418,  418,  418,  418,  420,  420,    0,  420,  420,      420,  421,  421,    0,  421,  421,  421,  422,  422,  422,        0,    0,  422,    0,  422,  422,    0,  422,  422,  423,      423,  423,    0,    0,  423,    0,  423,  423,    0,  423,      423,  424,  424,  424,    0,  424,  424,  425,  425,  425,        0,  425,  425,  426,  426,  426,  426,  426,  426,  426,      426,  426,  426,  426,  426,  426,  426,  430,  430,    0,      430,  430,  431,  431,  431,    0,  431,  431,  432,    0,      432,  432,  432,  432,  432,  434,    0,  434,  434,  434,      434,  434,  435,  435,  435,  435,  435,  435,  435,  435,      435,  435,  435,  435,  435,  435,  436,  436,  436,  436,      436,  436,  436,  436,  436,  436,  436,  436,  436,  436,      437,  437,  437,  437,  437,  437,  437,  437,  437,  437,      437,  437,  437,  437,  438,  438,  438,  438,  438,  438,      438,  438,  438,  438,  438,  438,  438,  438,  439,  439,        0,  439,  439,  440,  440,  440,    0,    0,  440,    0,      440,  440,  440,  440,  440,  440,  441,  441,    0,  441,      441,  441,  442,  442,  442,    0,    0,  442,    0,  442,      442,    0,  442,  442,  443,  443,  443,    0,  443,  443,      444,  444,  444,    0,    0,  444,  444,  444,  444,  444,      444,  444,  445,  445,    0,  445,  445,  447,  447,  447,        0,  447,  447,  448,    0,  448,  448,  448,  448,  448,      449,  449,    0,    0,  449,  451,    0,  451,  451,  451,      451,  451,  452,    0,  452,  452,  452,  452,  452,  452,      452,  452,  452,  453,  453,    0,  453,  453,  453,  454,      454,    0,  454,  454,  455,  455,  455,    0,  455,  455,      456,  456,  456,    0,  456,  456,  457,    0,  457,  457,      457,  457,  457,  458,    0,  458,  458,  458,  458,  458,      458,  458,  458,  458,  459,  459,  459,    0,  459,  459,      461,  461,  461,    0,  461,  461,  462,    0,  462,  462,      462,  462,  462,  463,    0,  463,  463,  463,  463,  463,      463,  463,  463,  463,  464,  464,  464,    0,  464,  464,      465,    0,  465,  465,  465,  465,  465,  465,  465,  465,      465,  466,  466,  466,    0,  466,  466,  467,    0,  467,      467,  467,  467,  467,  467,  467,  467,  467,  468,  468,      468,  468,  468,  468,  468,  468,  468,  468,  468,  469,      469,  469,  469,  469,  469,  469,  469,  469,  469,  469,      469,  469,  469,  364,  364,  364,  364,  364,  364,  364,      364,  364,  364,  364,  364,  364,  364,  364,  364,  364,      364,  364,  364,  364,  364,  364,  364,  364,  364,  364,      364,  364,  364,  364,  364,  364    } ;static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;static char *yy_full_match;static int yy_lp;static int yy_looking_for_trail_begin = 0;static int yy_full_lp;static int *yy_full_state;#define YY_TRAILING_MASK 0x2000#define YY_TRAILING_HEAD_MASK 0x4000#define REJECT \{ \*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \yy_cp = yy_full_match; /* restore poss. backed-over text */ \yy_lp = yy_full_lp; /* restore orig. accepting pos. */ \yy_state_ptr = yy_full_state; /* restore orig. state */ \yy_current_state = *yy_state_ptr; /* restore curr. state */ \++yy_lp; \goto find_rule; \}#define yymore() yymore_used_but_not_detected#define YY_MORE_ADJ 0#define YY_RESTORE_YY_MORE_OFFSETchar *yytext;#line 1 "mix_scanner.l"#define INITIAL 0/* -*-c-*- -------------- mix_scanner.l : * Lexical scanner used by mix_parser_t * ------------------------------------------------------------------ * Copyright (C) 2000 Free Software Foundation, Inc. *   * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. *   * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. *   * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *   */#line 23 "mix_scanner.l"#include <string.h>#include "mix.h"#include "xmix_parser.h"#define YY_DECL mix_parser_err_t mix_flex_scan (mix_parser_t *parser)#define RESET()					\  do {						\    mix_ins_fill_from_id (ins, mix_NOP);	\    ins.address = 0;				\    ins.index = 0;				\    nof = FALSE;				\    lsf = FALSE;				\    if (symbol != NULL )			\     {						\       g_free (symbol);				\       symbol = NULL;				\     }						\    if (lsymbol != NULL)			\     {						\       g_free (lsymbol);			\       lsymbol = NULL;				\     }                       			\  } while (FALSE)#define NEXT()						\  do {							\    if (lsymbol != NULL)				\       mix_parser_manage_local_symbol (parser,lsymbol,  \				       loc);    	\    parser->loc_count++;				\    RESET ();						\    ++lineno;						\    BEGIN (INITIAL);					\  } while (FALSE)#define ADD_INS()				\  do {						\    mix_parser_add_ins (parser, &ins, lineno);	\    NEXT ();					\  } while (FALSE)#define ADD_RAW(value)				\  do {						\    mix_parser_add_raw (parser, value, lineno);	\    NEXT ();	               			\  } while (FALSE)#define ENTER_EVAL()				\  do {						\    if (yytext[0] != '*')                       \      {                                         \        expr_val = MIX_WORD_ZERO;		\        yyless (0);				\      }                                         \    else                                        \      {                                         \        expr_val = mix_short_to_word_fast (parser->loc_count); \	yyless (1);                             \      }                                         \    yy_push_state (EVAL);			\  } while (FALSE)#define ENTER_WEVAL()				\  do {						\    wexpr_val = MIX_WORD_ZERO;			\    wexpr_val_tmp = MIX_WORD_ZERO;		\    is_fp = FALSE;                              \    yyless (0);					\    yy_push_state (WEVAL);			\  } while (FALSE)#define RETURN_ERROR(error, comment)				\  do {								\    char c;							\    mix_parser_log_error (parser,error,lineno,comment,FALSE);	\    while ( (c = input ()) != '\n' && c != EOF ) ;		\    if ( c == EOF ) return error; else ++lineno;		\    RESET ();							\    BEGIN (INITIAL);						\  } while (FALSE) static mix_word_t  eval_binop_ (const gchar *op, mix_word_t x, mix_word_t y); static void  unput_word_ (mix_word_t word); #define YY_MAIN 0#define YY_STACK_USED 1#define YY_NO_TOP_STATE 1#define LOC 1#define OP 2#define ADDRESS 3#define INDEX 4#define FSPEC 5#define EVAL 6#define WEVAL 7#define ORIG 8#define CON 9#define EQU 10#define END 11#line 1248 "lex.yy.c"/* Macros after this point can all be overridden by user definitions in * section 1. */#ifndef YY_SKIP_YYWRAP#ifdef __cplusplusextern "C" int yywrap YY_PROTO(( void ));#elseextern int yywrap YY_PROTO(( void ));#endif#endif#ifndef YY_NO_UNPUTstatic void yyunput YY_PROTO(( int c, char *buf_ptr ));#endif#ifndef yytext_ptrstatic void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));#endif#ifdef YY_NEED_STRLENstatic int yy_flex_strlen YY_PROTO(( yyconst char * ));#endif

⌨️ 快捷键说明

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