]>
sourceware.org Git - systemtap.git/blob - parse.h
2 // Copyright (C) 2005-2010 Red Hat Inc.
3 // Copyright (C) 2007 Bull S.A.S
5 // This file is part of systemtap, and is free software. You can
6 // redistribute it and/or modify it under the terms of the GNU General
7 // Public License (GPL); either version 2, or (at your option) any
29 std::ostream
& operator << (std::ostream
& o
, const source_loc
& loc
);
33 con_unknown
, con_probe
, con_global
, con_function
, con_embedded
39 tok_junk
, tok_identifier
, tok_operator
, tok_string
, tok_number
,
40 tok_embedded
, tok_keyword
49 std::string msg
; // for tok_junk
50 void make_junk (std::string msg
);
51 const token
* chain
; // macro invocation that produced this token
56 token(const token
& other
):
57 location(other
.location
), type(other
.type
), content(other
.content
),
58 msg(other
.msg
), chain(other
.chain
) {}
62 std::ostream
& operator << (std::ostream
& o
, const token
& t
);
65 typedef enum { ctx_library
, ctx_local
} macro_ctx
;
67 /* structs from session.h: */
68 struct systemtap_session
;
70 const token
* tok
; // NB: macrodecl owns its token
72 std::vector
<std::string
> formal_args
;
73 std::vector
<const token
*> body
;
76 // Used for identifying subclasses that represent e.g. parameter bindings.
77 virtual bool is_closure() { return false; }
79 macrodecl () : tok(0), context(ctx_local
) { }
80 virtual ~macrodecl ();
84 stapfile
* parse (systemtap_session
& s
, std::istream
& i
, bool privileged
, bool errs_as_warnings
);
85 stapfile
* parse (systemtap_session
& s
, const std::string
& n
, bool privileged
, bool errs_as_warnings
);
87 stapfile
* parse_library_macros (systemtap_session
& s
, const std::string
& n
, bool errs_as_warnings
);
89 probe
* parse_synthetic_probe (systemtap_session
&s
, std::istream
& i
, const token
* tok
);
93 /* vim: set sw=2 ts=8 cino=>4,n-2,{2,^-2,t0,(0,u0,w1,M1 : */
This page took 0.039261 seconds and 5 git commands to generate.