sbus_codegen revision df4e1db5d41c903ae57fd880acc76a0ad84aa7b2
65c4736d9c0ebc6d9b1d991593b55566909da9cdBrian Wellington# Stef Walter <stefw@redhat.com>
65c4736d9c0ebc6d9b1d991593b55566909da9cdBrian Wellington# Copyright (C) 2014 Red Hat
65c4736d9c0ebc6d9b1d991593b55566909da9cdBrian Wellington# This program is free software; you can redistribute it and/or modify
65c4736d9c0ebc6d9b1d991593b55566909da9cdBrian Wellington# it under the terms of the GNU General Public License as published by
65c4736d9c0ebc6d9b1d991593b55566909da9cdBrian Wellington# the Free Software Foundation; either version 3 of the License, or
65c4736d9c0ebc6d9b1d991593b55566909da9cdBrian Wellington# (at your option) any later version.
65c4736d9c0ebc6d9b1d991593b55566909da9cdBrian Wellington# This program is distributed in the hope that it will be useful,
65c4736d9c0ebc6d9b1d991593b55566909da9cdBrian Wellington# but WITHOUT ANY WARRANTY; without even the implied warranty of
65c4736d9c0ebc6d9b1d991593b55566909da9cdBrian Wellington# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
65c4736d9c0ebc6d9b1d991593b55566909da9cdBrian Wellington# GNU General Public License for more details.
65c4736d9c0ebc6d9b1d991593b55566909da9cdBrian Wellington# You should have received a copy of the GNU General Public License
65c4736d9c0ebc6d9b1d991593b55566909da9cdBrian Wellington# along with this program. If not, see <http://www.gnu.org/licenses/>.
65c4736d9c0ebc6d9b1d991593b55566909da9cdBrian Wellington# Some parser code from GLib
65c4736d9c0ebc6d9b1d991593b55566909da9cdBrian Wellington# Copyright (C) 2008-2011 Red Hat, Inc.
65c4736d9c0ebc6d9b1d991593b55566909da9cdBrian Wellington# This library is free software; you can redistribute it and/or
65c4736d9c0ebc6d9b1d991593b55566909da9cdBrian Wellington# modify it under the terms of the GNU Lesser General Public
65c4736d9c0ebc6d9b1d991593b55566909da9cdBrian Wellington# License as published by the Free Software Foundation; either
65c4736d9c0ebc6d9b1d991593b55566909da9cdBrian Wellington# version 2 of the License, or (at your option) any later version.
65c4736d9c0ebc6d9b1d991593b55566909da9cdBrian Wellington# This library is distributed in the hope that it will be useful,
65c4736d9c0ebc6d9b1d991593b55566909da9cdBrian Wellington# but WITHOUT ANY WARRANTY; without even the implied warranty of
65c4736d9c0ebc6d9b1d991593b55566909da9cdBrian Wellington# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
65c4736d9c0ebc6d9b1d991593b55566909da9cdBrian Wellington# Lesser General Public License for more details.
65c4736d9c0ebc6d9b1d991593b55566909da9cdBrian Wellington# You should have received a copy of the GNU Lesser General
65c4736d9c0ebc6d9b1d991593b55566909da9cdBrian Wellington# Public License along with this library; if not, write to the
65c4736d9c0ebc6d9b1d991593b55566909da9cdBrian Wellington# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
65c4736d9c0ebc6d9b1d991593b55566909da9cdBrian Wellington# Boston, MA 02111-1307, USA.
65c4736d9c0ebc6d9b1d991593b55566909da9cdBrian Wellington# Portions by: David Zeuthen <davidz@redhat.com>
# http://dbus.freedesktop.org/doc/dbus-specification.html#introspection-format
# DBus interface. For many examples see /usr/share/dbus-1/interfaces/ on a
elif self.file:
return message
self.type = type
if type in BASIC_TYPES:
return False
return True
self.args = []
return sig
self.methods = []
self.signals = []
self.properties = []
if with_names:
if with_names:
return str
for meth in iface.methods:
return invokers
for sig in iface.signals:
if sig.args:
if sig.args:
for prop in properties:
elif prop.readable:
elif prop.writable:
if prop.readable:
if iface.methods:
if iface.signals:
if iface.properties:
if include_header:
if iface.methods:
if iface.signals:
if iface.properties:
for meth in iface.methods:
for prop in iface.properties:
for meth in iface.methods:
for sig in iface.signals:
for prop in iface.properties:
for meth in iface.methods:
self.state_stack = []
try:
if self.state == STATE_IGNORED:
elif self.cur_object and name == STATE_ANNOTATION:
elif self.state == STATE_TOP:
if name == STATE_NODE:
elif self.state == STATE_NODE:
if name == STATE_INTERFACE:
elif self.state == STATE_INTERFACE:
if name == STATE_METHOD:
elif name == STATE_SIGNAL:
elif name == STATE_PROPERTY:
elif self.state == STATE_METHOD:
elif self.state == STATE_SIGNAL:
elif self.state == STATE_PROPERTY:
elif self.state == STATE_ARG:
if options.output:
if options.output:
try: