def make_node(cls, id_, arglist, lineno):
        """ Creates an array access. A(x1, x2, ..., xn)
        """
        assert isinstance(arglist, SymbolARGLIST)
        variable = gl.SYMBOL_TABLE.access_array(id_, lineno)
        if variable is None:
            return None

        if len(variable.bounds) != len(arglist):
            syntax_error(lineno, "Array '%s' has %i dimensions, not %i" %
                         (variable.name, len(variable.bounds), len(arglist)))
            return None

        # Checks for array subscript range if the subscript is constant
        # e.g. A(1) is a constant subscript access
        for i, b in zip(arglist, variable.bounds):
            btype = gl.SYMBOL_TABLE.basic_types[gl.BOUND_TYPE]
            lower_bound = NUMBER(b.lower, type_=btype, lineno=lineno)
            i.value = BINARY.make_node('MINUS',
                                       TYPECAST.make_node(btype, i.value, lineno),
                                       lower_bound, lineno, func=lambda x, y: x - y,
                                       type_=btype)
            if is_number(i.value) or is_const(i.value):
                val = i.value.value
                if val < 0 or val > b.count:
                    warning(lineno, "Array '%s' subscript out of range" % id_)

        # Returns the variable entry and the node
        return cls(variable, arglist, lineno)
def make_node ( cls , id_ , arglist , lineno ) : assert isinstance ( arglist , SymbolARGLIST ) variable = gl . SYMBOL_TABLE . access_array ( id_ , lineno ) if variable is None : return None if len ( variable . bounds ) != len ( arglist ) : syntax_error ( lineno , "Array '%s' has %i dimensions, not %i" % ( variable . name , len ( variable . bounds ) , len ( arglist ) ) ) return None for i , b in zip ( arglist , variable . bounds ) : btype = gl . SYMBOL_TABLE . basic_types [ gl . BOUND_TYPE ] lower_bound = NUMBER ( b . lower , type_ = btype , lineno = lineno ) i . value = BINARY . make_node ( 'MINUS' , TYPECAST . make_node ( btype , i . value , lineno ) , lower_bound , lineno , func = lambda x , y : x - y , type_ = btype ) if is_number ( i . value ) or is_const ( i . value ) : val = i . value . value if val < 0 or val > b . count : warning ( lineno , "Array '%s' subscript out of range" % id_ ) return cls ( variable , arglist , lineno )
Creates an array access. A(x1, x2, ..., xn)