This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Canonical list of reserved words ?
- From: fche at redhat dot com (Frank Ch. Eigler)
- To: "Daniel P. Berrange" <berrange at redhat dot com>
- Cc: systemtap at sourceware dot org
- Date: Thu, 01 Nov 2012 11:42:35 -0400
- Subject: Re: Canonical list of reserved words ?
- References: <20121101144940.GE7059@redhat.com>
"Daniel P. Berrange" <berrange@redhat.com> writes:
> We've had fairly frequent bugs in QEMU where generated tapsets contain
> variables clashing with systemd reserved words. [...]
> for name in e.args.names():
> # Append underscore to reserved keywords
> if name in ('limit', 'in', 'next', 'self', 'function'):
> name += '_'
> out(' %s = $arg%d;' % (name, i))
> i += 1
Right, that's inconvenient. Maybe prefix with them all with "q"?
("self" isn't a keyword fwiw.)
> To avoid this proper in future I'm looking for a full list of all
> systemtap reserved words. I've looked at the docs but not found a
> clear list yet, so can someone point me int he right direction
I don't see it in the docs, but the parser source code fesses up
thusly:
% grep keywords.insert parse.cxx
keywords.insert("probe");
keywords.insert("global");
keywords.insert("function");
keywords.insert("if");
keywords.insert("else");
keywords.insert("for");
keywords.insert("foreach");
keywords.insert("in");
keywords.insert("limit");
keywords.insert("return");
keywords.insert("delete");
keywords.insert("while");
keywords.insert("break");
keywords.insert("continue");
keywords.insert("next");
keywords.insert("string");
keywords.insert("long");
keywords.insert("try");
keywords.insert("catch");
- FChE