亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? main.c

?? its about compiler for LL1 and LR
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*@A (C) 1992 Allen I. Holub                                                */
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdarg.h>
#include <signal.h>
#include <malloc.h>
#include <errno.h>
#include <time.h>
#include <sys/types.h>
#include <sys/timeb.h>
#include <process.h>
#include <tools/debug.h>
#include <tools/set.h>
#include <tools/hash.h>
#include <tools/compiler.h>
#include <tools/l.h>

#ifdef LLAMA
#	define  ALLOCATE
#	include "parser.h"
#	undef   ALLOCATE
#else
#	define  ALLOCATE
#	include "parser.h"
#	undef   ALLOCATE
#endif

#if (0 MSC(+1) )
    #pragma comment(exestr, "(C)" __DATE__ "Allen Holub. All rights reserved.")
#endif

PRIVATE   int   Warn_exit     = 0;	/* Set to 1 if -W on command line  */
PRIVATE   int	Num_warnings  = 0;	/* Total warnings printed	   */
PRIVATE	  char  *Output_fname = "????"; /* Name of the output file	   */
PRIVATE   FILE *Doc_file      = NULL;   /* Error log & machine description */

#ifdef MAP_MALLOC
  PRIVATE int	Malloc_chk     = 1;	/* Run-time malloc() checking      */
  PRIVATE int	Malloc_verbose = 0;	/*     " use verbose diagnostics   */
#endif

#define VERBOSE(str)  if(Verbose){  printf( "%s:\n", (str));  }else
/*----------------------------------------------------------------------*/
void onintr	  P(( void 			));		/* local */
void parse_args	  P(( int argc,  char **argv	));
int  do_file	  P(( void			));
void symbols	  P(( void			));
void statistics	  P(( FILE *fp			));
void tail	  P(( void			));

void output	  P(( char *fmt, ...		));		/* public */
void lerror	  P(( int fatal, char *fmt, ...	));
void error	  P(( int fatal, char *fmt, ...	));
char *open_errmsg P(( void 			));
char *do_dollar	  P(( int num, int rhs_size, int lineno, PRODUCTION *prod, \
								char *fname));
/*----------------------------------------------------------------------
 * There are two versions of the following subroutines--used in do_file(),
 * depending on whether this is llama or occs.

 *
 * subroutine:		llama version in:	occs version in:
 *
 * file_header()	lldriver.c		yydriver.c
 * code_header()	lldriver.c		yydriver.c
 * driver()		lldriver.c		yydriver.c
 * tables()		llcode.c		yycode.c
 * patch()		-----			yypatch.c
 * select()		llselect.c		------
 * do_dollar()		lldollar.c		yydollar.c
 *
 * Also, several part of this file are compiled only for llama, others only for
 * occs. The llama-specific parts are arguments to LL() macros, the occs-
 * specific parts are in OX() macros. We'll look at what the occs-specific
 * parts actually do in the next Chapter.
 *----------------------------------------------------------------------
 */
PUBLIC	void main( argc, argv )
char	**argv;
{
    MSC( _amblksiz = 2048; )	/* Declared in Microsoft C's malloc.h.        */
    				/* Controls size of malloc() allocation unit. */
    signon();			/* Print sign on message		   */
    signal( SIGINT, 		/* Close output files on Ctrl-Break.	   */
	MSC((void(*)(int))) onintr );
    parse_args( argc, argv );

# ifdef MAP_MALLOC
       malloc_checking( Malloc_chk, Malloc_verbose );
# endif

    if( Debug && !Symbols )
	Symbols = 1;

    OX( if( Make_parser )						)
    OX( {								)
    OX(     if( Verbose == 1 )						)
    OX(     {								)
    OX(	        if( !(Doc_file = fopen( DOC_FILE, "w") ) )		)
    OX(	            ferr( "Can't open log file %s\n", DOC_FILE );	)
    OX(     }								)
    OX(     else if( Verbose > 1 )					)
    OX(		Doc_file = stderr;					)
    OX( }								)

    if( Use_stdout )
    {
	Output_fname = "/dev/tty" ;
	Output       = stdout;
    }
    else
    {
	OX( Output_fname = !Make_parser ? ACT_FILE : PARSE_FILE ; )
	LL( Output_fname = PARSE_FILE; 				  )

	if( (Output = fopen( Output_fname, "w")) == NULL )
	    error( FATAL, "Can't open output file %s: %s\n",
						Output_fname, open_errmsg() );
    }

    if( (yynerrs = do_file()) == 0)	/* Do all the work  */
    {
	if( Symbols )
	    symbols();			/* Print the symbol table	  */

	statistics( stdout );		/* And any closing-up statistics. */

	if( Verbose && Doc_file )
	{
	    OX(  statistics( Doc_file );   )

#ifdef MAP_MALLOC
  	    printf("\n%lu bytes (%luK) memory used by malloc\n",
  				    memory_used(), memory_used()/1024L );
#endif
	}
    }
    else
    {
	if( Output != stdout )
	{
	    fclose( Output );
	    if( unlink( Output_fname ) == -1 )
		perror( Output_fname );
	}
    }

    /* Exit with  the number of hard errors (or, if -W was specified, the sum
     * of the hard errors and warnings) as an exit status. Doc_file and Output
     * are closed implicitly by exit().
     */

    exit( yynerrs + (Warn_exit ? Num_warnings : 0) );
}
/*----------------------------------------------------------------------*/
PRIVATE void onintr()			/* SIGABRT (Ctrl-Break, ^C) Handler */
{
    if( Output != stdout )		/* Destroy parse file so that a */
    {					/* subsequent compile will fail */
	fclose( Output );
	unlink( Output_fname );
    }

    exit( EXIT_USR_ABRT );
}
/*----------------------------------------------------------------------*/
PRIVATE	void parse_args( argc, argv )
int	argc;
char	**argv;
{
    /* Parse the command line, setting global variables as appropriate */

    char	*p;
    static char name_buf[80];	       /* Use to assemble default file names */

    static char	*usage_msg[] =
    {
#ifdef LLAMA
        "Usage is: llama [-switch] file",
        "Create an LL(1) parser from the specification in the",
	"input file. Legal command-line switches are:",
	"",
        "-cN      use N as the pairs threshold when (C)ompressing",
	"-D       enable (D)ebug mode in yyparse.c (implies -s)",
        "-f       (F)ast, uncompressed, tables",
#else
        "Usage is:  occs [-switch] file",
	"",
        "\tCreate an LALR(1) parser from the specification in the",
	"\tinput file. Legal command-line switches are:",
	"",
        "-a       Output actions only (see -p)",
	"-D       enable (D)ebug mode in yyparse.c (implies -s)",
#endif
	"-g       make static symbols (G)lobal in yyparse.c",
	"-l       suppress #(L)ine directives",
	"-m<file> use <file> for parser te(M)plate",
	"-p       output parser only (can be used with -T also)",
	"-s       make (s)ymbol table",
	"-S       make more-complete (S)ymbol table",
	"-t       print all (T)ables (and the parser) to standard output",
	"-T	  move large tables from yyout.c to yyoutab.c",
	"-v       print (V)erbose diagnostics (including symbol table)",
	"-V       more verbose than -v. Implies -t, & yyout.doc goes to stderr",
	"-w       suppress all warning messages",
	"-W       warnings (as well as errors) generate nonzero exit status",
#ifdef MAP_MALLOC
  	"-M       Disable malloc checking at run time\n",
#endif
	NULL
    };

    /* Note that all global variables set by command-line switches are declared
     * in parser.h. Space is allocated because a #define ALLOC is present at
     * the top of the current file.
     */

    for( ++argv,--argc; argc && *(p = *argv) == '-'; ++argv, --argc )
    {
	while( *++p )
	{
	    switch( *p )
	    {
	OX(  case 'a':  Make_parser  = 0;		)
	OX(	        Template     = ACT_TEMPL;	)
	OX(	        break;				)

	    case 'D':  Debug 	    = 1;	break;
	    case 'g':  Public	    = 1;	break;
	LL( case 'f':  Uncompressed = 1; 	break;		)
	    case 'l':  No_lines	    = 1;	break;
	    case 'm':  Template     = p + 1;	goto out;

#ifdef MAP_MALLOC
  	    case 'M':  Malloc_chk   = 0;	break;
#endif

	OX( case 'p':  Make_actions = 0;	break;		)
	    case 's':  Symbols      = 1;	break;
	    case 'S':  Symbols      = 2;	break;
	    case 't':  Use_stdout   = 1; 	break;
	    case 'T':  Make_yyoutab = 1; 	break;
	    case 'v':  Verbose	    = 1;	break;
	    case 'V':  Verbose	    = 2;	break;
	    case 'w':  No_warnings  = 1;	break;
	    case 'W':  Warn_exit    = 1;	break;
	LL( case 'c':  Threshold = atoi( ++p );			)
	LL(	       while( *p && isdigit( p[1] ) )		)
	LL(		    ++p;				)
	LL(	       break;					)
	    default :
		       fprintf(stderr, "<-%c>: illegal argument\n", *p);
		       printv (stderr, usage_msg );
		       exit( EXIT_ILLEGAL_ARG );
	    }
	}
out: ;

    }

    if( Verbose > 1 )
	Use_stdout = 1;

    if( argc <= 0 )			/* Input from standard input	*/
	No_lines = 1;

    else if( argc > 1 )
    {
	fprintf( stderr, "Too many arguments.\n" );
	printv ( stderr, usage_msg );
	exit   ( EXIT_TOO_MANY );
    }
    else 				/* argc == 1, input from file   */
    {
	if( ii_newfile( Input_file_name = *argv ) < 0 )
	{
	    sprintf( name_buf, "%0.70s.%s", *argv, DEF_EXT );

	    if( ii_newfile( Input_file_name = name_buf ) < 0 )
		error( FATAL, "Can't open input file %s or %s: %s\n",
						*argv, name_buf, open_errmsg());
	}
    }
}
/*----------------------------------------------------------------------*/
PRIVATE	int	do_file()
{

    /* Process the input file. Return the number of errors.  */

    struct timeb start_time, end_time ;
    long	 time;
    void 	 nows P((void));	/* declared in parser.lex */

    ftime( &start_time );    /* Initialize times now so that the difference   */
    end_time = start_time;   /* between times will be 0 if we don't build the */
			     /* tables. Note that I'm using structure assign- */
			     /* ment here.			              */
    init_acts  ();	     /* Initialize the action code.		      */
    file_header();  	     /* Output #defines that you might want to change */

    VERBOSE( "parsing" );

    nows      ();         /* Make lex ignore white space until ws() is called */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久久久久久99精品| 欧美v亚洲v综合ⅴ国产v| 久久66热re国产| 亚洲mv在线观看| 亚洲成av人片观看| 免费精品视频最新在线| 日本美女视频一区二区| 久久精品国产一区二区| 蜜臂av日日欢夜夜爽一区| 美女mm1313爽爽久久久蜜臀| 久久不见久久见免费视频1| 激情偷乱视频一区二区三区| 国产精品99久久久久久似苏梦涵| 成人午夜激情在线| 99国产精品久| 欧美一卡2卡3卡4卡| 精品国产一区二区国模嫣然| 国产精品三级在线观看| 亚洲乱码国产乱码精品精小说 | 国产乱子轮精品视频| 激情综合色综合久久综合| 国产在线精品免费| 97se狠狠狠综合亚洲狠狠| 色八戒一区二区三区| 在线电影国产精品| 国产午夜一区二区三区| 亚洲精品成人天堂一二三| 亚洲bt欧美bt精品| 国产夫妻精品视频| 在线视频国内一区二区| 亚洲精品在线观看网站| 亚洲欧洲综合另类在线| 日韩高清在线电影| 成人免费毛片app| 欧美肥胖老妇做爰| 国产精品情趣视频| 看片的网站亚洲| 色噜噜狠狠一区二区三区果冻| 在线电影欧美成精品| 中文字幕在线一区免费| 麻豆免费看一区二区三区| 色天使色偷偷av一区二区| 亚洲精品在线网站| 亚洲一级二级三级在线免费观看| 国产成人免费在线视频| 91精品国产乱码| 亚洲欧美日韩国产综合在线| 捆绑紧缚一区二区三区视频| 欧洲视频一区二区| 国产精品久久久一本精品| 懂色av一区二区三区蜜臀| 欧美日韩精品欧美日韩精品一综合| 日本一区二区三区四区在线视频| 丝袜亚洲另类欧美| 色婷婷久久久亚洲一区二区三区| 久久久蜜桃精品| 免费看欧美美女黄的网站| 欧美在线视频全部完| 亚洲国产成人在线| 国产一区二区三区四区五区入口| 欧美精品自拍偷拍| 亚洲成人综合视频| 91免费版在线| 综合久久国产九一剧情麻豆| 国产主播一区二区三区| 欧美成人女星排行榜| 青娱乐精品视频| 欧美精品 国产精品| 亚洲国产成人av网| 欧美午夜电影网| 一区二区三区av电影| 色综合久久天天综合网| 亚洲女性喷水在线观看一区| 成av人片一区二区| 中文字幕中文乱码欧美一区二区| 国产精品一级黄| 久久噜噜亚洲综合| 成人午夜精品一区二区三区| 国产精品美女久久福利网站| 成人黄色小视频在线观看| 久久综合视频网| 午夜欧美在线一二页| 久久人人超碰精品| 欧美日韩激情一区| 欧美精品一卡两卡| 欧美最新大片在线看| 91小视频在线| 欧美性猛交xxxx乱大交退制版| 色综合天天在线| 欧美大度的电影原声| 亚洲色图都市小说| 91在线看国产| 亚洲成a人片在线不卡一二三区| 91精品办公室少妇高潮对白| 亚洲成人综合在线| 日韩亚洲欧美在线| 国产91高潮流白浆在线麻豆 | 国产精品66部| 国产欧美视频一区二区三区| 高清国产一区二区| 亚洲摸摸操操av| 日韩一区二区三| 成人激情动漫在线观看| 亚洲一区二区三区四区中文字幕| 欧美欧美欧美欧美首页| 国产一区二区在线电影| 亚洲欧美日韩在线| 精品三级在线观看| 99热国产精品| 久久国产精品72免费观看| 中文天堂在线一区| 欧美一级精品大片| 91亚洲永久精品| 狠狠色丁香婷综合久久| 亚洲伦理在线免费看| 欧美精品一区二区三| 色美美综合视频| 国产乱一区二区| 蜜桃视频在线观看一区| 亚洲另类色综合网站| 久久一夜天堂av一区二区三区 | 久久国产精品99久久人人澡| 亚洲欧洲韩国日本视频| 日韩一区二区电影| 色婷婷久久久综合中文字幕| 国产精品羞羞答答xxdd | 精品少妇一区二区三区在线视频 | 亚洲精品久久7777| 久久先锋资源网| 国产精品另类一区| 欧美大片国产精品| 欧美日韩五月天| 在线国产电影不卡| 成人高清视频在线| 国产成人在线网站| 免费av网站大全久久| 亚洲成在人线在线播放| 亚洲精品视频在线| 国产精品毛片a∨一区二区三区| 精品粉嫩超白一线天av| 69久久夜色精品国产69蝌蚪网| 色婷婷亚洲综合| 色噜噜狠狠色综合欧洲selulu| 国产不卡免费视频| 韩国成人在线视频| 久久国产人妖系列| 久久99国产乱子伦精品免费| 日韩精品免费视频人成| 午夜欧美视频在线观看| 午夜私人影院久久久久| 亚洲成a人v欧美综合天堂| 亚洲va韩国va欧美va| 亚洲综合色成人| 亚洲大片精品永久免费| 亚洲综合区在线| 日韩av二区在线播放| 日本欧美一区二区在线观看| 三级一区在线视频先锋| 日韩有码一区二区三区| 免费一区二区视频| 国产精品996| 豆国产96在线|亚洲| 99久久99久久精品免费观看| 成人av小说网| 一本色道a无线码一区v| 欧美性生交片4| 欧美日韩国产高清一区二区三区 | 91麻豆精品国产91久久久| 欧美片在线播放| 欧美成人精品1314www| 日韩午夜在线播放| 久久在线观看免费| 综合色天天鬼久久鬼色| 亚洲国产aⅴ成人精品无吗| 日韩国产精品91| 国产黄色成人av| 色婷婷香蕉在线一区二区| 欧美一区二区三区四区在线观看| 日韩欧美不卡一区| 中文字幕巨乱亚洲| 亚洲精品视频在线看| 琪琪一区二区三区| 成人少妇影院yyyy| 欧美丰满少妇xxxbbb| 中文字幕乱码日本亚洲一区二区| 亚洲综合激情另类小说区| 久久国内精品视频| 91久久免费观看| 久久蜜桃香蕉精品一区二区三区| 亚洲人成网站影音先锋播放| 久久激情五月激情| 一本一本大道香蕉久在线精品 | 精品少妇一区二区| 亚洲欧美一区二区三区孕妇| 九色porny丨国产精品| 99v久久综合狠狠综合久久| 欧美xxxxxxxx| 天堂av在线一区| 一本一道久久a久久精品综合蜜臀| 精品国产露脸精彩对白|