diff options
author | Johan Dahlin <johan@src.gnome.org> | 2008-05-06 00:29:11 +0000 |
---|---|---|
committer | Johan Dahlin <johan@src.gnome.org> | 2008-05-06 00:29:11 +0000 |
commit | b22b5bfb007c4bc6202b7fd901a38869af1d234b (patch) | |
tree | 2ed89ca89fdc6e2f4cc9233bbed822ae08d7503f /giscanner | |
parent | 01732433f654cb655ae05752742879ef10970789 (diff) | |
download | gobject-introspection-b22b5bfb007c4bc6202b7fd901a38869af1d234b.tar.gz |
Add data type constants
svn path=/trunk/; revision=267
Diffstat (limited to 'giscanner')
-rw-r--r-- | giscanner/ast.py | 56 |
1 files changed, 55 insertions, 1 deletions
diff --git a/giscanner/ast.py b/giscanner/ast.py index 9780548e..9ce964b0 100644 --- a/giscanner/ast.py +++ b/giscanner/ast.py @@ -18,6 +18,60 @@ # 02110-1301, USA. # +"""AST nodes +This file descbribes abstract data type nodes independent on the +implementation language. + +These can later on be extended (eg subclassed) with additional information +which is language/library/domain specific. +""" + +## +## Types +## + +# Basic types +TYPE_INT8 = 'int8' +TYPE_UINT8 = 'uint8' +TYPE_INT16 = 'int16' +TYPE_UINT16 = 'uint16' +TYPE_INT32 = 'int32' +TYPE_UINT32 = 'uint32' +TYPE_INT64 = 'int64' +TYPE_UINT64 = 'uint64' +TYPE_LONG = 'long' +TYPE_ULONG = 'ulong' + +# Floating-point +TYPE_FLOAT = 'float' +TYPE_DOUBLE = 'double' + +# Higher-level data types +TYPE_NONE = 'none' +TYPE_ANY = 'any' # CORBA Any/Variant/GValue, holds anything. +TYPE_BOOLEAN = 'boolean' # True/False +TYPE_STRING = 'string' # Sequence of characters +TYPE_SEQUENCE = 'sequence' # Sequence of something +TYPE_CHAR = 'char' # Character +TYPE_UCHAR = 'uchar' # Unsigned Character +TYPE_SIZE = 'size' # Size type (memory, buffer etc) +TYPE_SSIZE = 'ssize' + +# Wide/Unicode +TYPE_UCHAR = 'uchar' +TYPE_USTRING = 'ustring' + +# Domain specific, but practically useful +TYPE_FILENAME = 'filename' + +## +## Parameters +## + +PARAM_DIRECTION_IN = 'in' +PARAM_DIRECTION_OUT = 'out' +PARAM_DIRECTION_INOUT = 'inout' + class Node(object): def __init__(self, name=None): @@ -54,7 +108,7 @@ class Parameter(Node): def __init__(self, name, typenode): Node.__init__(self, name) self.type = typenode - self.direction = 'in' + self.direction = PARAM_DIRECTION_IN self.transfer = False def __repr__(self): |