📄 awk.shar
字号:
-#define ARR 020 /* this is an array */-#define FCN 040 /* this is a function name */-#define FLD 0100 /* this is a field $1, $2, ... */-#define REC 0200 /* this is $0 */---/* function types */-#define FLENGTH 1-#define FSQRT 2-#define FEXP 3-#define FLOG 4-#define FINT 5-#define FSYSTEM 6-#define FRAND 7-#define FSRAND 8-#define FSIN 9-#define FCOS 10-#define FATAN 11-#define FTOUPPER 12-#define FTOLOWER 13-#define FFLUSH 14--/* Node: parse tree is made of nodes, with Cell's at bottom */--typedef struct Node {- int ntype;- struct Node *nnext;- int lineno;- int nobj;- struct Node *narg[1]; /* variable: actual size set by calling malloc */-} Node;--#define NIL ((Node *) 0)--extern Node *winner;-extern Node *nullstat;-extern Node *nullnode;--/* ctypes */-#define OCELL 1-#define OBOOL 2-#define OJUMP 3--/* Cell subtypes: csub */-#define CFREE 7-#define CCOPY 6-#define CCON 5-#define CTEMP 4-#define CNAME 3 -#define CVAR 2-#define CFLD 1-#define CUNK 0--/* bool subtypes */-#define BTRUE 11-#define BFALSE 12--/* jump subtypes */-#define JEXIT 21-#define JNEXT 22-#define JBREAK 23-#define JCONT 24-#define JRET 25-#define JNEXTFILE 26--/* node types */-#define NVALUE 1-#define NSTAT 2-#define NEXPR 3---extern int pairstack[], paircnt;--#define notlegal(n) (n <= FIRSTTOKEN || n >= LASTTOKEN || proctab[n-FIRSTTOKEN] == nullproc)-#define isvalue(n) ((n)->ntype == NVALUE)-#define isexpr(n) ((n)->ntype == NEXPR)-#define isjump(n) ((n)->ctype == OJUMP)-#define isexit(n) ((n)->csub == JEXIT)-#define isbreak(n) ((n)->csub == JBREAK)-#define iscont(n) ((n)->csub == JCONT)-#define isnext(n) ((n)->csub == JNEXT || (n)->csub == JNEXTFILE)-#define isret(n) ((n)->csub == JRET)-#define isrec(n) ((n)->tval & REC)-#define isfld(n) ((n)->tval & FLD)-#define isstr(n) ((n)->tval & STR)-#define isnum(n) ((n)->tval & NUM)-#define isarr(n) ((n)->tval & ARR)-#define isfcn(n) ((n)->tval & FCN)-#define istrue(n) ((n)->csub == BTRUE)-#define istemp(n) ((n)->csub == CTEMP)-#define isargument(n) ((n)->nobj == ARG)-/* #define freeable(p) (!((p)->tval & DONTFREE)) */-#define freeable(p) ( ((p)->tval & (STR|DONTFREE)) == STR )--/* structures used by regular expression matching machinery, mostly b.c: */--#define NCHARS (256+3) /* 256 handles 8-bit chars; 128 does 7-bit */- /* watch out in match(), etc. */-#define NSTATES 32--typedef struct rrow {- long ltype; /* long avoids pointer warnings on 64-bit */- union {- int i;- Node *np;- uschar *up;- } lval; /* because Al stores a pointer in it! */- int *lfollow;-} rrow;--typedef struct fa {- uschar gototab[NSTATES][NCHARS];- uschar out[NSTATES];- uschar *restr;- int *posns[NSTATES];- int anchor;- int use;- int initstat;- int curstat;- int accept;- int reset;- struct rrow re[1]; /* variable: actual size set by calling malloc */-} fa;---#include "proto.h"//GO.SYSIN DD awk.hecho ytab.c 1>&2sed 's/.//' >ytab.c <<'//GO.SYSIN DD ytab.c'-/* A Bison parser, made by GNU Bison 1.875. */--/* Skeleton parser for Yacc-like parsing with Bison,- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 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, 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. */--/* As a special exception, when this file is copied by Bison into a- Bison output file, you may use that output file without restriction.- This special exception was added by the Free Software Foundation- in version 1.24 of Bison. */--/* Written by Richard Stallman by simplifying the original so called- ``semantic'' parser. */--/* All symbols defined below should begin with yy or YY, to avoid- infringing on user name space. This should be done even for local- variables, as they might otherwise be expanded by user macros.- There are some unavoidable exceptions within include files to- define necessary library symbols; they are noted "INFRINGES ON- USER NAME SPACE" below. */--/* Identify Bison output. */-#define YYBISON 1--/* Skeleton name. */-#define YYSKELETON_NAME "yacc.c"--/* Pure parsers. */-#define YYPURE 0--/* Using locations. */-#define YYLSP_NEEDED 0----/* Tokens. */-#ifndef YYTOKENTYPE-# define YYTOKENTYPE- /* Put the tokens into the symbol table, so that GDB and other debuggers- know about them. */- enum yytokentype {- FIRSTTOKEN = 258,- PROGRAM = 259,- PASTAT = 260,- PASTAT2 = 261,- XBEGIN = 262,- XEND = 263,- NL = 264,- ARRAY = 265,- MATCH = 266,- NOTMATCH = 267,- MATCHOP = 268,- FINAL = 269,- DOT = 270,- ALL = 271,- CCL = 272,- NCCL = 273,- CHAR = 274,- OR = 275,- STAR = 276,- QUEST = 277,- PLUS = 278,- AND = 279,- BOR = 280,- APPEND = 281,- EQ = 282,- GE = 283,- GT = 284,- LE = 285,- LT = 286,- NE = 287,- IN = 288,- ARG = 289,- BLTIN = 290,- BREAK = 291,- CLOSE = 292,- CONTINUE = 293,- DELETE = 294,- DO = 295,- EXIT = 296,- FOR = 297,- FUNC = 298,- SUB = 299,- GSUB = 300,- IF = 301,- INDEX = 302,- LSUBSTR = 303,- MATCHFCN = 304,- NEXT = 305,- NEXTFILE = 306,- ADD = 307,- MINUS = 308,- MULT = 309,- DIVIDE = 310,- MOD = 311,- ASSIGN = 312,- ASGNOP = 313,- ADDEQ = 314,- SUBEQ = 315,- MULTEQ = 316,- DIVEQ = 317,- MODEQ = 318,- POWEQ = 319,- PRINT = 320,- PRINTF = 321,- SPRINTF = 322,- ELSE = 323,- INTEST = 324,- CONDEXPR = 325,- POSTINCR = 326,- PREINCR = 327,- POSTDECR = 328,- PREDECR = 329,- VAR = 330,- IVAR = 331,- VARNF = 332,- CALL = 333,- NUMBER = 334,- STRING = 335,- REGEXPR = 336,- GETLINE = 337,- SUBSTR = 338,- SPLIT = 339,- RETURN = 340,- WHILE = 341,- CAT = 342,- UMINUS = 343,- NOT = 344,- POWER = 345,- INCR = 346,- DECR = 347,- INDIRECT = 348,- LASTTOKEN = 349- };-#endif-#define FIRSTTOKEN 258-#define PROGRAM 259-#define PASTAT 260-#define PASTAT2 261-#define XBEGIN 262-#define XEND 263-#define NL 264-#define ARRAY 265-#define MATCH 266-#define NOTMATCH 267-#define MATCHOP 268-#define FINAL 269-#define DOT 270-#define ALL 271-#define CCL 272-#define NCCL 273-#define CHAR 274-#define OR 275-#define STAR 276-#define QUEST 277-#define PLUS 278-#define AND 279-#define BOR 280-#define APPEND 281-#define EQ 282-#define GE 283-#define GT 284-#define LE 285-#define LT 286-#define NE 287-#define IN 288-#define ARG 289-#define BLTIN 290-#define BREAK 291-#define CLOSE 292-#define CONTINUE 293-#define DELETE 294-#define DO 295-#define EXIT 296-#define FOR 297-#define FUNC 298-#define SUB 299-#define GSUB 300-#define IF 301-#define INDEX 302-#define LSUBSTR 303-#define MATCHFCN 304-#define NEXT 305-#define NEXTFILE 306-#define ADD 307-#define MINUS 308-#define MULT 309-#define DIVIDE 310-#define MOD 311-#define ASSIGN 312-#define ASGNOP 313-#define ADDEQ 314-#define SUBEQ 315-#define MULTEQ 316-#define DIVEQ 317-#define MODEQ 318-#define POWEQ 319-#define PRINT 320-#define PRINTF 321-#define SPRINTF 322-#define ELSE 323-#define INTEST 324-#define CONDEXPR 325-#define POSTINCR 326-#define PREINCR 327-#define POSTDECR 328-#define PREDECR 329-#define VAR 330-#define IVAR 331-#define VARNF 332-#define CALL 333-#define NUMBER 334-#define STRING 335-#define REGEXPR 336-#define GETLINE 337-#define SUBSTR 338-#define SPLIT 339-#define RETURN 340-#define WHILE 341-#define CAT 342-#define UMINUS 343-#define NOT 344-#define POWER 345
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -