parser.y

来自「qADSL is an auto-login & keep-alive daem」· Y 代码 · 共 51 行

Y
51
字号
/* Hey Emacs, this is code for yacc to eat, treat it as -*-C-*- code */%{#include <stdio.h>#include "conf.h"#include "config.h"extern int yylineno;#define conf_set(key,value)				\   if (conf_set_value (key, value))			\     fprintf (stderr,					\	      "Error on line %d in config file, "	\	      "%s is not a valid identifier.\n",	\	      yylineno, key)%}%union {	char *str;}%token ID ARG EQU SET%type  <str> ID ARG%start line%%line   : line tuples       | tuples       ;tuples : tuple       | SET tuple       ;tuple  : ID EQU ARG             {/* printf ("\nBison(ID:%s)(ARG:%s)", $1, $3); */                                 conf_set ($1, $3);}       | ID ARG                 {/* printf ("%s(%s)\n", $1, $2); */                                 conf_set ($1, $2);}       ; %%int yyerror (char *s){  fprintf (stderr, "ERR銸R: %s\n", s);  return -1;}

⌨️ 快捷键说明

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