XINU
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
y.tab.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stddef.h>
#include "lex.yy.c"
Include dependency graph for y.tab.c:

Go to the source code of this file.

Data Structures

struct  dev_ent
 
union  yyalloc
 

Macros

#define CLOSE   269
 
#define COLON   260
 
#define CONFC   "conf.c" /* Name of .c output */
 
#define CONFH   "conf.h" /* Name of .h output */
 
#define CONFHREF   "<conf.h>" /* How conf.h referenced */
 
#define CONTROL   273
 
#define CSR   264
 
#define DEFBRK   258
 
#define GETC   276
 
#define IDENT   263
 
#define IFBRK   259
 
#define INFILE   "Configuration" /* Name of input file */
 
#define INIT   267
 
#define INTEGER   262
 
#define INTR   266
 
#define IRQ   265
 
#define IS   274
 
#define MAXNAME   16 /* Max length of names */
 
#define NDEVS   250 /* Max devices */
 
#define NIL   (struct dev_ent *)0x00
 
#define NTYPES   250 /* Max device types */
 
#define OCTAL   261
 
#define ON   275
 
#define OPEN   268
 
#define PUTC   277
 
#define READ   270
 
#define SEEK   272
 
#define WRITE   271
 
#define YY_(Msgid)   Msgid
 
#define YY_ATTRIBUTE(Spec)   /* empty */
 
#define YY_ATTRIBUTE_PURE   YY_ATTRIBUTE ((__pure__))
 
#define YY_ATTRIBUTE_UNUSED   YY_ATTRIBUTE ((__unused__))
 
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
 
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
 
#define YY_INITIAL_VALUE(Value)   Value
 
#define YY_NULLPTR   ((void*)0)
 
#define YY_REDUCE_PRINT(Rule)
 
#define YY_STACK_PRINT(Bottom, Top)
 
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
 
#define YYABORT   goto yyabortlab
 
#define YYACCEPT   goto yyacceptlab
 
#define YYBACKUP(Token, Value)
 
#define YYBISON   1
 
#define YYBISON_VERSION   "3.3.2"
 
#define yyclearin   (yychar = YYEMPTY)
 
#define YYCOPY(Dst, Src, Count)
 
#define YYCOPY_NEEDED   1
 
#define YYDEBUG   0
 
#define YYDPRINTF(Args)
 
#define YYEMPTY   (-2)
 
#define YYEOF   0
 
#define YYERRCODE   256
 
#define yyerrok   (yyerrstatus = 0)
 
#define YYERROR   goto yyerrorlab
 
#define YYERROR_VERBOSE   0
 
#define YYFINAL   3
 
#define YYFREE   free
 
#define YYINITDEPTH   200
 
#define YYLAST   39
 
#define YYMALLOC   malloc
 
#define YYMAXDEPTH   10000
 
#define YYMAXUTOK   277
 
#define YYNNTS   20
 
#define YYNRULES   35
 
#define YYNSTATES   58
 
#define YYNTOKENS   23
 
#define YYPACT_NINF   -14
 
#define yypact_value_is_default(Yystate)   (!!((Yystate) == (-14)))
 
#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
 
#define YYPULL   1
 
#define YYPURE   0
 
#define YYPUSH   0
 
#define YYRECOVERING()   (!!yyerrstatus)
 
#define YYSIZE_MAXIMUM   ((YYSIZE_T) -1)
 
#define YYSIZE_T   size_t
 
#define YYSKELETON_NAME   "yacc.c"
 
#define YYSTACK_ALLOC   YYMALLOC
 
#define YYSTACK_ALLOC_MAXIMUM   YYSIZE_MAXIMUM
 
#define YYSTACK_BYTES(N)
 
#define YYSTACK_FREE   YYFREE
 
#define YYSTACK_GAP_MAXIMUM   (sizeof (union yyalloc) - 1)
 
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
 
#define YYSTYPE_IS_DECLARED   1
 
#define YYSTYPE_IS_TRIVIAL   1
 
#define YYTABLE_NINF   -1
 
#define yytable_value_is_error(Yytable_value)   0
 
#define YYTERROR   1
 
#define YYTOKENTYPE
 
#define YYTRANSLATE(YYX)   ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
 
#define YYUNDEFTOK   2
 
#define YYUSE(E)   ((void) (E))
 

Typedefs

typedef int YYSTYPE
 
typedef short yytype_int16
 
typedef signed char yytype_int8
 
typedef unsigned short yytype_uint16
 
typedef unsigned char yytype_uint8
 

Enumerations

enum  yytokentype {
  DEFBRK = 258, IFBRK = 259, COLON = 260, OCTAL = 261,
  INTEGER = 262, IDENT = 263, CSR = 264, IRQ = 265,
  INTR = 266, INIT = 267, OPEN = 268, CLOSE = 269,
  READ = 270, WRITE = 271, SEEK = 272, CONTROL = 273,
  IS = 274, ON = 275, GETC = 276, PUTC = 277
}
 

Functions

void addattr (int, int)
 
int addton (char *)
 
int config_atoi (char *, int)
 
void devisid (char *)
 
void devonid (char *)
 
void free (void *)
 
void getattrid (char *)
 
int main (int argc, char **argv)
 
void * malloc (YYSIZE_T)
 
void newdev (char *)
 
int newtype (char *)
 
static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
 
void yyerror (char *)
 
int yylex (void)
 
int yyparse (void)
 

Variables

int brkcount = 0
 
FILE * confc
 
FILE * confh
 
struct dev_ent devs [NDEVS]
 
char * devstab []
 
char * doing = "device type declarations"
 
struct dev_ent dtypes [NTYPES]
 
int linectr = 1
 
int ndevs = 0
 
int ntypes = 0
 
char saveattrid [MAXNAME]
 
int yychar
 
static const yytype_int8 yycheck []
 
static const yytype_uint8 yydefact []
 
static const yytype_int8 yydefgoto []
 
int yyleng
 
YYSTYPE yylval
 
int yynerrs
 
static const yytype_int8 yypact []
 
static const yytype_int8 yypgoto []
 
static const yytype_uint8 yyr1 []
 
static const yytype_uint8 yyr2 []
 
static const yytype_uint8 yystos []
 
static const yytype_uint8 yytable []
 
char * yytext
 
static const yytype_uint8 yytranslate []
 

Macro Definition Documentation

◆ CLOSE

#define CLOSE   269

Definition at line 249 of file y.tab.c.

Referenced by addattr(), and yyparse().

◆ COLON

#define COLON   260

Definition at line 240 of file y.tab.c.

◆ CONFC

#define CONFC   "conf.c" /* Name of .c output */

Definition at line 91 of file y.tab.c.

Referenced by main().

◆ CONFH

#define CONFH   "conf.h" /* Name of .h output */

Definition at line 92 of file y.tab.c.

Referenced by main().

◆ CONFHREF

#define CONFHREF   "<conf.h>" /* How conf.h referenced */

Definition at line 93 of file y.tab.c.

◆ CONTROL

#define CONTROL   273

Definition at line 253 of file y.tab.c.

Referenced by addattr(), and yyparse().

◆ CSR

#define CSR   264

Definition at line 244 of file y.tab.c.

Referenced by addattr(), and yyparse().

◆ DEFBRK

#define DEFBRK   258

Definition at line 238 of file y.tab.c.

◆ GETC

#define GETC   276

Definition at line 256 of file y.tab.c.

Referenced by addattr(), and yyparse().

◆ IDENT

#define IDENT   263

Definition at line 243 of file y.tab.c.

◆ IFBRK

#define IFBRK   259

Definition at line 239 of file y.tab.c.

◆ INFILE

#define INFILE   "Configuration" /* Name of input file */

Definition at line 94 of file y.tab.c.

Referenced by main().

◆ INIT

#define INIT   267

Definition at line 247 of file y.tab.c.

Referenced by addattr(), and yyparse().

◆ INTEGER

#define INTEGER   262

Definition at line 242 of file y.tab.c.

◆ INTR

#define INTR   266

Definition at line 246 of file y.tab.c.

Referenced by addattr(), and yyparse().

◆ IRQ

#define IRQ   265

Definition at line 245 of file y.tab.c.

Referenced by addattr(), and yyparse().

◆ IS

#define IS   274

Definition at line 254 of file y.tab.c.

◆ MAXNAME

#define MAXNAME   16 /* Max length of names */

Definition at line 95 of file y.tab.c.

Referenced by addton(), devisid(), devonid(), getattrid(), newdev(), and newtype().

◆ NDEVS

#define NDEVS   250 /* Max devices */

Definition at line 97 of file y.tab.c.

Referenced by newdev().

◆ NIL

#define NIL   (struct dev_ent *)0x00

Definition at line 89 of file y.tab.c.

◆ NTYPES

#define NTYPES   250 /* Max device types */

Definition at line 98 of file y.tab.c.

Referenced by newtype().

◆ OCTAL

#define OCTAL   261

Definition at line 241 of file y.tab.c.

◆ ON

#define ON   275

Definition at line 255 of file y.tab.c.

◆ OPEN

#define OPEN   268

Definition at line 248 of file y.tab.c.

Referenced by addattr(), and yyparse().

◆ PUTC

#define PUTC   277

Definition at line 257 of file y.tab.c.

Referenced by addattr(), and yyparse().

◆ READ

#define READ   270

Definition at line 250 of file y.tab.c.

Referenced by addattr(), and yyparse().

◆ SEEK

#define SEEK   272

Definition at line 252 of file y.tab.c.

Referenced by addattr(), and yyparse().

◆ WRITE

#define WRITE   271

Definition at line 251 of file y.tab.c.

Referenced by addattr(), and yyparse().

◆ YY_

#define YY_ (   Msgid)    Msgid

Definition at line 326 of file y.tab.c.

Referenced by yyparse().

◆ YY_ATTRIBUTE

#define YY_ATTRIBUTE (   Spec)    /* empty */

Definition at line 336 of file y.tab.c.

◆ YY_ATTRIBUTE_PURE

#define YY_ATTRIBUTE_PURE   YY_ATTRIBUTE ((__pure__))

Definition at line 341 of file y.tab.c.

◆ YY_ATTRIBUTE_UNUSED

#define YY_ATTRIBUTE_UNUSED   YY_ATTRIBUTE ((__unused__))

Definition at line 345 of file y.tab.c.

◆ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN

#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN

Definition at line 367 of file y.tab.c.

Referenced by yydestruct(), and yyparse().

◆ YY_IGNORE_MAYBE_UNINITIALIZED_END

#define YY_IGNORE_MAYBE_UNINITIALIZED_END

Definition at line 368 of file y.tab.c.

Referenced by yydestruct(), and yyparse().

◆ YY_INITIAL_VALUE

#define YY_INITIAL_VALUE (   Value)    Value

Definition at line 364 of file y.tab.c.

◆ YY_NULLPTR

#define YY_NULLPTR   ((void*)0)

Definition at line 189 of file y.tab.c.

◆ YY_REDUCE_PRINT

#define YY_REDUCE_PRINT (   Rule)

Definition at line 855 of file y.tab.c.

Referenced by yyparse().

◆ YY_STACK_PRINT

#define YY_STACK_PRINT (   Bottom,
  Top 
)

Definition at line 854 of file y.tab.c.

Referenced by yyparse().

◆ YY_SYMBOL_PRINT

#define YY_SYMBOL_PRINT (   Title,
  Type,
  Value,
  Location 
)

Definition at line 853 of file y.tab.c.

Referenced by yydestruct(), and yyparse().

◆ YYABORT

#define YYABORT   goto yyabortlab

Definition at line 700 of file y.tab.c.

Referenced by yyparse().

◆ YYACCEPT

#define YYACCEPT   goto yyacceptlab

Definition at line 699 of file y.tab.c.

Referenced by yyparse().

◆ YYBACKUP

#define YYBACKUP (   Token,
  Value 
)
Value:
{ \
yychar = (Token); \
yylval = (Value); \
YYPOPSTACK (yylen); \
yystate = *yyssp; \
goto yybackup; \
} \
else \
{ \
yyerror (YY_("syntax error: cannot back up")); \
YYERROR; \
} \
while (0)
#define YYEMPTY
Definition: y.tab.c:696
if(!(yy_init))
Definition: lex.yy.c:679
#define YY_(Msgid)
Definition: y.tab.c:326
int yychar
Definition: y.tab.c:1124

Definition at line 706 of file y.tab.c.

◆ YYBISON

#define YYBISON   1

Definition at line 48 of file y.tab.c.

◆ YYBISON_VERSION

#define YYBISON_VERSION   "3.3.2"

Definition at line 51 of file y.tab.c.

◆ yyclearin

#define yyclearin   (yychar = YYEMPTY)

Definition at line 695 of file y.tab.c.

◆ YYCOPY

#define YYCOPY (   Dst,
  Src,
  Count 
)
Value:
do \
{ \
YYSIZE_T yyi; \
for (yyi = 0; yyi < (Count); yyi++) \
(Dst)[yyi] = (Src)[yyi]; \
} \
while (0)

Definition at line 491 of file y.tab.c.

◆ YYCOPY_NEEDED

#define YYCOPY_NEEDED   1

Definition at line 463 of file y.tab.c.

◆ YYDEBUG

#define YYDEBUG   0

Definition at line 204 of file y.tab.c.

◆ YYDPRINTF

#define YYDPRINTF (   Args)

Definition at line 852 of file y.tab.c.

Referenced by yyparse().

◆ YYEMPTY

#define YYEMPTY   (-2)

Definition at line 696 of file y.tab.c.

Referenced by yyparse().

◆ YYEOF

#define YYEOF   0

Definition at line 697 of file y.tab.c.

Referenced by yyparse().

◆ YYERRCODE

#define YYERRCODE   256

Definition at line 725 of file y.tab.c.

◆ yyerrok

#define yyerrok   (yyerrstatus = 0)

Definition at line 694 of file y.tab.c.

◆ YYERROR

#define YYERROR   goto yyerrorlab

Definition at line 701 of file y.tab.c.

Referenced by yyparse().

◆ YYERROR_VERBOSE

#define YYERROR_VERBOSE   0

Definition at line 198 of file y.tab.c.

◆ YYFINAL

#define YYFINAL   3

Definition at line 504 of file y.tab.c.

Referenced by yyparse().

◆ YYFREE

#define YYFREE   free

Definition at line 434 of file y.tab.c.

◆ YYINITDEPTH

#define YYINITDEPTH   200

Definition at line 861 of file y.tab.c.

Referenced by yyparse().

◆ YYLAST

#define YYLAST   39

Definition at line 506 of file y.tab.c.

Referenced by yyparse().

◆ YYMALLOC

#define YYMALLOC   malloc

Definition at line 428 of file y.tab.c.

◆ YYMAXDEPTH

#define YYMAXDEPTH   10000

Definition at line 872 of file y.tab.c.

Referenced by yyparse().

◆ YYMAXUTOK

#define YYMAXUTOK   277

Definition at line 518 of file y.tab.c.

◆ YYNNTS

#define YYNNTS   20

Definition at line 511 of file y.tab.c.

◆ YYNRULES

#define YYNRULES   35

Definition at line 513 of file y.tab.c.

◆ YYNSTATES

#define YYNSTATES   58

Definition at line 515 of file y.tab.c.

◆ YYNTOKENS

#define YYNTOKENS   23

Definition at line 509 of file y.tab.c.

Referenced by yyparse().

◆ YYPACT_NINF

#define YYPACT_NINF   -14

Definition at line 595 of file y.tab.c.

◆ yypact_value_is_default

#define yypact_value_is_default (   Yystate)    (!!((Yystate) == (-14)))

Definition at line 597 of file y.tab.c.

Referenced by yyparse().

◆ YYPOPSTACK

#define YYPOPSTACK (   N)    (yyvsp -= (N), yyssp -= (N))

Referenced by yyparse().

◆ YYPULL

#define YYPULL   1

Definition at line 63 of file y.tab.c.

◆ YYPURE

#define YYPURE   0

Definition at line 57 of file y.tab.c.

◆ YYPUSH

#define YYPUSH   0

Definition at line 60 of file y.tab.c.

◆ YYRECOVERING

#define YYRECOVERING ( )    (!!yyerrstatus)

Definition at line 704 of file y.tab.c.

◆ YYSIZE_MAXIMUM

#define YYSIZE_MAXIMUM   ((YYSIZE_T) -1)

Definition at line 316 of file y.tab.c.

◆ YYSIZE_T

#define YYSIZE_T   size_t

Definition at line 310 of file y.tab.c.

Referenced by yyparse().

◆ YYSKELETON_NAME

#define YYSKELETON_NAME   "yacc.c"

Definition at line 54 of file y.tab.c.

◆ YYSTACK_ALLOC

#define YYSTACK_ALLOC   YYMALLOC

Definition at line 414 of file y.tab.c.

Referenced by yyparse().

◆ YYSTACK_ALLOC_MAXIMUM

#define YYSTACK_ALLOC_MAXIMUM   YYSIZE_MAXIMUM

Definition at line 417 of file y.tab.c.

◆ YYSTACK_BYTES

#define YYSTACK_BYTES (   N)
Value:
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
short yytype_int16
Definition: y.tab.c:300
int YYSTYPE
Definition: y.tab.c:261
#define YYSTACK_GAP_MAXIMUM
Definition: y.tab.c:455

Definition at line 459 of file y.tab.c.

Referenced by yyparse().

◆ YYSTACK_FREE

#define YYSTACK_FREE   YYFREE

Definition at line 415 of file y.tab.c.

Referenced by yyparse().

◆ YYSTACK_GAP_MAXIMUM

#define YYSTACK_GAP_MAXIMUM   (sizeof (union yyalloc) - 1)

Definition at line 455 of file y.tab.c.

◆ YYSTACK_RELOCATE

#define YYSTACK_RELOCATE (   Stack_alloc,
  Stack 
)
Value:
do \
{ \
YYSIZE_T yynewbytes; \
YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
Stack = &yyptr->Stack_alloc; \
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
yyptr += yynewbytes / sizeof (*yyptr); \
} \
while (0)
#define YYSTACK_GAP_MAXIMUM
Definition: y.tab.c:455

Definition at line 470 of file y.tab.c.

Referenced by yyparse().

◆ YYSTYPE_IS_DECLARED

#define YYSTYPE_IS_DECLARED   1

Definition at line 263 of file y.tab.c.

◆ YYSTYPE_IS_TRIVIAL

#define YYSTYPE_IS_TRIVIAL   1

Definition at line 262 of file y.tab.c.

◆ YYTABLE_NINF

#define YYTABLE_NINF   -1

Definition at line 600 of file y.tab.c.

◆ yytable_value_is_error

#define yytable_value_is_error (   Yytable_value)    0

Definition at line 602 of file y.tab.c.

Referenced by yyparse().

◆ YYTERROR

#define YYTERROR   1

Definition at line 724 of file y.tab.c.

Referenced by yyparse().

◆ YYTOKENTYPE

#define YYTOKENTYPE

Definition at line 212 of file y.tab.c.

◆ YYTRANSLATE

#define YYTRANSLATE (   YYX)    ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)

Definition at line 522 of file y.tab.c.

Referenced by yyparse().

◆ YYUNDEFTOK

#define YYUNDEFTOK   2

Definition at line 517 of file y.tab.c.

◆ YYUSE

#define YYUSE (   E)    ((void) (E))

Definition at line 350 of file y.tab.c.

Referenced by yydestruct().

Typedef Documentation

◆ YYSTYPE

typedef int YYSTYPE

Definition at line 261 of file y.tab.c.

◆ yytype_int16

typedef short yytype_int16

Definition at line 300 of file y.tab.c.

◆ yytype_int8

typedef signed char yytype_int8

Definition at line 288 of file y.tab.c.

◆ yytype_uint16

typedef unsigned short yytype_uint16

Definition at line 294 of file y.tab.c.

◆ yytype_uint8

typedef unsigned char yytype_uint8

Definition at line 282 of file y.tab.c.

Enumeration Type Documentation

◆ yytokentype

Enumerator
DEFBRK 
IFBRK 
COLON 
OCTAL 
INTEGER 
IDENT 
CSR 
IRQ 
INTR 
INIT 
OPEN 
CLOSE 
READ 
WRITE 
SEEK 
CONTROL 
IS 
ON 
GETC 
PUTC 

Definition at line 213 of file y.tab.c.

214  {
215  DEFBRK = 258,
216  IFBRK = 259,
217  COLON = 260,
218  OCTAL = 261,
219  INTEGER = 262,
220  IDENT = 263,
221  CSR = 264,
222  IRQ = 265,
223  INTR = 266,
224  INIT = 267,
225  OPEN = 268,
226  CLOSE = 269,
227  READ = 270,
228  WRITE = 271,
229  SEEK = 272,
230  CONTROL = 273,
231  IS = 274,
232  ON = 275,
233  GETC = 276,
234  PUTC = 277
235  };
#define GETC
Definition: y.tab.c:256
#define CSR
Definition: y.tab.c:244
#define INIT
Definition: y.tab.c:247
#define INTR
Definition: y.tab.c:246
#define READ
Definition: y.tab.c:250
#define OPEN
Definition: y.tab.c:248
#define OCTAL
Definition: y.tab.c:241
#define ON
Definition: y.tab.c:255
#define IFBRK
Definition: y.tab.c:239
#define SEEK
Definition: y.tab.c:252
#define IRQ
Definition: y.tab.c:245
#define CLOSE
Definition: y.tab.c:249
#define INTEGER
Definition: y.tab.c:242
#define COLON
Definition: y.tab.c:240
#define IDENT
Definition: y.tab.c:243
#define CONTROL
Definition: y.tab.c:253
#define WRITE
Definition: y.tab.c:251
#define DEFBRK
Definition: y.tab.c:238
#define IS
Definition: y.tab.c:254
#define PUTC
Definition: y.tab.c:257

Function Documentation

◆ addattr()

void addattr ( int  tok,
int  val 
)

Definition at line 1958 of file y.tab.c.

References brkcount, dev_ent::close, CLOSE, dev_ent::control, CONTROL, dev_ent::csr, CSR, devs, dtypes, fprintf(), dev_ent::getc, GETC, dev_ent::init, INIT, dev_ent::intr, INTR, dev_ent::irq, IRQ, ndevs, ntypes, dev_ent::open, OPEN, dev_ent::putc, PUTC, dev_ent::read, READ, saveattrid, dev_ent::seek, SEEK, stderr, strcpy(), dev_ent::write, and WRITE.

Referenced by yyparse().

1958  {
1959  struct dev_ent *s;
1960  char *c;
1961 
1962  if (brkcount == 0) {
1963  /* Doing types */
1964  s = &dtypes[ntypes-1];
1965  } else {
1966  /* Doing devices */
1967  s = &devs[ndevs-1];
1968  }
1969 
1970  switch (tok) {
1971  case CSR: s->csr = val; break;
1972  case IRQ: s->irq = val; break;
1973  case INTR: strcpy(s->intr, saveattrid); break;
1974  case READ: strcpy(s->read, saveattrid); break;
1975  case WRITE: strcpy(s->write,saveattrid); break;
1976  case GETC: strcpy(s->getc, saveattrid); break;
1977  case PUTC: strcpy(s->putc, saveattrid); break;
1978  case OPEN: strcpy(s->open, saveattrid); break;
1979  case CLOSE: strcpy(s->close,saveattrid); break;
1980  case INIT: strcpy(s->init, saveattrid); break;
1981  case SEEK: strcpy(s->seek, saveattrid); break;
1982  case CONTROL: strcpy(s->control,saveattrid); break;
1983  default: fprintf(stderr, "Internal error 1\n");
1984  }
1985 }
#define GETC
Definition: y.tab.c:256
#define CSR
Definition: y.tab.c:244
#define INIT
Definition: y.tab.c:247
char open[MAXNAME]
Definition: y.tab.c:118
#define INTR
Definition: y.tab.c:246
#define READ
Definition: y.tab.c:250
#define OPEN
Definition: y.tab.c:248
int csr
Definition: y.tab.c:114
int irq
Definition: y.tab.c:115
#define stderr
Definition: stdio.h:17
char seek[MAXNAME]
Definition: y.tab.c:123
int ntypes
Definition: y.tab.c:132
int ndevs
Definition: y.tab.c:135
char write[MAXNAME]
Definition: y.tab.c:121
Definition: y.tab.c:109
char getc[MAXNAME]
Definition: y.tab.c:124
#define SEEK
Definition: y.tab.c:252
char intr[MAXNAME]
Definition: y.tab.c:116
char init[MAXNAME]
Definition: y.tab.c:117
#define IRQ
Definition: y.tab.c:245
char saveattrid[MAXNAME]
Definition: y.tab.c:160
#define CLOSE
Definition: y.tab.c:249
char read[MAXNAME]
Definition: y.tab.c:120
int brkcount
Definition: y.tab.c:105
char putc[MAXNAME]
Definition: y.tab.c:125
int strcpy(char *tar, char *src)
文字列Aに文字列B(NULL終端を含めて)をコピーする。
Definition: strcpy.c:12
char close[MAXNAME]
Definition: y.tab.c:119
char control[MAXNAME]
Definition: y.tab.c:122
#define CONTROL
Definition: y.tab.c:253
int32 fprintf(int, char *,...)
Definition: fprintf.c:14
#define WRITE
Definition: y.tab.c:251
struct dev_ent dtypes[NTYPES]
Definition: y.tab.c:131
struct dev_ent devs[NDEVS]
Definition: y.tab.c:134
#define PUTC
Definition: y.tab.c:257
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addton()

int addton ( char *  tonid)

Definition at line 1994 of file y.tab.c.

References dtypes, exit(), fprintf(), dev_ent::ison, linectr, MAXNAME, ntypes, stderr, strcpy(), and strlen().

Referenced by yyparse().

1994  {
1995  int currtype; /* The current type */
1996 
1997  if (strlen(tonid) >= MAXNAME) {
1998  fprintf(stderr,"string %s is too long on line %d\n",
1999  tonid, linectr);
2000  exit(1);
2001  }
2002  currtype = ntypes - 1;
2003  strcpy(dtypes[currtype].ison, tonid);
2004 
2005  return currtype;
2006 }
#define stderr
Definition: stdio.h:17
int strlen(char *str)
NULL終端された文字列の長さを返す。NULL終端は長さに含まない。
Definition: strlen.c:11
int ntypes
Definition: y.tab.c:132
char ison[MAXNAME]
Definition: y.tab.c:112
void exit(void)
現在実行中のプロセスを終了させる。
Definition: exit.c:11
int linectr
Definition: y.tab.c:100
#define MAXNAME
Definition: y.tab.c:95
int strcpy(char *tar, char *src)
文字列Aに文字列B(NULL終端を含めて)をコピーする。
Definition: strcpy.c:12
int32 fprintf(int, char *,...)
Definition: fprintf.c:14
struct dev_ent dtypes[NTYPES]
Definition: y.tab.c:131
Here is the call graph for this function:
Here is the caller graph for this function:

◆ config_atoi()

int config_atoi ( char *  p,
int  len 
)

Definition at line 2016 of file y.tab.c.

References isdigit, and isupper.

Referenced by yyparse().

2016  {
2017  int base, rv;
2018 
2019  if (*p == '0')
2020  {
2021  ++p;
2022  --len;
2023  if (*p == 'x' || *p == 'X')
2024  {
2025  ++p; --len; /* skip 'x' */
2026  base = 16;
2027  }
2028  else
2029  {
2030  base = 8;
2031  }
2032  }
2033  else
2034  {
2035  base = 10;
2036  }
2037 
2038  rv = 0;
2039  for (; len > 0; ++p, --len)
2040  {
2041  rv *= base;
2042  if (isdigit(*p)) { rv += *p - '0'; }
2043  else if (isupper(*p)) { rv += *p - 'A' + 10; }
2044  else { rv += *p - 'a' + 10; }
2045  }
2046 
2047  return rv;
2048 }
#define isdigit(c)
文字が10進数の数字かどうかをチェックするマクロ
Definition: ctype.h:78
#define isupper(c)
文字がアルファベットの大文字かどうかをチェックするマクロ
Definition: ctype.h:62
Here is the caller graph for this function:

◆ devisid()

void devisid ( char *  tname)

Definition at line 2056 of file y.tab.c.

References devs, dtypes, exit(), fprintf(), linectr, MAXNAME, ndevs, ntypes, stderr, strcmp(), strcpy(), and strlen().

Referenced by yyparse().

2056  {
2057  int currdev; /* The current device */
2058  int i;
2059 
2060  if (strlen(tname) >= MAXNAME) {
2061  fprintf(stderr,"string %s is too long on line %d\n",
2062  tname, linectr);
2063  exit(1);
2064  }
2065  /* Verify the type exists */
2066 
2067  for (i=0; i<ntypes; i++) {
2068  if (strcmp(tname, dtypes[i].tname) == 0) {
2069  break;
2070  }
2071  }
2072  if (i >= ntypes) {
2073  fprintf(stderr, "Illegal type name %s on line %d\n",
2074  tname, linectr);
2075  exit(1);
2076  }
2077  currdev = ndevs - 1;
2078  strcpy(devs[currdev].tname, tname);
2079 
2080  return;
2081 }
#define stderr
Definition: stdio.h:17
int strlen(char *str)
NULL終端された文字列の長さを返す。NULL終端は長さに含まない。
Definition: strlen.c:11
int ntypes
Definition: y.tab.c:132
int ndevs
Definition: y.tab.c:135
void exit(void)
現在実行中のプロセスを終了させる。
Definition: exit.c:11
int linectr
Definition: y.tab.c:100
#define MAXNAME
Definition: y.tab.c:95
char tname[MAXNAME]
Definition: y.tab.c:111
int strcpy(char *tar, char *src)
文字列Aに文字列B(NULL終端を含めて)をコピーする。
Definition: strcpy.c:12
int32 fprintf(int, char *,...)
Definition: fprintf.c:14
struct dev_ent dtypes[NTYPES]
Definition: y.tab.c:131
struct dev_ent devs[NDEVS]
Definition: y.tab.c:134
int strcmp(char *str1, char *str2)
二つの文字列を比較し、その結果を返す。
Definition: strcmp.c:12
Here is the call graph for this function:
Here is the caller graph for this function:

◆ devonid()

void devonid ( char *  onname)

Definition at line 2091 of file y.tab.c.

References devs, dtypes, exit(), fprintf(), dev_ent::ison, linectr, MAXNAME, dev_ent::minor, dev_ent::name, ndevs, ntypes, stderr, strcmp(), strcpy(), strlen(), and dev_ent::tname.

Referenced by yyparse().

2091  {
2092  int currdev; /* The current device */
2093  int i;
2094  struct dev_ent *dptr; /* Pointer to current device */
2095  struct dev_ent *tptr; /* Pointer to a type */
2096  char tmp[MAXNAME]; /* Holds the device name during */
2097  /* copy */
2098 
2099  if (strlen(onname) >= MAXNAME) {
2100  fprintf(stderr,"string %s is too long on line %d\n",
2101  onname, linectr);
2102  exit(1);
2103  }
2104  if (ndevs <=0) {
2105  fprintf(stderr,"Internal error 3\n");
2106  exit(1);
2107  }
2108  currdev = ndevs - 1;
2109  dptr = &devs[currdev];
2110 
2111  strcpy(dptr->ison, onname);
2112 
2113  /* Lookup the device type */
2114 
2115  for (i=0; i<ntypes; i++) {
2116  tptr = &dtypes[i];
2117  if ( (strcmp(dptr->tname,tptr->tname) == 0 ) &&
2118  (strcmp(dptr->ison, tptr->ison) == 0 ) ){
2119 
2120  /* The specified type matches the ith entry, so */
2121  /* set all attributes equal to the ones in the */
2122  /* type definition. */
2123 
2124  strcpy(tmp, dptr->name);
2125  bcopy (tptr, dptr, sizeof(struct dev_ent));
2126  /* Increment the minor device number for the */
2127  /* next time the type is used */
2128  tptr->minor++;
2129  strcpy(dptr->name, tmp);
2130  return;
2131  }
2132  }
2133 
2134  fprintf(stderr, "Ileagal device specification on line %d\n", linectr);
2135  exit(1);
2136 }
char name[MAXNAME]
Definition: y.tab.c:110
#define stderr
Definition: stdio.h:17
int strlen(char *str)
NULL終端された文字列の長さを返す。NULL終端は長さに含まない。
Definition: strlen.c:11
int ntypes
Definition: y.tab.c:132
int ndevs
Definition: y.tab.c:135
char ison[MAXNAME]
Definition: y.tab.c:112
Definition: y.tab.c:109
int minor
Definition: y.tab.c:126
void exit(void)
現在実行中のプロセスを終了させる。
Definition: exit.c:11
int linectr
Definition: y.tab.c:100
#define MAXNAME
Definition: y.tab.c:95
char tname[MAXNAME]
Definition: y.tab.c:111
int strcpy(char *tar, char *src)
文字列Aに文字列B(NULL終端を含めて)をコピーする。
Definition: strcpy.c:12
int32 fprintf(int, char *,...)
Definition: fprintf.c:14
struct dev_ent dtypes[NTYPES]
Definition: y.tab.c:131
struct dev_ent devs[NDEVS]
Definition: y.tab.c:134
int strcmp(char *str1, char *str2)
二つの文字列を比較し、その結果を返す。
Definition: strcmp.c:12
Here is the call graph for this function:
Here is the caller graph for this function:

◆ free()

void free ( void *  )

◆ getattrid()

void getattrid ( char *  str)

Definition at line 2145 of file y.tab.c.

References exit(), fprintf(), linectr, MAXNAME, saveattrid, stderr, strcpy(), and strlen().

Referenced by yyparse().

2145  {
2146 
2147  if (strlen(str) >= MAXNAME) {
2148  fprintf(stderr,"atribute string %s is too long on line %d\n",
2149  str, linectr);
2150  exit(1);
2151  }
2152  strcpy(saveattrid, str);
2153  return;
2154 }
#define stderr
Definition: stdio.h:17
int strlen(char *str)
NULL終端された文字列の長さを返す。NULL終端は長さに含まない。
Definition: strlen.c:11
void exit(void)
現在実行中のプロセスを終了させる。
Definition: exit.c:11
int linectr
Definition: y.tab.c:100
#define MAXNAME
Definition: y.tab.c:95
char saveattrid[MAXNAME]
Definition: y.tab.c:160
int strcpy(char *tar, char *src)
文字列Aに文字列B(NULL終端を含めて)をコピーする。
Definition: strcpy.c:12
int32 fprintf(int, char *,...)
Definition: fprintf.c:14
Here is the call graph for this function:
Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 1753 of file y.tab.c.

References brkcount, dev_ent::close, CONFC, confc, CONFH, confh, dev_ent::control, dev_ent::csr, devs, devstab, dtypes, exit(), fprintf(), dev_ent::getc, INFILE, dev_ent::init, input(), dev_ent::intr, dev_ent::irq, dev_ent::ison, dev_ent::minor, dev_ent::name, ndevs, ntypes, NULL, dev_ent::open, printf(), dev_ent::putc, dev_ent::read, dev_ent::seek, stderr, stdin, strncmp(), dev_ent::tname, dev_ent::write, and yyparse().

1753  {
1754  int n, i, j, l, fcount;
1755  struct dev_ent *s;
1756  int verbose = 0;
1757  char *p;
1758  int c;
1759 
1760  if ( argc > 1 && (strncmp("-v", argv[1], 2) == 0) ) {
1761  argc--;
1762  argv++;
1763  verbose++;
1764  }
1765 
1766  if ( argc > 4 ) {
1767  fprintf(stderr, "use: config [-v] [input_file] [conf.c] [conf.h]\n");
1768  exit(1);
1769  }
1770 
1771  if (verbose) { printf("Opening input file...\n"); }
1772 
1773  if (argc >= 2) {
1774  if (freopen(argv[1], "r", stdin) == NULL) {
1775  fprintf(stderr, "Can't open %s\n", argv[1]);
1776  exit(1);
1777  }
1778  }
1779  else { /* try to open Configuration file */
1780  if (freopen(INFILE, "r", stdin) == NULL) {
1781  fprintf(stderr, "Can't open %s\n", INFILE);
1782  exit(1);
1783  }
1784  }
1785 
1786  /****************************************************************/
1787  /* */
1788  /* Parse the Configuration file */
1789  /* */
1790  /****************************************************************/
1791 
1792 
1793  if (verbose) { printf("Parsing configuration specs...\n"); }
1794 
1795  if ( (n = yyparse()) != 0 ) { exit(n); }
1796 
1797  /* Open conf.h and conf.c for writing */
1798 
1799  if (verbose) { printf("Opening output files...\n"); }
1800 
1801  if (argc >= 3) {
1802  if ( (confc = fopen(argv[2],"w") ) == NULL) {
1803  fprintf(stderr, "Can't write on %s\n", argv[2]);
1804  exit(1);
1805  }
1806  }
1807  else { /* try to open conf.c file */
1808  if ( (confc = fopen(CONFC,"w") ) == NULL) {
1809  fprintf(stderr, "Can't write on %s\n", CONFC);
1810  exit(1);
1811  }
1812  }
1813 
1814  if (argc >= 4) {
1815  if ( (confh = fopen(argv[3],"w") ) == NULL) {
1816  fprintf(stderr, "Can't write on %s\n", argv[3]);
1817  exit(1);
1818  }
1819  }
1820  else { /* try to open conf.h file */
1821  if ( (confh = fopen(CONFH,"w") ) == NULL) {
1822  fprintf(stderr, "Can't write on %s\n", CONFH);
1823  exit(1);
1824  }
1825  }
1826 
1827  /****************************************************************/
1828  /* */
1829  /* produce conf.h */
1830  /* */
1831  /****************************************************************/
1832 
1833 
1834  fprintf(confh, "/* conf.h (GENERATED FILE; DO NOT EDIT) */\n\n");
1835 
1836  if (verbose) { printf("Writing output...\n"); }
1837 
1838  fprintf(confh, "/* Device switch table declarations */\n\n");
1839 
1840  for (i = 0; (p = devstab[i]) != NULL; i++) {
1841  fprintf(confh, "%s\n", p);
1842  }
1843 
1844  fprintf(confh, "\n");
1845 
1846  /* write device declarations and definitions */
1847 
1848  fprintf(confh, "/* Device name definitions */\n\n");
1849  for (i = 0; i<ndevs; i++) {
1850  s = &devs[i];
1851  fprintf(confh, "#define %-20s%2d\t/* type %-8s */\n",
1852  s->name, i, s->tname);
1853  }
1854  fprintf(confh, "\n");
1855 
1856  /* write count of device types */
1857 
1858  fprintf(confh, "/* Control block sizes */\n\n");
1859  for (i = 0; i < ntypes; i++) {
1860  s = &dtypes[i];
1861  if (s->minor > 0) {
1862  fprintf(confh, "#define\tN%s\t%d\n",
1863  s->tname, s->minor);
1864  }
1865  }
1866 
1867  fprintf(confh, "\n");
1868 
1869  if (ndevs > 0) { fprintf(confh, "#define NDEVS %d\n", ndevs); }
1870 
1871  /* Copy definitions to output */
1872 
1873  if (brkcount >= 4 && verbose) {
1874  printf("Copying definitions to %s...\n", CONFH);
1875  }
1876 
1877  if (brkcount >= 2) {
1878  while ( (c = input()) > 0) { /* lex input function */
1879  putc(c, confh);
1880  }
1881  }
1882  fclose(confh);
1883 
1884 
1885  /****************************************************************/
1886  /* */
1887  /* produce conf.c */
1888  /* */
1889  /****************************************************************/
1890 
1891 
1892  fprintf(confc, "/* conf.c (GENERATED FILE; DO NOT EDIT) */\n\n");
1893  fprintf(confc, "#include <xinu.h>\n\n");
1894  fprintf(confc, "\n");
1895 
1896  fprintf(confc, "extern\tdevcall\tioerr(void);\n");
1897  fprintf(confc, "extern\tdevcall\tionull(void);\n\n");
1898 
1899  /* produce devtab (giant I/O switch table) */
1900  fprintf(confc, "/* Device independent I/O switch */\n\n");
1901  if (ndevs > 0)
1902  {
1903  fprintf(confc, "struct dentry devtab[NDEVS] =\n{\n");
1904  fprintf(confc, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n\n",
1905  "/**",
1906  " * Format of entries is:",
1907  " * dev-number, minor-number, dev-name,",
1908  " * init, open, close,",
1909  " * read, write, seek,",
1910  " * getc, putc, control,",
1911  " * dev-csr-address, intr-handler, irq",
1912  " */");
1913  }
1914 
1915  for (i=0; i<ndevs; i++) {
1916  s = &devs[i];
1917  fprintf(confc, "/* %s is %s */\n", s->name, s->tname);
1918  fprintf(confc, "\t{ %d, %d, \"%s\",\n", i, s->minor, s->name);
1919  fprintf(confc, "\t (void *)%s, (void *)%s, (void *)%s,\n",
1920  s->init, s->open, s->close);
1921  fprintf(confc, "\t (void *)%s, (void *)%s, (void *)%s,\n",
1922  s->read, s->write, s->seek);
1923  fprintf(confc, "\t (void *)%s, (void *)%s, (void *)%s,\n",
1924  s->getc, s->putc, s->control);
1925  fprintf(confc, "\t (void *)0x%x, (void *)%s, %d }",
1926  s->csr, s->intr, s->irq);
1927  if (i< ndevs-1) {
1928  fprintf(confc, ",\n\n");
1929  } else {
1930  fprintf(confc, "\n};");
1931  }
1932  }
1933 
1934  /* we must guarantee conf.c written later than conf.h for make */
1935  fprintf(confc, "\n");
1936  fclose(confc);
1937 
1938  /* finish up and write report for user if requested */
1939  if (verbose) {
1940  printf("Configuration complete. Number of devs=%d:\n", ndevs);
1941  for (i=0; i<ndevs; i++) {
1942  s = &devs[i];
1943  printf("Device %s (on %s)\n", s->name, s->ison);
1944  printf(" csr=0x%04x, irq=0x%04x, minor=%d\n",
1945  s->csr, s->irq, s->minor);
1946  }
1947  }
1948 }
#define NULL
連結リスト用のNULLポインタ
Definition: kernel.h:68
#define INFILE
Definition: y.tab.c:94
int32 strncmp(const char *, const char *, int32)
FILE * confc
Definition: y.tab.c:102
char open[MAXNAME]
Definition: y.tab.c:118
char name[MAXNAME]
Definition: y.tab.c:110
#define CONFC
Definition: y.tab.c:91
int csr
Definition: y.tab.c:114
int irq
Definition: y.tab.c:115
#define stderr
Definition: stdio.h:17
char seek[MAXNAME]
Definition: y.tab.c:123
int ntypes
Definition: y.tab.c:132
static int input(void)
int ndevs
Definition: y.tab.c:135
char write[MAXNAME]
Definition: y.tab.c:121
int32 printf(const char *,...)
Definition: printf.c:13
char ison[MAXNAME]
Definition: y.tab.c:112
Definition: y.tab.c:109
int minor
Definition: y.tab.c:126
void exit(void)
現在実行中のプロセスを終了させる。
Definition: exit.c:11
char getc[MAXNAME]
Definition: y.tab.c:124
syscall putc(did32, char)
デバイスへ文字1Byteを送信する。
Definition: putc.c:18
char intr[MAXNAME]
Definition: y.tab.c:116
int yyparse(void)
Definition: y.tab.c:1137
char init[MAXNAME]
Definition: y.tab.c:117
char tname[MAXNAME]
Definition: y.tab.c:111
char * devstab[]
Definition: y.tab.c:137
char read[MAXNAME]
Definition: y.tab.c:120
#define CONFH
Definition: y.tab.c:92
int brkcount
Definition: y.tab.c:105
FILE * confh
Definition: y.tab.c:103
#define stdin
Definition: stdio.h:15
char putc[MAXNAME]
Definition: y.tab.c:125
char close[MAXNAME]
Definition: y.tab.c:119
char control[MAXNAME]
Definition: y.tab.c:122
int32 fprintf(int, char *,...)
Definition: fprintf.c:14
struct dev_ent dtypes[NTYPES]
Definition: y.tab.c:131
struct dev_ent devs[NDEVS]
Definition: y.tab.c:134
Here is the call graph for this function:

◆ malloc()

void* malloc ( YYSIZE_T  )

◆ newdev()

void newdev ( char *  name)

Definition at line 2163 of file y.tab.c.

References bzero(), devs, exit(), fprintf(), linectr, MAXNAME, NDEVS, ndevs, stderr, strcmp(), strcpy(), and strlen().

Referenced by nammap(), namopen(), and yyparse().

2163  {
2164 
2165  struct dev_ent *dptr; /* Ptr. to an entry in devs */
2166  int i;
2167 
2168  if (ndevs >= NDEVS) {
2169  fprintf(stderr,"Too many devices on line %d", linectr);
2170  exit(1);
2171  }
2172  if (strlen(name) >= MAXNAME) {
2173  fprintf(stderr,"Device name %s is too long on line %d\n",
2174  name, linectr);
2175  exit(1);
2176  }
2177 
2178  /* Verify that the device name is unique */
2179 
2180  for (i=0; i<ndevs; i++) {
2181  if (strcmp(name, devs[i].name) == 0) {
2182  fprintf(stderr, "Duplicate device name %s on line %d\n",
2183  name, linectr);
2184  exit(1);
2185  }
2186  }
2187 
2188  dptr = &devs[ndevs];
2189 
2190  /* Initialize fields in the entry */
2191 
2192  bzero((void *)dptr, sizeof(struct dev_ent));
2193  strcpy(dptr->name, name);
2194  ndevs++;
2195  return;
2196 }
char name[MAXNAME]
Definition: y.tab.c:110
#define stderr
Definition: stdio.h:17
int strlen(char *str)
NULL終端された文字列の長さを返す。NULL終端は長さに含まない。
Definition: strlen.c:11
int ndevs
Definition: y.tab.c:135
Definition: y.tab.c:109
void exit(void)
現在実行中のプロセスを終了させる。
Definition: exit.c:11
int linectr
Definition: y.tab.c:100
#define MAXNAME
Definition: y.tab.c:95
int strcpy(char *tar, char *src)
文字列Aに文字列B(NULL終端を含めて)をコピーする。
Definition: strcpy.c:12
#define NDEVS
Definition: y.tab.c:97
void bzero(void *, int)
Byteブロック領域の先頭N bytesを数値ゼロで埋める。
Definition: bzero.c:12
int32 fprintf(int, char *,...)
Definition: fprintf.c:14
struct dev_ent devs[NDEVS]
Definition: y.tab.c:134
int strcmp(char *str1, char *str2)
二つの文字列を比較し、その結果を返す。
Definition: strcmp.c:12
Here is the call graph for this function:
Here is the caller graph for this function:

◆ newtype()

int newtype ( char *  name)

Definition at line 2205 of file y.tab.c.

References bzero(), dtypes, exit(), fprintf(), linectr, MAXNAME, NTYPES, ntypes, stderr, strcmp(), strcpy(), strlen(), strncpy(), and dev_ent::tname.

Referenced by yyparse().

2205  {
2206 
2207  struct dev_ent *dptr; /* Ptr. to an entry in dtypes */
2208  int i; /* Index into the type table */
2209 
2210  if (ntypes >= NTYPES) {
2211  fprintf(stderr,"Too many types on line %d", linectr);
2212  exit(1);
2213  }
2214  if (strlen(name) >= MAXNAME) {
2215  fprintf(stderr,"Type name %s is too long on line %d\n",
2216  name, linectr);
2217  exit(1);
2218  }
2219 
2220  /* Verify that the type name is unique */
2221 
2222  for (i=0; i<ntypes; i++) {
2223  if (strcmp(name, dtypes[i].tname) == 0) {
2224  fprintf(stderr, "Duplicate type name %s on line %d\n",
2225  name, linectr);
2226  exit(1);
2227  }
2228  }
2229 
2230  dptr = &dtypes[ntypes];
2231 
2232  /* Initialize fields in the entry */
2233 
2234  bzero((void *)dptr, sizeof(struct dev_ent));
2235  strcpy(dptr->tname, name);
2236  strncpy(dptr->intr, "ioerr", 5);
2237  strncpy(dptr->init, "ioerr", 5);
2238  strncpy(dptr->open, "ioerr", 5);
2239  strncpy(dptr->close, "ioerr", 5);
2240  strncpy(dptr->read, "ioerr", 5);
2241  strncpy(dptr->write, "ioerr", 5);
2242  strncpy(dptr->control, "ioerr", 5);
2243  strncpy(dptr->seek, "ioerr", 5);
2244  strncpy(dptr->getc, "ioerr", 5);
2245  strncpy(dptr->putc, "ioerr", 5);
2246 
2247  return ntypes++;
2248 }
char * strncpy(char *, const char *, int32)
文字列s1に文字列s2をN文字(Byte)分コピーする。
Definition: strncpy.c:15
char name[MAXNAME]
Definition: y.tab.c:110
#define stderr
Definition: stdio.h:17
int strlen(char *str)
NULL終端された文字列の長さを返す。NULL終端は長さに含まない。
Definition: strlen.c:11
int ntypes
Definition: y.tab.c:132
Definition: y.tab.c:109
void exit(void)
現在実行中のプロセスを終了させる。
Definition: exit.c:11
int linectr
Definition: y.tab.c:100
#define MAXNAME
Definition: y.tab.c:95
char tname[MAXNAME]
Definition: y.tab.c:111
int strcpy(char *tar, char *src)
文字列Aに文字列B(NULL終端を含めて)をコピーする。
Definition: strcpy.c:12
void bzero(void *, int)
Byteブロック領域の先頭N bytesを数値ゼロで埋める。
Definition: bzero.c:12
int32 fprintf(int, char *,...)
Definition: fprintf.c:14
struct dev_ent dtypes[NTYPES]
Definition: y.tab.c:131
int strcmp(char *str1, char *str2)
二つの文字列を比較し、その結果を返す。
Definition: strcmp.c:12
#define NTYPES
Definition: y.tab.c:98
Here is the call graph for this function:
Here is the caller graph for this function:

◆ yydestruct()

static void yydestruct ( const char *  yymsg,
int  yytype,
YYSTYPE yyvaluep 
)
static

Definition at line 1108 of file y.tab.c.

References YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN, YY_IGNORE_MAYBE_UNINITIALIZED_END, YY_SYMBOL_PRINT, and YYUSE.

Referenced by yyparse().

1109 {
1110  YYUSE (yyvaluep);
1111  if (!yymsg)
1112  yymsg = "Deleting";
1113  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1114 
1116  YYUSE (yytype);
1118 }
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
Definition: y.tab.c:368
#define YYUSE(E)
Definition: y.tab.c:350
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Definition: y.tab.c:367
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
Definition: y.tab.c:853
Here is the caller graph for this function:

◆ yyerror()

void yyerror ( char *  s)

Definition at line 2257 of file y.tab.c.

References doing, fprintf(), linectr, and stderr.

Referenced by yyparse().

2257  {
2258 
2259  fprintf(stderr, "Syntax error in %s on line %d\n", doing, linectr);
2260 }
#define stderr
Definition: stdio.h:17
int linectr
Definition: y.tab.c:100
char * doing
Definition: y.tab.c:107
int32 fprintf(int, char *,...)
Definition: fprintf.c:14
Here is the call graph for this function:
Here is the caller graph for this function:

◆ yylex()

int yylex ( void  )

Referenced by yyparse().

Here is the caller graph for this function:

◆ yyparse()

int yyparse ( void  )

Definition at line 1137 of file y.tab.c.

References addattr(), addton(), CLOSE, config_atoi(), CONTROL, CSR, devisid(), devonid(), doing, getattrid(), GETC, INIT, INTR, IRQ, newdev(), newtype(), OPEN, PUTC, READ, SEEK, stderr, WRITE, YY_, YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN, YY_IGNORE_MAYBE_UNINITIALIZED_END, YY_REDUCE_PRINT, YY_STACK_PRINT, YY_SYMBOL_PRINT, YYABORT, YYACCEPT, yychar, yycheck, yydefact, yydefgoto, yydestruct(), YYDPRINTF, YYEMPTY, YYEOF, yyerror(), YYERROR, YYFINAL, YYINITDEPTH, YYLAST, yyleng, yylex(), yylval, YYMAXDEPTH, yynerrs, YYNTOKENS, yypact, yypact_value_is_default, yypgoto, YYPOPSTACK, yyr1, yyr2, YYSIZE_T, yyalloc::yyss_alloc, YYSTACK_ALLOC, YYSTACK_BYTES, YYSTACK_FREE, YYSTACK_RELOCATE, yystos, yytable, yytable_value_is_error, YYTERROR, yytext, YYTRANSLATE, and yyalloc::yyvs_alloc.

Referenced by main().

1138 {
1139  int yystate;
1140  /* Number of tokens to shift before error messages enabled. */
1141  int yyerrstatus;
1142 
1143  /* The stacks and their tools:
1144  'yyss': related to states.
1145  'yyvs': related to semantic values.
1146 
1147  Refer to the stacks through separate pointers, to allow yyoverflow
1148  to reallocate them elsewhere. */
1149 
1150  /* The state stack. */
1151  yytype_int16 yyssa[YYINITDEPTH];
1152  yytype_int16 *yyss;
1153  yytype_int16 *yyssp;
1154 
1155  /* The semantic value stack. */
1156  YYSTYPE yyvsa[YYINITDEPTH];
1157  YYSTYPE *yyvs;
1158  YYSTYPE *yyvsp;
1159 
1160  YYSIZE_T yystacksize;
1161 
1162  int yyn;
1163  int yyresult;
1164  /* Lookahead token as an internal (translated) token number. */
1165  int yytoken = 0;
1166  /* The variables used to return semantic value and location from the
1167  action routines. */
1168  YYSTYPE yyval;
1169 
1170 #if YYERROR_VERBOSE
1171  /* Buffer for error messages, and its allocated size. */
1172  char yymsgbuf[128];
1173  char *yymsg = yymsgbuf;
1174  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1175 #endif
1176 
1177 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1178 
1179  /* The number of symbols on the RHS of the reduced rule.
1180  Keep to zero when no symbol should be popped. */
1181  int yylen = 0;
1182 
1183  yyssp = yyss = yyssa;
1184  yyvsp = yyvs = yyvsa;
1185  yystacksize = YYINITDEPTH;
1186 
1187  YYDPRINTF ((stderr, "Starting parse\n"));
1188 
1189  yystate = 0;
1190  yyerrstatus = 0;
1191  yynerrs = 0;
1192  yychar = YYEMPTY; /* Cause a token to be read. */
1193  goto yysetstate;
1194 
1195 
1196 /*------------------------------------------------------------.
1197 | yynewstate -- push a new state, which is found in yystate. |
1198 `------------------------------------------------------------*/
1199 yynewstate:
1200  /* In all cases, when you get here, the value and location stacks
1201  have just been pushed. So pushing a state here evens the stacks. */
1202  yyssp++;
1203 
1204 
1205 /*--------------------------------------------------------------------.
1206 | yynewstate -- set current state (the top of the stack) to yystate. |
1207 `--------------------------------------------------------------------*/
1208 yysetstate:
1209  *yyssp = (yytype_int16) yystate;
1210 
1211  if (yyss + yystacksize - 1 <= yyssp)
1212 #if !defined yyoverflow && !defined YYSTACK_RELOCATE
1213  goto yyexhaustedlab;
1214 #else
1215  {
1216  /* Get the current used size of the three stacks, in elements. */
1217  YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1);
1218 
1219 # if defined yyoverflow
1220  {
1221  /* Give user a chance to reallocate the stack. Use copies of
1222  these so that the &'s don't force the real ones into
1223  memory. */
1224  YYSTYPE *yyvs1 = yyvs;
1225  yytype_int16 *yyss1 = yyss;
1226 
1227  /* Each stack pointer address is followed by the size of the
1228  data in use in that stack, in bytes. This used to be a
1229  conditional around just the two extra args, but that might
1230  be undefined if yyoverflow is a macro. */
1231  yyoverflow (YY_("memory exhausted"),
1232  &yyss1, yysize * sizeof (*yyssp),
1233  &yyvs1, yysize * sizeof (*yyvsp),
1234  &yystacksize);
1235  yyss = yyss1;
1236  yyvs = yyvs1;
1237  }
1238 # else /* defined YYSTACK_RELOCATE */
1239  /* Extend the stack our own way. */
1240  if (YYMAXDEPTH <= yystacksize)
1241  goto yyexhaustedlab;
1242  yystacksize *= 2;
1243  if (YYMAXDEPTH < yystacksize)
1244  yystacksize = YYMAXDEPTH;
1245 
1246  {
1247  yytype_int16 *yyss1 = yyss;
1248  union yyalloc *yyptr =
1249  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1250  if (! yyptr)
1251  goto yyexhaustedlab;
1252  YYSTACK_RELOCATE (yyss_alloc, yyss);
1253  YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1254 # undef YYSTACK_RELOCATE
1255  if (yyss1 != yyssa)
1256  YYSTACK_FREE (yyss1);
1257  }
1258 # endif
1259 
1260  yyssp = yyss + yysize - 1;
1261  yyvsp = yyvs + yysize - 1;
1262 
1263  YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1264  (unsigned long) yystacksize));
1265 
1266  if (yyss + yystacksize - 1 <= yyssp)
1267  YYABORT;
1268  }
1269 #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1270 
1271  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1272 
1273  if (yystate == YYFINAL)
1274  YYACCEPT;
1275 
1276  goto yybackup;
1277 
1278 
1279 /*-----------.
1280 | yybackup. |
1281 `-----------*/
1282 yybackup:
1283  /* Do appropriate processing given the current state. Read a
1284  lookahead token if we need one and don't already have one. */
1285 
1286  /* First try to decide what to do without reference to lookahead token. */
1287  yyn = yypact[yystate];
1288  if (yypact_value_is_default (yyn))
1289  goto yydefault;
1290 
1291  /* Not known => get a lookahead token if don't already have one. */
1292 
1293  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1294  if (yychar == YYEMPTY)
1295  {
1296  YYDPRINTF ((stderr, "Reading a token: "));
1297  yychar = yylex ();
1298  }
1299 
1300  if (yychar <= YYEOF)
1301  {
1302  yychar = yytoken = YYEOF;
1303  YYDPRINTF ((stderr, "Now at end of input.\n"));
1304  }
1305  else
1306  {
1307  yytoken = YYTRANSLATE (yychar);
1308  YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1309  }
1310 
1311  /* If the proper action on seeing token YYTOKEN is to reduce or to
1312  detect an error, take that action. */
1313  yyn += yytoken;
1314  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1315  goto yydefault;
1316  yyn = yytable[yyn];
1317  if (yyn <= 0)
1318  {
1319  if (yytable_value_is_error (yyn))
1320  goto yyerrlab;
1321  yyn = -yyn;
1322  goto yyreduce;
1323  }
1324 
1325  /* Count tokens shifted since error; after three, turn off error
1326  status. */
1327  if (yyerrstatus)
1328  yyerrstatus--;
1329 
1330  /* Shift the lookahead token. */
1331  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1332 
1333  /* Discard the shifted token. */
1334  yychar = YYEMPTY;
1335 
1336  yystate = yyn;
1338  *++yyvsp = yylval;
1340 
1341  goto yynewstate;
1342 
1343 
1344 /*-----------------------------------------------------------.
1345 | yydefault -- do the default action for the current state. |
1346 `-----------------------------------------------------------*/
1347 yydefault:
1348  yyn = yydefact[yystate];
1349  if (yyn == 0)
1350  goto yyerrlab;
1351  goto yyreduce;
1352 
1353 
1354 /*-----------------------------.
1355 | yyreduce -- do a reduction. |
1356 `-----------------------------*/
1357 yyreduce:
1358  /* yyn is the number of a rule to reduce with. */
1359  yylen = yyr2[yyn];
1360 
1361  /* If YYLEN is nonzero, implement the default value of the action:
1362  '$$ = $1'.
1363 
1364  Otherwise, the following line sets YYVAL to garbage.
1365  This behavior is undocumented and Bison
1366  users should not rely upon it. Assigning to YYVAL
1367  unconditionally makes the parser a bit smaller, and it avoids a
1368  GCC warning that YYVAL may be used uninitialized. */
1369  yyval = yyvsp[1-yylen];
1370 
1371 
1372  YY_REDUCE_PRINT (yyn);
1373  switch (yyn)
1374  {
1375  case 3:
1376 #line 142 "config.y" /* yacc.c:1652 */
1377  { doing = "device definitions"; }
1378 #line 1379 "y.tab.c" /* yacc.c:1652 */
1379  break;
1380 
1381  case 6:
1382 #line 149 "config.y" /* yacc.c:1652 */
1383  { yyval = newtype(yytext); }
1384 #line 1385 "y.tab.c" /* yacc.c:1652 */
1385  break;
1386 
1387  case 9:
1388 #line 156 "config.y" /* yacc.c:1652 */
1389  { yyval = yyvsp[0]; }
1390 #line 1391 "y.tab.c" /* yacc.c:1652 */
1391  break;
1392 
1393  case 10:
1394 #line 159 "config.y" /* yacc.c:1652 */
1395  { yyval = addton(yytext); }
1396 #line 1397 "y.tab.c" /* yacc.c:1652 */
1397  break;
1398 
1399  case 13:
1400 #line 166 "config.y" /* yacc.c:1652 */
1401  { addattr(CSR, yyvsp[0]); }
1402 #line 1403 "y.tab.c" /* yacc.c:1652 */
1403  break;
1404 
1405  case 14:
1406 #line 167 "config.y" /* yacc.c:1652 */
1407  { addattr(IRQ, yyvsp[0]); }
1408 #line 1409 "y.tab.c" /* yacc.c:1652 */
1409  break;
1410 
1411  case 15:
1412 #line 168 "config.y" /* yacc.c:1652 */
1413  { addattr(INTR, 0); }
1414 #line 1415 "y.tab.c" /* yacc.c:1652 */
1415  break;
1416 
1417  case 16:
1418 #line 169 "config.y" /* yacc.c:1652 */
1419  { addattr(OPEN, 0); }
1420 #line 1421 "y.tab.c" /* yacc.c:1652 */
1421  break;
1422 
1423  case 17:
1424 #line 170 "config.y" /* yacc.c:1652 */
1425  { addattr(CLOSE, 0); }
1426 #line 1427 "y.tab.c" /* yacc.c:1652 */
1427  break;
1428 
1429  case 18:
1430 #line 171 "config.y" /* yacc.c:1652 */
1431  { addattr(INIT, 0); }
1432 #line 1433 "y.tab.c" /* yacc.c:1652 */
1433  break;
1434 
1435  case 19:
1436 #line 172 "config.y" /* yacc.c:1652 */
1437  { addattr(GETC, 0); }
1438 #line 1439 "y.tab.c" /* yacc.c:1652 */
1439  break;
1440 
1441  case 20:
1442 #line 173 "config.y" /* yacc.c:1652 */
1443  { addattr(PUTC, 0); }
1444 #line 1445 "y.tab.c" /* yacc.c:1652 */
1445  break;
1446 
1447  case 21:
1448 #line 174 "config.y" /* yacc.c:1652 */
1449  { addattr(READ, 0); }
1450 #line 1451 "y.tab.c" /* yacc.c:1652 */
1451  break;
1452 
1453  case 22:
1454 #line 175 "config.y" /* yacc.c:1652 */
1455  { addattr(WRITE, 0); }
1456 #line 1457 "y.tab.c" /* yacc.c:1652 */
1457  break;
1458 
1459  case 23:
1460 #line 176 "config.y" /* yacc.c:1652 */
1461  { addattr(SEEK, 0); }
1462 #line 1463 "y.tab.c" /* yacc.c:1652 */
1463  break;
1464 
1465  case 24:
1466 #line 177 "config.y" /* yacc.c:1652 */
1467  { addattr(CONTROL, 0); }
1468 #line 1469 "y.tab.c" /* yacc.c:1652 */
1469  break;
1470 
1471  case 25:
1472 #line 180 "config.y" /* yacc.c:1652 */
1473  { yyval = 0; getattrid(yytext); }
1474 #line 1475 "y.tab.c" /* yacc.c:1652 */
1475  break;
1476 
1477  case 26:
1478 #line 183 "config.y" /* yacc.c:1652 */
1479  { yyval = config_atoi(yytext, yyleng); }
1480 #line 1481 "y.tab.c" /* yacc.c:1652 */
1481  break;
1482 
1483  case 27:
1484 #line 193 "config.y" /* yacc.c:1652 */
1485  { doing = "interface types"; }
1486 #line 1487 "y.tab.c" /* yacc.c:1652 */
1487  break;
1488 
1489  case 31:
1490 #line 203 "config.y" /* yacc.c:1652 */
1491  { newdev(yytext); }
1492 #line 1493 "y.tab.c" /* yacc.c:1652 */
1493  break;
1494 
1495  case 33:
1496 #line 209 "config.y" /* yacc.c:1652 */
1497  { devisid(yytext); }
1498 #line 1499 "y.tab.c" /* yacc.c:1652 */
1499  break;
1500 
1501  case 35:
1502 #line 215 "config.y" /* yacc.c:1652 */
1503  { devonid(yytext); }
1504 #line 1505 "y.tab.c" /* yacc.c:1652 */
1505  break;
1506 
1507 
1508 #line 1509 "y.tab.c" /* yacc.c:1652 */
1509  default: break;
1510  }
1511  /* User semantic actions sometimes alter yychar, and that requires
1512  that yytoken be updated with the new translation. We take the
1513  approach of translating immediately before every use of yytoken.
1514  One alternative is translating here after every semantic action,
1515  but that translation would be missed if the semantic action invokes
1516  YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1517  if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1518  incorrect destructor might then be invoked immediately. In the
1519  case of YYERROR or YYBACKUP, subsequent parser actions might lead
1520  to an incorrect destructor call or verbose syntax error message
1521  before the lookahead is translated. */
1522  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1523 
1524  YYPOPSTACK (yylen);
1525  yylen = 0;
1526  YY_STACK_PRINT (yyss, yyssp);
1527 
1528  *++yyvsp = yyval;
1529 
1530  /* Now 'shift' the result of the reduction. Determine what state
1531  that goes to, based on the state we popped back to and the rule
1532  number reduced by. */
1533  {
1534  const int yylhs = yyr1[yyn] - YYNTOKENS;
1535  const int yyi = yypgoto[yylhs] + *yyssp;
1536  yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
1537  ? yytable[yyi]
1538  : yydefgoto[yylhs]);
1539  }
1540 
1541  goto yynewstate;
1542 
1543 
1544 /*--------------------------------------.
1545 | yyerrlab -- here on detecting error. |
1546 `--------------------------------------*/
1547 yyerrlab:
1548  /* Make sure we have latest lookahead translation. See comments at
1549  user semantic actions for why this is necessary. */
1550  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1551 
1552  /* If not already recovering from an error, report this error. */
1553  if (!yyerrstatus)
1554  {
1555  ++yynerrs;
1556 #if ! YYERROR_VERBOSE
1557  yyerror (YY_("syntax error"));
1558 #else
1559 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1560  yyssp, yytoken)
1561  {
1562  char const *yymsgp = YY_("syntax error");
1563  int yysyntax_error_status;
1564  yysyntax_error_status = YYSYNTAX_ERROR;
1565  if (yysyntax_error_status == 0)
1566  yymsgp = yymsg;
1567  else if (yysyntax_error_status == 1)
1568  {
1569  if (yymsg != yymsgbuf)
1570  YYSTACK_FREE (yymsg);
1571  yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1572  if (!yymsg)
1573  {
1574  yymsg = yymsgbuf;
1575  yymsg_alloc = sizeof yymsgbuf;
1576  yysyntax_error_status = 2;
1577  }
1578  else
1579  {
1580  yysyntax_error_status = YYSYNTAX_ERROR;
1581  yymsgp = yymsg;
1582  }
1583  }
1584  yyerror (yymsgp);
1585  if (yysyntax_error_status == 2)
1586  goto yyexhaustedlab;
1587  }
1588 # undef YYSYNTAX_ERROR
1589 #endif
1590  }
1591 
1592 
1593 
1594  if (yyerrstatus == 3)
1595  {
1596  /* If just tried and failed to reuse lookahead token after an
1597  error, discard it. */
1598 
1599  if (yychar <= YYEOF)
1600  {
1601  /* Return failure if at end of input. */
1602  if (yychar == YYEOF)
1603  YYABORT;
1604  }
1605  else
1606  {
1607  yydestruct ("Error: discarding",
1608  yytoken, &yylval);
1609  yychar = YYEMPTY;
1610  }
1611  }
1612 
1613  /* Else will try to reuse lookahead token after shifting the error
1614  token. */
1615  goto yyerrlab1;
1616 
1617 
1618 /*---------------------------------------------------.
1619 | yyerrorlab -- error raised explicitly by YYERROR. |
1620 `---------------------------------------------------*/
1621 yyerrorlab:
1622  /* Pacify compilers when the user code never invokes YYERROR and the
1623  label yyerrorlab therefore never appears in user code. */
1624  if (0)
1625  YYERROR;
1626 
1627  /* Do not reclaim the symbols of the rule whose action triggered
1628  this YYERROR. */
1629  YYPOPSTACK (yylen);
1630  yylen = 0;
1631  YY_STACK_PRINT (yyss, yyssp);
1632  yystate = *yyssp;
1633  goto yyerrlab1;
1634 
1635 
1636 /*-------------------------------------------------------------.
1637 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1638 `-------------------------------------------------------------*/
1639 yyerrlab1:
1640  yyerrstatus = 3; /* Each real token shifted decrements this. */
1641 
1642  for (;;)
1643  {
1644  yyn = yypact[yystate];
1645  if (!yypact_value_is_default (yyn))
1646  {
1647  yyn += YYTERROR;
1648  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1649  {
1650  yyn = yytable[yyn];
1651  if (0 < yyn)
1652  break;
1653  }
1654  }
1655 
1656  /* Pop the current state because it cannot handle the error token. */
1657  if (yyssp == yyss)
1658  YYABORT;
1659 
1660 
1661  yydestruct ("Error: popping",
1662  yystos[yystate], yyvsp);
1663  YYPOPSTACK (1);
1664  yystate = *yyssp;
1665  YY_STACK_PRINT (yyss, yyssp);
1666  }
1667 
1669  *++yyvsp = yylval;
1671 
1672 
1673  /* Shift the error token. */
1674  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1675 
1676  yystate = yyn;
1677  goto yynewstate;
1678 
1679 
1680 /*-------------------------------------.
1681 | yyacceptlab -- YYACCEPT comes here. |
1682 `-------------------------------------*/
1683 yyacceptlab:
1684  yyresult = 0;
1685  goto yyreturn;
1686 
1687 
1688 /*-----------------------------------.
1689 | yyabortlab -- YYABORT comes here. |
1690 `-----------------------------------*/
1691 yyabortlab:
1692  yyresult = 1;
1693  goto yyreturn;
1694 
1695 
1696 #if !defined yyoverflow || YYERROR_VERBOSE
1697 /*-------------------------------------------------.
1698 | yyexhaustedlab -- memory exhaustion comes here. |
1699 `-------------------------------------------------*/
1700 yyexhaustedlab:
1701  yyerror (YY_("memory exhausted"));
1702  yyresult = 2;
1703  /* Fall through. */
1704 #endif
1705 
1706 
1707 /*-----------------------------------------------------.
1708 | yyreturn -- parsing is finished, return the result. |
1709 `-----------------------------------------------------*/
1710 yyreturn:
1711  if (yychar != YYEMPTY)
1712  {
1713  /* Make sure we have latest lookahead translation. See comments at
1714  user semantic actions for why this is necessary. */
1715  yytoken = YYTRANSLATE (yychar);
1716  yydestruct ("Cleanup: discarding lookahead",
1717  yytoken, &yylval);
1718  }
1719  /* Do not reclaim the symbols of the rule whose action triggered
1720  this YYABORT or YYACCEPT. */
1721  YYPOPSTACK (yylen);
1722  YY_STACK_PRINT (yyss, yyssp);
1723  while (yyssp != yyss)
1724  {
1725  yydestruct ("Cleanup: popping",
1726  yystos[*yyssp], yyvsp);
1727  YYPOPSTACK (1);
1728  }
1729 #ifndef yyoverflow
1730  if (yyss != yyssa)
1731  YYSTACK_FREE (yyss);
1732 #endif
1733 #if YYERROR_VERBOSE
1734  if (yymsg != yymsgbuf)
1735  YYSTACK_FREE (yymsg);
1736 #endif
1737  return yyresult;
1738 }
static const yytype_uint8 yystos[]
Definition: y.tab.c:665
#define YYPOPSTACK(N)
#define YYEMPTY
Definition: y.tab.c:696
short yytype_int16
Definition: y.tab.c:300
static const yytype_uint8 yytable[]
Definition: y.tab.c:647
#define GETC
Definition: y.tab.c:256
#define YYSIZE_T
Definition: y.tab.c:310
#define CSR
Definition: y.tab.c:244
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
Definition: y.tab.c:368
int YYSTYPE
Definition: y.tab.c:261
#define INIT
Definition: y.tab.c:247
#define INTR
Definition: y.tab.c:246
static const yytype_int8 yycheck[]
Definition: y.tab.c:655
#define YYDPRINTF(Args)
Definition: y.tab.c:852
void addattr(int, int)
Definition: y.tab.c:1958
#define READ
Definition: y.tab.c:250
#define OPEN
Definition: y.tab.c:248
#define stderr
Definition: stdio.h:17
#define YYSTACK_BYTES(N)
Definition: y.tab.c:459
#define YYSTACK_FREE
Definition: y.tab.c:415
#define YYMAXDEPTH
Definition: y.tab.c:872
#define YYFINAL
Definition: y.tab.c:504
void newdev(char *)
Definition: y.tab.c:2163
static const yytype_int8 yydefgoto[]
Definition: y.tab.c:638
#define YY_(Msgid)
Definition: y.tab.c:326
YYSTYPE yylval
Definition: y.tab.c:1127
int addton(char *)
Definition: y.tab.c:1994
int config_atoi(char *, int)
Definition: y.tab.c:2016
int yyleng
#define YYINITDEPTH
Definition: y.tab.c:861
void yyerror(char *)
Definition: y.tab.c:2257
#define YYERROR
Definition: y.tab.c:701
int yychar
Definition: y.tab.c:1124
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Definition: y.tab.c:367
yytype_int16 yyss_alloc
Definition: y.tab.c:450
#define SEEK
Definition: y.tab.c:252
YYSTYPE yyvs_alloc
Definition: y.tab.c:451
#define YY_REDUCE_PRINT(Rule)
Definition: y.tab.c:855
#define YYTERROR
Definition: y.tab.c:724
static const yytype_uint8 yydefact[]
Definition: y.tab.c:620
void devisid(char *)
Definition: y.tab.c:2056
#define IRQ
Definition: y.tab.c:245
int yylex(void)
char * doing
Definition: y.tab.c:107
#define CLOSE
Definition: y.tab.c:249
static const yytype_uint8 yyr1[]
Definition: y.tab.c:676
#define YYACCEPT
Definition: y.tab.c:699
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
Definition: y.tab.c:470
Definition: y.tab.c:448
static const yytype_int8 yypgoto[]
Definition: y.tab.c:631
#define YY_STACK_PRINT(Bottom, Top)
Definition: y.tab.c:854
void devonid(char *)
Definition: y.tab.c:2091
int newtype(char *)
Definition: y.tab.c:2205
#define YYNTOKENS
Definition: y.tab.c:509
#define YYEOF
Definition: y.tab.c:697
#define yypact_value_is_default(Yystate)
Definition: y.tab.c:597
void getattrid(char *)
Definition: y.tab.c:2145
#define YYSTACK_ALLOC
Definition: y.tab.c:414
char * yytext
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
Definition: y.tab.c:853
#define YYLAST
Definition: y.tab.c:506
#define CONTROL
Definition: y.tab.c:253
static const yytype_uint8 yyr2[]
Definition: y.tab.c:685
#define WRITE
Definition: y.tab.c:251
static void yydestruct(const char *yymsg, int yytype, YYSTYPE *yyvaluep)
Definition: y.tab.c:1108
int yynerrs
Definition: y.tab.c:1129
#define yytable_value_is_error(Yytable_value)
Definition: y.tab.c:602
#define YYABORT
Definition: y.tab.c:700
static const yytype_int8 yypact[]
Definition: y.tab.c:607
#define YYTRANSLATE(YYX)
Definition: y.tab.c:522
#define PUTC
Definition: y.tab.c:257
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ brkcount

int brkcount = 0

Definition at line 105 of file y.tab.c.

Referenced by addattr(), if(), and main().

◆ confc

FILE* confc

Definition at line 102 of file y.tab.c.

Referenced by main().

◆ confh

FILE* confh

Definition at line 103 of file y.tab.c.

Referenced by main().

◆ devs

struct dev_ent devs[NDEVS]

Definition at line 134 of file y.tab.c.

Referenced by addattr(), devisid(), devonid(), main(), and newdev().

◆ devstab

char* devstab[]
Initial value:
= {
"/* Device table entry */",
"struct\tdentry\t{",
"\tint32 dvnum;",
"\tint32 dvminor;",
"\tchar *dvname;",
"\tdevcall (*dvinit) (struct dentry *);",
"\tdevcall (*dvopen) (struct dentry *, char *, char *);",
"\tdevcall (*dvclose)(struct dentry *);",
"\tdevcall (*dvread) (struct dentry *, void *, uint32);",
"\tdevcall (*dvwrite)(struct dentry *, void *, uint32);",
"\tdevcall (*dvseek) (struct dentry *, int32);",
"\tdevcall (*dvgetc) (struct dentry *);",
"\tdevcall (*dvputc) (struct dentry *, char);",
"\tdevcall (*dvcntl) (struct dentry *, int32, int32, int32);",
"\tvoid *dvcsr;",
"\tvoid (*dvintr)(void);",
"\tbyte dvirq;",
"};\n",
"extern struct dentry devtab[]; /* one entry per device */",
}
#define NULL
連結リスト用のNULLポインタ
Definition: kernel.h:68

Definition at line 137 of file y.tab.c.

Referenced by main().

◆ doing

char* doing = "device type declarations"

Definition at line 107 of file y.tab.c.

Referenced by yyerror(), and yyparse().

◆ dtypes

struct dev_ent dtypes[NTYPES]

Definition at line 131 of file y.tab.c.

Referenced by addattr(), addton(), devisid(), devonid(), main(), and newtype().

◆ linectr

int linectr = 1

Definition at line 100 of file y.tab.c.

Referenced by addton(), devisid(), devonid(), getattrid(), if(), newdev(), newtype(), and yyerror().

◆ ndevs

int ndevs = 0

Definition at line 135 of file y.tab.c.

Referenced by addattr(), devisid(), devonid(), main(), and newdev().

◆ ntypes

int ntypes = 0

Definition at line 132 of file y.tab.c.

Referenced by addattr(), addton(), devisid(), devonid(), main(), and newtype().

◆ saveattrid

char saveattrid[MAXNAME]

Definition at line 160 of file y.tab.c.

Referenced by addattr(), and getattrid().

◆ yychar

int yychar

Definition at line 1124 of file y.tab.c.

Referenced by yyparse().

◆ yycheck

const yytype_int8 yycheck[]
static
Initial value:
=
{
9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
0, 5, 21, 22, 27, 28, 29, 30, 31, 32,
33, 34, 35, 16, 8, 3, 8, 8, 20, 22,
8, 19, 7, 20, 8, 8, 15, -1, -1, 25
}

Definition at line 655 of file y.tab.c.

Referenced by yyparse().

◆ yydefact

const yytype_uint8 yydefact[]
static
Initial value:
=
{
3, 0, 0, 1, 27, 6, 4, 0, 2, 0,
31, 28, 11, 0, 0, 5, 11, 29, 0, 0,
10, 9, 11, 7, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 12, 33, 32, 0,
30, 8, 26, 13, 14, 25, 15, 18, 16, 17,
21, 22, 23, 24, 19, 20, 35, 34
}

Definition at line 620 of file y.tab.c.

Referenced by yyparse().

◆ yydefgoto

const yytype_int8 yydefgoto[]
static
Initial value:
=
{
-1, 1, 2, 6, 7, 15, 16, 21, 17, 36,
46, 43, 8, 11, 12, 13, 19, 38, 40, 57
}

Definition at line 638 of file y.tab.c.

Referenced by yyparse().

◆ yyleng

int yyleng

Referenced by yyparse().

◆ yylval

YYSTYPE yylval

Definition at line 1127 of file y.tab.c.

Referenced by yyparse().

◆ yynerrs

int yynerrs

Definition at line 1129 of file y.tab.c.

Referenced by yyparse().

◆ yypact

const yytype_int8 yypact[]
static
Initial value:
=
{
-14, 10, 22, -14, -14, -14, -14, 6, 16, 8,
-14, -14, -14, 12, 18, 8, -14, -9, 19, 13,
-14, -14, -14, -9, 25, 25, 26, 26, 26, 26,
26, 26, 26, 26, 26, 26, -14, -14, -14, 27,
-14, -9, -14, -14, -14, -14, -14, -14, -14, -14,
-14, -14, -14, -14, -14, -14, -14, -14
}

Definition at line 607 of file y.tab.c.

Referenced by yyparse().

◆ yypgoto

const yytype_int8 yypgoto[]
static
Initial value:
=
{
-14, -14, -14, -14, -14, -14, 21, -14, 7, -14,
-13, 14, -14, -14, -14, -14, -14, -14, -14, -14
}

Definition at line 631 of file y.tab.c.

Referenced by yyparse().

◆ yyr1

const yytype_uint8 yyr1[]
static
Initial value:
=
{
0, 23, 24, 25, 25, 26, 27, 28, 28, 29,
30, 31, 31, 32, 32, 32, 32, 32, 32, 32,
32, 32, 32, 32, 32, 33, 34, 35, 35, 36,
37, 38, 39, 40, 41, 42
}

Definition at line 676 of file y.tab.c.

Referenced by yyparse().

◆ yyr2

const yytype_uint8 yyr2[]
static
Initial value:
=
{
0, 2, 3, 0, 2, 3, 1, 2, 3, 2,
1, 0, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 1, 1, 0, 2, 2,
3, 1, 2, 1, 2, 1
}

Definition at line 685 of file y.tab.c.

Referenced by yyparse().

◆ yystos

const yytype_uint8 yystos[]
static
Initial value:
=
{
0, 24, 25, 0, 3, 8, 26, 27, 35, 5,
8, 36, 37, 38, 20, 28, 29, 31, 19, 39,
8, 30, 29, 31, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 21, 22, 32, 8, 40, 20,
41, 31, 7, 34, 34, 8, 33, 33, 33, 33,
33, 33, 33, 33, 33, 33, 8, 42
}

Definition at line 665 of file y.tab.c.

Referenced by yyparse().

◆ yytable

const yytype_uint8 yytable[]
static
Initial value:
=
{
24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
3, 9, 34, 35, 47, 48, 49, 50, 51, 52,
53, 54, 55, 23, 10, 4, 20, 37, 14, 41,
5, 18, 42, 39, 45, 56, 22, 0, 0, 44
}

Definition at line 647 of file y.tab.c.

Referenced by yyparse().

◆ yytext

char* yytext

Referenced by yyparse().

◆ yytranslate

const yytype_uint8 yytranslate[]
static

Definition at line 527 of file y.tab.c.