Beispiel #1
0
 def p_type_2(p):
     """
     type : INT8 '[' ']'
          | INT16 '[' ']'
          | INT32 '[' ']'
          | INT64 '[' ']'
          | UINT8 '[' ']'
          | UINT16 '[' ']'
          | UINT32 '[' ']'
          | UINT64 '[' ']'
          | BOOLEAN '[' ']'
          | FLOAT '[' ']'
          | DOUBLE '[' ']'
          | STRING '[' ']'
          | BYTEBUFFER '[' ']'
     """
     type_class = getattr(ast, p[1])
     p[0] = ast.Array(name=None, element_type=type_class())
Beispiel #2
0
 def p_type_4(p):
     """
     type : fqn '[' ']'
     """
     element_type = ast.Reference(name=p[1])
     p[0] = ast.Array(name=None, element_type=element_type)
Beispiel #3
0
 def p_array_def(p):
     """
     array_def : structured_comment ARRAY ID OF type
     """
     p[0] = ast.Array(name=p[3], element_type=p[5], comments=p[1])