代码搜索结果
找到约 10,000 项符合
Y 的代码
multi.y
/* Test program for multiple start non-terminals.
* 3 separate grammars for infix, postfix and suffix arith expressions.
* No unary minus. No error checking.
*/
%{
#include
int yylex(
binnum.y
/* Attribute expression for binary numbers using inherited attributes. */
%{
#include
void yyerror();
int yylex();
%}
%%
Line
: Line BNum($v) '\n' { printf("%.4f\n", $v); }
| error '\
arithexp.y
/* Simple arith. expr. grammar (single-digit #s) with precedence via rules. */
%{
#include
void yyerror(const char *);
int yylex(void);
typedef int YYSTYPE;
%}
%%
S
: S E { printf("%d
debug.y
/* Simple arith. expr. grammar (single-digit #s) with precedence via rules. */
%{
#include
void yyerror(const char *);
int yylex(void);
typedef int YYSTYPE;
%}
%%
S
: S E { printf("%d
lalr.y
/* Example of a grammar which is LALR(1), but not SLR(1).
* Taken from Tremblay & Sorenson, pg. 359.
*/
%%
G : E '=' E
| 'f'
;
E : E '+' T
| T
;
T : 'f'
|
decuse.y
/* Test to ensure declaration of single character identifiers before use
* in a brace-enclosed block.
*/
%{
#include
#include
#include
typedef char ID;
#define ENV_S
semtest.y
/* Test for %tests. Resolve operator priorities using %tests. */
%token (int $v) DIGIT
%{
#include
#include
static unsigned char pri[128];
void yyerror();
int yylex();
e
myyacc.y
%{
#include
#include
#include
#define MSDOS
int linesCount;
int nextStat=0;
extern int yylex();
extern int yyerror();
extern char yytext[];
extern char lexeme[