X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=specs%2Fstdapi.py;h=795f0cfa2776f7e7f24c7cf0803f85cad2e8f8b8;hb=ba7bb0d584f82da2de0db2af720c037ca386c945;hp=990c6510ca6a914cce8eba23998ba4599edf826e;hpb=ea39b2cd2442e66eb5f65055a4042bacfc3ec1ca;p=apitrace diff --git a/specs/stdapi.py b/specs/stdapi.py index 990c651..795f0cf 100644 --- a/specs/stdapi.py +++ b/specs/stdapi.py @@ -270,6 +270,18 @@ class Array(Type): return visitor.visitArray(self, *args, **kwargs) +class AttribArray(Type): + + def __init__(self, keyType, valueTypes): + Type.__init__(self, (Pointer(Const(Int))).expr) + self.type = (Pointer(Const(Int))) # for function prototypes and such + self.keyType = keyType + self.valueTypes = valueTypes + + def visit(self, visitor, *args, **kwargs): + return visitor.visitAttribArray(self, *args, **kwargs) + + class Blob(Type): def __init__(self, type, size): @@ -572,6 +584,9 @@ class Visitor: def visitArray(self, array, *args, **kwargs): raise NotImplementedError + def visitAttribArray(self, array, *args, **kwargs): + raise NotImplementedError + def visitBlob(self, blob, *args, **kwargs): raise NotImplementedError @@ -776,6 +791,10 @@ class Traverser(Visitor): def visitArray(self, array, *args, **kwargs): self.visit(array.type, *args, **kwargs) + def visitAttribArray(self, attribs, *args, **kwargs): + for key, valueType in attribs.valueTypes: + self.visit(valueType, *args, **kwargs) + def visitBlob(self, array, *args, **kwargs): pass