xref: /freebsd/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.h (revision 27067774dce3388702a4cf744d7096c6fb71b688)
16ff6d951SJohn Birrell /*
26ff6d951SJohn Birrell  * CDDL HEADER START
36ff6d951SJohn Birrell  *
46ff6d951SJohn Birrell  * The contents of this file are subject to the terms of the
56ff6d951SJohn Birrell  * Common Development and Distribution License (the "License").
66ff6d951SJohn Birrell  * You may not use this file except in compliance with the License.
76ff6d951SJohn Birrell  *
86ff6d951SJohn Birrell  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
96ff6d951SJohn Birrell  * or http://www.opensolaris.org/os/licensing.
106ff6d951SJohn Birrell  * See the License for the specific language governing permissions
116ff6d951SJohn Birrell  * and limitations under the License.
126ff6d951SJohn Birrell  *
136ff6d951SJohn Birrell  * When distributing Covered Code, include this CDDL HEADER in each
146ff6d951SJohn Birrell  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
156ff6d951SJohn Birrell  * If applicable, add the following below this CDDL HEADER, with the
166ff6d951SJohn Birrell  * fields enclosed by brackets "[]" replaced with your own identifying
176ff6d951SJohn Birrell  * information: Portions Copyright [yyyy] [name of copyright owner]
186ff6d951SJohn Birrell  *
196ff6d951SJohn Birrell  * CDDL HEADER END
206ff6d951SJohn Birrell  */
216ff6d951SJohn Birrell /*
226ff6d951SJohn Birrell  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
236ff6d951SJohn Birrell  * Use is subject to license terms.
246ff6d951SJohn Birrell  */
258e648814SRui Paulo /*
26*650f66acSMark Johnston  * Copyright (c) 2013, 2016 by Delphix. All rights reserved.
278e648814SRui Paulo  * Copyright (c) 2013 Joyent, Inc. All rights reserved.
288e648814SRui Paulo  */
296ff6d951SJohn Birrell 
306ff6d951SJohn Birrell #ifndef	_DT_PARSER_H
316ff6d951SJohn Birrell #define	_DT_PARSER_H
326ff6d951SJohn Birrell 
336ff6d951SJohn Birrell #include <sys/types.h>
346ff6d951SJohn Birrell #include <sys/dtrace.h>
356ff6d951SJohn Birrell 
366ff6d951SJohn Birrell #include <libctf.h>
376ff6d951SJohn Birrell #include <stdarg.h>
386ff6d951SJohn Birrell #include <stdio.h>
396ff6d951SJohn Birrell 
406ff6d951SJohn Birrell #ifdef	__cplusplus
416ff6d951SJohn Birrell extern "C" {
426ff6d951SJohn Birrell #endif
436ff6d951SJohn Birrell 
446ff6d951SJohn Birrell #include <dt_errtags.h>
456ff6d951SJohn Birrell #include <dt_ident.h>
466ff6d951SJohn Birrell #include <dt_decl.h>
476ff6d951SJohn Birrell #include <dt_xlator.h>
486ff6d951SJohn Birrell #include <dt_list.h>
496ff6d951SJohn Birrell 
506ff6d951SJohn Birrell typedef struct dt_node {
516ff6d951SJohn Birrell 	ctf_file_t *dn_ctfp;	/* CTF type container for node's type */
526ff6d951SJohn Birrell 	ctf_id_t dn_type;	/* CTF type reference for node's type */
536ff6d951SJohn Birrell 	uchar_t dn_kind;	/* node kind (DT_NODE_*, defined below) */
546ff6d951SJohn Birrell 	uchar_t dn_flags;	/* node flags (DT_NF_*, defined below) */
556ff6d951SJohn Birrell 	ushort_t dn_op;		/* operator (DT_TOK_*, defined by lex) */
566ff6d951SJohn Birrell 	int dn_line;		/* line number for error messages */
576ff6d951SJohn Birrell 	int dn_reg;		/* register allocated by cg */
586ff6d951SJohn Birrell 	dtrace_attribute_t dn_attr; /* node stability attributes */
596ff6d951SJohn Birrell 
606ff6d951SJohn Birrell 	/*
616ff6d951SJohn Birrell 	 * D compiler nodes, as is the usual style, contain a union of the
626ff6d951SJohn Birrell 	 * different sub-elements required by the various kinds of nodes.
636ff6d951SJohn Birrell 	 * These sub-elements are accessed using the macros defined below.
646ff6d951SJohn Birrell 	 */
656ff6d951SJohn Birrell 	union {
666ff6d951SJohn Birrell 		struct {
676ff6d951SJohn Birrell 			uintmax_t _value;	/* integer value */
686ff6d951SJohn Birrell 			char *_string;		/* string value */
696ff6d951SJohn Birrell 		} _const;
706ff6d951SJohn Birrell 
716ff6d951SJohn Birrell 		struct {
726ff6d951SJohn Birrell 			dt_ident_t *_ident;	/* identifier reference */
736ff6d951SJohn Birrell 			struct dt_node *_links[3]; /* child node pointers */
746ff6d951SJohn Birrell 		} _nodes;
756ff6d951SJohn Birrell 
766ff6d951SJohn Birrell 		struct {
776ff6d951SJohn Birrell 			struct dt_node *_descs;	/* list of descriptions */
786ff6d951SJohn Birrell 			struct dt_node *_pred;	/* predicate expression */
796ff6d951SJohn Birrell 			struct dt_node *_acts;	/* action statement list */
806ff6d951SJohn Birrell 			dt_idhash_t *_locals;	/* local variable hash */
816ff6d951SJohn Birrell 			dtrace_attribute_t _attr; /* context attributes */
826ff6d951SJohn Birrell 		} _clause;
836ff6d951SJohn Birrell 
846ff6d951SJohn Birrell 		struct {
856ff6d951SJohn Birrell 			char *_spec;		/* specifier string (if any) */
866ff6d951SJohn Birrell 			dtrace_probedesc_t *_desc; /* final probe description */
876ff6d951SJohn Birrell 		} _pdesc;
886ff6d951SJohn Birrell 
896ff6d951SJohn Birrell 		struct {
906ff6d951SJohn Birrell 			char *_name;		/* string name of member */
916ff6d951SJohn Birrell 			struct dt_node *_expr;	/* expression node pointer */
926ff6d951SJohn Birrell 			dt_xlator_t *_xlator;	/* translator reference */
936ff6d951SJohn Birrell 			uint_t _id;		/* member identifier */
946ff6d951SJohn Birrell 		} _member;
956ff6d951SJohn Birrell 
966ff6d951SJohn Birrell 		struct {
976ff6d951SJohn Birrell 			dt_xlator_t *_xlator;	/* translator reference */
986ff6d951SJohn Birrell 			struct dt_node *_xmemb;	/* individual xlator member */
996ff6d951SJohn Birrell 			struct dt_node *_membs;	/* list of member nodes */
1006ff6d951SJohn Birrell 		} _xlator;
1016ff6d951SJohn Birrell 
1026ff6d951SJohn Birrell 		struct {
1036ff6d951SJohn Birrell 			char *_name;		/* string name of provider */
1046ff6d951SJohn Birrell 			struct dt_provider *_pvp; /* provider references */
1056ff6d951SJohn Birrell 			struct dt_node *_probes;  /* list of probe nodes */
1066ff6d951SJohn Birrell 			int _redecl;		/* provider redeclared */
1076ff6d951SJohn Birrell 		} _provider;
108*650f66acSMark Johnston 
109*650f66acSMark Johnston 		struct {
110*650f66acSMark Johnston 			struct dt_node *_conditional;
111*650f66acSMark Johnston 			struct dt_node *_body;
112*650f66acSMark Johnston 			struct dt_node *_alternate_body;
113*650f66acSMark Johnston 		} _conditional;
1146ff6d951SJohn Birrell 	} dn_u;
1156ff6d951SJohn Birrell 
1166ff6d951SJohn Birrell 	struct dt_node *dn_list; /* parse tree list link */
1176ff6d951SJohn Birrell 	struct dt_node *dn_link; /* allocation list link */
1186ff6d951SJohn Birrell } dt_node_t;
1196ff6d951SJohn Birrell 
1206ff6d951SJohn Birrell #define	dn_value	dn_u._const._value	/* DT_NODE_INT */
1216ff6d951SJohn Birrell #define	dn_string	dn_u._const._string	/* STRING, IDENT, TYPE */
1226ff6d951SJohn Birrell #define	dn_ident	dn_u._nodes._ident	/* VAR,SYM,FUN,AGG,INL,PROBE */
1236ff6d951SJohn Birrell #define	dn_args		dn_u._nodes._links[0]	/* DT_NODE_VAR, FUNC */
1246ff6d951SJohn Birrell #define	dn_child	dn_u._nodes._links[0]	/* DT_NODE_OP1 */
1256ff6d951SJohn Birrell #define	dn_left		dn_u._nodes._links[0]	/* DT_NODE_OP2, OP3 */
1266ff6d951SJohn Birrell #define	dn_right	dn_u._nodes._links[1]	/* DT_NODE_OP2, OP3 */
1276ff6d951SJohn Birrell #define	dn_expr		dn_u._nodes._links[2]	/* DT_NODE_OP3, DEXPR */
1286ff6d951SJohn Birrell #define	dn_aggfun	dn_u._nodes._links[0]	/* DT_NODE_AGG */
1296ff6d951SJohn Birrell #define	dn_aggtup	dn_u._nodes._links[1]	/* DT_NODE_AGG */
1306ff6d951SJohn Birrell #define	dn_pdescs	dn_u._clause._descs	/* DT_NODE_CLAUSE */
1316ff6d951SJohn Birrell #define	dn_pred		dn_u._clause._pred	/* DT_NODE_CLAUSE */
1326ff6d951SJohn Birrell #define	dn_acts		dn_u._clause._acts	/* DT_NODE_CLAUSE */
1336ff6d951SJohn Birrell #define	dn_locals	dn_u._clause._locals	/* DT_NODE_CLAUSE */
1346ff6d951SJohn Birrell #define	dn_ctxattr	dn_u._clause._attr	/* DT_NODE_CLAUSE */
1356ff6d951SJohn Birrell #define	dn_spec		dn_u._pdesc._spec	/* DT_NODE_PDESC */
1366ff6d951SJohn Birrell #define	dn_desc		dn_u._pdesc._desc	/* DT_NODE_PDESC */
1376ff6d951SJohn Birrell #define	dn_membname	dn_u._member._name	/* DT_NODE_MEMBER */
1386ff6d951SJohn Birrell #define	dn_membexpr	dn_u._member._expr	/* DT_NODE_MEMBER */
1396ff6d951SJohn Birrell #define	dn_membxlator	dn_u._member._xlator	/* DT_NODE_MEMBER */
1406ff6d951SJohn Birrell #define	dn_membid	dn_u._member._id	/* DT_NODE_MEMBER */
1416ff6d951SJohn Birrell #define	dn_xlator	dn_u._xlator._xlator	/* DT_NODE_XLATOR */
1426ff6d951SJohn Birrell #define	dn_xmember	dn_u._xlator._xmemb	/* DT_NODE_XLATOR */
1436ff6d951SJohn Birrell #define	dn_members	dn_u._xlator._membs	/* DT_NODE_XLATOR */
1446ff6d951SJohn Birrell #define	dn_provname	dn_u._provider._name	/* DT_NODE_PROVIDER */
1456ff6d951SJohn Birrell #define	dn_provider	dn_u._provider._pvp	/* DT_NODE_PROVIDER */
1466ff6d951SJohn Birrell #define	dn_provred	dn_u._provider._redecl	/* DT_NODE_PROVIDER */
1476ff6d951SJohn Birrell #define	dn_probes	dn_u._provider._probes	/* DT_NODE_PROVIDER */
1486ff6d951SJohn Birrell 
149*650f66acSMark Johnston /* DT_NODE_IF: */
150*650f66acSMark Johnston #define	dn_conditional		dn_u._conditional._conditional
151*650f66acSMark Johnston #define	dn_body			dn_u._conditional._body
152*650f66acSMark Johnston #define	dn_alternate_body	dn_u._conditional._alternate_body
153*650f66acSMark Johnston 
1546ff6d951SJohn Birrell #define	DT_NODE_FREE	0	/* unused node (waiting to be freed) */
1556ff6d951SJohn Birrell #define	DT_NODE_INT	1	/* integer value */
1566ff6d951SJohn Birrell #define	DT_NODE_STRING	2	/* string value */
1576ff6d951SJohn Birrell #define	DT_NODE_IDENT	3	/* identifier */
1586ff6d951SJohn Birrell #define	DT_NODE_VAR	4	/* variable reference */
1596ff6d951SJohn Birrell #define	DT_NODE_SYM	5	/* symbol reference */
1606ff6d951SJohn Birrell #define	DT_NODE_TYPE	6	/* type reference or formal parameter */
1616ff6d951SJohn Birrell #define	DT_NODE_FUNC	7	/* function call */
1626ff6d951SJohn Birrell #define	DT_NODE_OP1	8	/* unary operator */
1636ff6d951SJohn Birrell #define	DT_NODE_OP2	9	/* binary operator */
1646ff6d951SJohn Birrell #define	DT_NODE_OP3	10	/* ternary operator */
1656ff6d951SJohn Birrell #define	DT_NODE_DEXPR	11	/* D expression action */
1666ff6d951SJohn Birrell #define	DT_NODE_DFUNC	12	/* D function action */
1676ff6d951SJohn Birrell #define	DT_NODE_AGG	13	/* aggregation */
1686ff6d951SJohn Birrell #define	DT_NODE_PDESC	14	/* probe description */
1696ff6d951SJohn Birrell #define	DT_NODE_CLAUSE	15	/* clause definition */
1706ff6d951SJohn Birrell #define	DT_NODE_INLINE	16	/* inline definition */
1716ff6d951SJohn Birrell #define	DT_NODE_MEMBER	17	/* member definition */
1726ff6d951SJohn Birrell #define	DT_NODE_XLATOR	18	/* translator definition */
1736ff6d951SJohn Birrell #define	DT_NODE_PROBE	19	/* probe definition */
1746ff6d951SJohn Birrell #define	DT_NODE_PROVIDER 20	/* provider definition */
1756ff6d951SJohn Birrell #define	DT_NODE_PROG	21	/* program translation unit */
176*650f66acSMark Johnston #define	DT_NODE_IF	22	/* if statement */
1776ff6d951SJohn Birrell 
1786ff6d951SJohn Birrell #define	DT_NF_SIGNED	0x01	/* data is a signed quantity (else unsigned) */
1796ff6d951SJohn Birrell #define	DT_NF_COOKED	0x02	/* data is a known type (else still cooking) */
1806ff6d951SJohn Birrell #define	DT_NF_REF	0x04	/* pass by reference (array, struct, union) */
1816ff6d951SJohn Birrell #define	DT_NF_LVALUE	0x08	/* node is an l-value according to ANSI-C */
1826ff6d951SJohn Birrell #define	DT_NF_WRITABLE	0x10	/* node is writable (can be modified) */
1836ff6d951SJohn Birrell #define	DT_NF_BITFIELD	0x20	/* node is an integer bitfield */
1846ff6d951SJohn Birrell #define	DT_NF_USERLAND	0x40	/* data is a userland address */
1856ff6d951SJohn Birrell 
1866ff6d951SJohn Birrell #define	DT_TYPE_NAMELEN	128	/* reasonable size for ctf_type_name() */
1876ff6d951SJohn Birrell 
1886ff6d951SJohn Birrell extern int dt_node_is_integer(const dt_node_t *);
1896ff6d951SJohn Birrell extern int dt_node_is_float(const dt_node_t *);
1906ff6d951SJohn Birrell extern int dt_node_is_scalar(const dt_node_t *);
1916ff6d951SJohn Birrell extern int dt_node_is_arith(const dt_node_t *);
1926ff6d951SJohn Birrell extern int dt_node_is_vfptr(const dt_node_t *);
1936ff6d951SJohn Birrell extern int dt_node_is_dynamic(const dt_node_t *);
1946ff6d951SJohn Birrell extern int dt_node_is_stack(const dt_node_t *);
1956ff6d951SJohn Birrell extern int dt_node_is_symaddr(const dt_node_t *);
1966ff6d951SJohn Birrell extern int dt_node_is_usymaddr(const dt_node_t *);
1976ff6d951SJohn Birrell extern int dt_node_is_string(const dt_node_t *);
1986ff6d951SJohn Birrell extern int dt_node_is_strcompat(const dt_node_t *);
1996ff6d951SJohn Birrell extern int dt_node_is_pointer(const dt_node_t *);
2006ff6d951SJohn Birrell extern int dt_node_is_void(const dt_node_t *);
2016ff6d951SJohn Birrell extern int dt_node_is_ptrcompat(const dt_node_t *, const dt_node_t *,
2026ff6d951SJohn Birrell 	ctf_file_t **, ctf_id_t *);
2036ff6d951SJohn Birrell extern int dt_node_is_argcompat(const dt_node_t *, const dt_node_t *);
2046ff6d951SJohn Birrell extern int dt_node_is_posconst(const dt_node_t *);
2056ff6d951SJohn Birrell extern int dt_node_is_actfunc(const dt_node_t *);
2066ff6d951SJohn Birrell 
2076ff6d951SJohn Birrell extern dt_node_t *dt_node_int(uintmax_t);
2086ff6d951SJohn Birrell extern dt_node_t *dt_node_string(char *);
2096ff6d951SJohn Birrell extern dt_node_t *dt_node_ident(char *);
2106ff6d951SJohn Birrell extern dt_node_t *dt_node_type(dt_decl_t *);
2116ff6d951SJohn Birrell extern dt_node_t *dt_node_vatype(void);
2126ff6d951SJohn Birrell extern dt_node_t *dt_node_decl(void);
2136ff6d951SJohn Birrell extern dt_node_t *dt_node_func(dt_node_t *, dt_node_t *);
2146ff6d951SJohn Birrell extern dt_node_t *dt_node_offsetof(dt_decl_t *, char *);
2156ff6d951SJohn Birrell extern dt_node_t *dt_node_op1(int, dt_node_t *);
2166ff6d951SJohn Birrell extern dt_node_t *dt_node_op2(int, dt_node_t *, dt_node_t *);
2176ff6d951SJohn Birrell extern dt_node_t *dt_node_op3(dt_node_t *, dt_node_t *, dt_node_t *);
2186ff6d951SJohn Birrell extern dt_node_t *dt_node_statement(dt_node_t *);
2196ff6d951SJohn Birrell extern dt_node_t *dt_node_pdesc_by_name(char *);
2206ff6d951SJohn Birrell extern dt_node_t *dt_node_pdesc_by_id(uintmax_t);
2216ff6d951SJohn Birrell extern dt_node_t *dt_node_clause(dt_node_t *, dt_node_t *, dt_node_t *);
2226ff6d951SJohn Birrell extern dt_node_t *dt_node_inline(dt_node_t *);
2236ff6d951SJohn Birrell extern dt_node_t *dt_node_member(dt_decl_t *, char *, dt_node_t *);
2246ff6d951SJohn Birrell extern dt_node_t *dt_node_xlator(dt_decl_t *, dt_decl_t *, char *, dt_node_t *);
2256ff6d951SJohn Birrell extern dt_node_t *dt_node_probe(char *, int, dt_node_t *, dt_node_t *);
2266ff6d951SJohn Birrell extern dt_node_t *dt_node_provider(char *, dt_node_t *);
2276ff6d951SJohn Birrell extern dt_node_t *dt_node_program(dt_node_t *);
228*650f66acSMark Johnston extern dt_node_t *dt_node_if(dt_node_t *, dt_node_t *, dt_node_t *);
2296ff6d951SJohn Birrell 
2306ff6d951SJohn Birrell extern dt_node_t *dt_node_link(dt_node_t *, dt_node_t *);
2316ff6d951SJohn Birrell extern dt_node_t *dt_node_cook(dt_node_t *, uint_t);
2326ff6d951SJohn Birrell 
2336ff6d951SJohn Birrell extern dt_node_t *dt_node_xalloc(dtrace_hdl_t *, int);
2346ff6d951SJohn Birrell extern void dt_node_free(dt_node_t *);
2356ff6d951SJohn Birrell 
2366ff6d951SJohn Birrell extern dtrace_attribute_t dt_node_list_cook(dt_node_t **, uint_t);
2376ff6d951SJohn Birrell extern void dt_node_list_free(dt_node_t **);
2386ff6d951SJohn Birrell extern void dt_node_link_free(dt_node_t **);
2396ff6d951SJohn Birrell 
2406ff6d951SJohn Birrell extern void dt_node_attr_assign(dt_node_t *, dtrace_attribute_t);
2418e648814SRui Paulo extern void dt_node_type_assign(dt_node_t *, ctf_file_t *, ctf_id_t, boolean_t);
2426ff6d951SJohn Birrell extern void dt_node_type_propagate(const dt_node_t *, dt_node_t *);
2436ff6d951SJohn Birrell extern const char *dt_node_type_name(const dt_node_t *, char *, size_t);
2446ff6d951SJohn Birrell extern size_t dt_node_type_size(const dt_node_t *);
2456ff6d951SJohn Birrell 
2466ff6d951SJohn Birrell extern dt_ident_t *dt_node_resolve(const dt_node_t *, uint_t);
2476ff6d951SJohn Birrell extern size_t dt_node_sizeof(const dt_node_t *);
2486ff6d951SJohn Birrell extern void dt_node_promote(dt_node_t *, dt_node_t *, dt_node_t *);
2496ff6d951SJohn Birrell 
2506ff6d951SJohn Birrell extern void dt_node_diftype(dtrace_hdl_t *,
2516ff6d951SJohn Birrell     const dt_node_t *, dtrace_diftype_t *);
2526ff6d951SJohn Birrell extern void dt_node_printr(dt_node_t *, FILE *, int);
253*650f66acSMark Johnston extern void dt_printd(dt_node_t *, FILE *, int);
2546ff6d951SJohn Birrell extern const char *dt_node_name(const dt_node_t *, char *, size_t);
2556ff6d951SJohn Birrell extern int dt_node_root(dt_node_t *);
2566ff6d951SJohn Birrell 
2576ff6d951SJohn Birrell struct dtrace_typeinfo;	/* see <dtrace.h> */
2586ff6d951SJohn Birrell struct dt_pcb;		/* see <dt_impl.h> */
2596ff6d951SJohn Birrell 
2606ff6d951SJohn Birrell #define	IS_CHAR(e) \
2616ff6d951SJohn Birrell 	(((e).cte_format & (CTF_INT_CHAR | CTF_INT_SIGNED)) == \
2626ff6d951SJohn Birrell 	(CTF_INT_CHAR | CTF_INT_SIGNED) && (e).cte_bits == NBBY)
2636ff6d951SJohn Birrell 
2646ff6d951SJohn Birrell #define	IS_VOID(e) \
2656ff6d951SJohn Birrell 	((e).cte_offset == 0 && (e).cte_bits == 0)
2666ff6d951SJohn Birrell 
2676ff6d951SJohn Birrell extern int dt_type_lookup(const char *, struct dtrace_typeinfo *);
2686ff6d951SJohn Birrell extern int dt_type_pointer(struct dtrace_typeinfo *);
2696ff6d951SJohn Birrell extern const char *dt_type_name(ctf_file_t *, ctf_id_t, char *, size_t);
2706ff6d951SJohn Birrell 
2716ff6d951SJohn Birrell typedef enum {
2726ff6d951SJohn Birrell 	YYS_CLAUSE,	/* lex/yacc state for finding program clauses */
2736ff6d951SJohn Birrell 	YYS_DEFINE,	/* lex/yacc state for parsing persistent definitions */
2746ff6d951SJohn Birrell 	YYS_EXPR,	/* lex/yacc state for parsing D expressions */
2756ff6d951SJohn Birrell 	YYS_DONE,	/* lex/yacc state for indicating parse tree is done */
2766ff6d951SJohn Birrell 	YYS_CONTROL	/* lex/yacc state for parsing control lines */
2776ff6d951SJohn Birrell } yystate_t;
2786ff6d951SJohn Birrell 
2796ff6d951SJohn Birrell extern void dnerror(const dt_node_t *, dt_errtag_t, const char *, ...);
2806ff6d951SJohn Birrell extern void dnwarn(const dt_node_t *, dt_errtag_t, const char *, ...);
2816ff6d951SJohn Birrell 
2826ff6d951SJohn Birrell extern void xyerror(dt_errtag_t, const char *, ...);
2836ff6d951SJohn Birrell extern void xywarn(dt_errtag_t, const char *, ...);
2846ff6d951SJohn Birrell extern void xyvwarn(dt_errtag_t, const char *, va_list);
2856ff6d951SJohn Birrell 
2866ff6d951SJohn Birrell extern void yyerror(const char *, ...);
2876ff6d951SJohn Birrell extern void yywarn(const char *, ...);
2886ff6d951SJohn Birrell extern void yyvwarn(const char *, va_list);
2896ff6d951SJohn Birrell 
2906ff6d951SJohn Birrell extern void yylabel(const char *);
2916ff6d951SJohn Birrell extern void yybegin(yystate_t);
2926ff6d951SJohn Birrell extern void yyinit(struct dt_pcb *);
2936ff6d951SJohn Birrell 
2946ff6d951SJohn Birrell extern int yyparse(void);
2956ff6d951SJohn Birrell extern int yyinput(void);
2966ff6d951SJohn Birrell 
2976ff6d951SJohn Birrell #ifdef	__cplusplus
2986ff6d951SJohn Birrell }
2996ff6d951SJohn Birrell #endif
3006ff6d951SJohn Birrell 
3016ff6d951SJohn Birrell #endif	/* _DT_PARSER_H */
302