%{
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
%}
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
%{
#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 2.10 */
%}
%{
#include "awk.h"
int yywrap(void) { return(1); }
#ifndef DEBUG
# define PUTS(x)
#endif
int infunc = 0; /* = 1 if in arglist or body of func */
%}
%union {
Node *p;
int i;
uchar *s;
}
%type <p> for if while
%right '?'
%right ':'
%left '+' '-'
%left '*' '/' '%'
%%
;
and:
;
bor:
;
;
do:
;
else:
;
for:
;
;
if:
;
;
nl:
;
/* empty */ { $$ = 0; }
| nl
;
/* empty */ { $$ = 0; }
| pst
;
/* empty */ { $$ = 0; }
;
pas:
opt_pst { $$ = 0; }
;
;
;
;
;
{ if (constnode($3))
else
| reg_expr
| term
;
{ if (constnode($3))
else
| reg_expr
| term
;
;
/* empty */ { $$ = rectonode(); }
| pplist
;
;
pst:
;
;
;
;
| DELETE varname { yyclearin; ERROR "you can only delete array[element]" SYNTAX; $$ = stat1(DELETE, $2); }
;
st:
;
stmt:
| for
| ';' opt_nl { $$ = 0; }
;
;
;
term:
{ if (constnode($5))
else
{ if (constnode($3))
else
{ if (constnode($3))
else
| var
;
var:
;
/* nothing */ { arglist = $$ = 0; }
;
;
while:
;
%%
static void
{
if (isarr(p))
else if (isfunc(p))
}
static int
{
}
static uchar *
{
}
static Node *
{
switch (n->nobj) {
return n;
default:
}
}