代码搜索结果
找到约 10,000 项符合
Y 的代码
c.y
# define TOKEN char
# define VALUE char*
# define STACKTOKENS 1
# define STACKSIZE 2048
# include "cc.h"
# include "preccx.h"
# undef UNSETNAME
# include "preamble.h"
/* -- a shot at C-exp
preccx.y
# define TOKEN char
# define VALUE char*
# define STACKTOKENS 1
# define STACKSIZE 2048
# define BEGIN p_begin()
# include "cc.h"
# include "preccx.h"
# undef UNSETNAME
# include "preamble.h"
char
lex.y
# define TOKEN char
# define VALUE char*
# define STACKTOKENS 1
# define STACKSIZE 2048
# include "cc.h"
# include "preccx.h"
# undef UNSETNAME
# include "preamble.h"
/* in order to be able to pars
gram.y
%{
#include
extern int lineno;
%}
%token IDENTIFIER CONSTANT STRING_LITERAL SIZEOF
%token PTR_OP INC_OP DEC_OP LEFT_OP RIGHT_OP LE_OP GE_OP EQ_OP NE_OP
%token AND_OP OR_OP MUL_ASSIGN
gram.y
%{
#include
#define T 3
extern yylineno;
%}
%token PROGRAM_T INTEGER_T REAL_T OF_T VAR_T ARRAY_T
%token PROCEDURE_T FUNCTION_T BEGIN_T END_T ELSE_T THEN_T DO_T
%token READ_T WRITE_T IF_T WH
re.y
%token SYM EOLN
%%
reg_list : reg_list regular_expr
| regular_expr
;
regular_expr : re EOLN
;
re : re '|' re_a
| re_a
;
re_a : re_a re_b
sacalc.y
/*
* SACALC EXAMPLE
*/
%{
#define YYSTYPE double /* data type of yacc stack */
#define QUIT ( (double) 101010 )
#define YYDEBUG
%}
%token NUMBER
%left '+' '-' /* left as
error.y
%%
S: error
%%
main(){printf("yyparse() = %d\n",yyparse());}
yylex(){return-1;}
yyerror(s)char*s;{printf("%s\n",s);}
grammar.y
/* $Id: grammar.y,v 1.1 2004/03/24 21:29:23 tom Exp $
*
* yacc grammar for C function prototype generator
* This was derived from the grammar in Appendix A of
* "The C Programming Language" by Ker