%{
/*
* 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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <dt_impl.h>
#define OP3(x, y, z) dt_node_op3(x, y, z)
#define LINK(l, r) dt_node_link(l, r)
%}
%union {
char *l_str;
int l_tok;
}
%token DT_TOK_EOF 0
%%
;
;
;
;
;
;
assignment_expression ';' {
/*
* We push a new declaration scope before shifting the
* assignment_expression in order to preserve ds_class
* and ds_ident for use in dt_node_inline(). Once the
* entire inline_definition rule is matched, pop the
* scope and construct the inline using the saved decl.
*/
dt_scope_pop();
$$ = dt_node_inline($6);
}
;
}
}
;
;
}
;
}
}
;
;
}
}
;
/*
* If the input stream is a file, do not permit a probe
* specification without / <pred> / or { <act> } after
* it. This can only occur if the next token is EOF or
* an ambiguous predicate was slurped up as a comment.
* We cannot perform this check if input() is a string
* because dtrace(1M) [-fmnP] also use the compiler and
* things like dtrace -n BEGIN have to be accepted.
*/
"or actions following probe description\n");
}
}
}
"probe description and predicate\n");
}
}
;
;
}
;
;
;
;
}
;
;
}
}
}
}
}
}
}
}
}
}
}
}
;
}
}
;
| DT_TOK_MUL { $$ = DT_TOK_DEREF; }
| DT_TOK_ADD { $$ = DT_TOK_IPOS; }
| DT_TOK_SUB { $$ = DT_TOK_INEG; }
| DT_TOK_BNEG { $$ = DT_TOK_BNEG; }
| DT_TOK_LNEG { $$ = DT_TOK_LNEG; }
;
}
;
}
}
}
;
}
}
;
}
}
;
}
}
}
}
;
}
}
;
}
;
}
;
}
;
}
;
}
;
}
;
;
;
}
;
DT_TOK_ASGN { $$ = DT_TOK_ASGN; }
| DT_TOK_MUL_EQ { $$ = DT_TOK_MUL_EQ; }
| DT_TOK_DIV_EQ { $$ = DT_TOK_DIV_EQ; }
| DT_TOK_MOD_EQ { $$ = DT_TOK_MOD_EQ; }
| DT_TOK_ADD_EQ { $$ = DT_TOK_ADD_EQ; }
| DT_TOK_SUB_EQ { $$ = DT_TOK_SUB_EQ; }
| DT_TOK_LSH_EQ { $$ = DT_TOK_LSH_EQ; }
| DT_TOK_RSH_EQ { $$ = DT_TOK_RSH_EQ; }
| DT_TOK_AND_EQ { $$ = DT_TOK_AND_EQ; }
| DT_TOK_XOR_EQ { $$ = DT_TOK_XOR_EQ; }
| DT_TOK_OR_EQ { $$ = DT_TOK_OR_EQ; }
;
}
;
$$ = dt_node_decl();
}
$$ = $2;
}
;
;
;
;
;
| DT_KEY_STRING {
}
;
;
$$ = dt_scope_pop();
}
;
;
DT_KEY_STRUCT { $$ = CTF_K_STRUCT; }
| DT_KEY_UNION { $$ = CTF_K_UNION; }
;
;
}
;
$$ = dt_node_decl();
}
;
}
;
;
;
dt_decl_member($3);
}
;
;
;
;
}
;
;
;
;
;
;
| DT_TOK_ELLIPSIS { $$ = dt_node_vatype(); }
}
;
}
;
$$ = dt_node_type(NULL);
}
$$ = dt_node_type(NULL);
}
$$ = dt_node_type(NULL);
}
;
$$ = dt_decl_pop();
}
$$ = dt_decl_pop();
}
;
;
;
dt_scope_pop();
$$ = $3;
}
;
/* empty */ { $$ = NULL; }
| constant_expression { $$ = $1; }
| parameter_type_list { $$ = $1; }
;
dt_scope_pop();
$$ = $3;
}
;
/* empty */ { $$ = NULL; }
| parameter_type_list { $$ = $1; }
;
%%