def process_item(self): line = self.item.get_line() line = self.item.apply_map(line) self.isabstract = line.startswith('abstract') if self.isabstract: self.generic_spec = '' else: self.generic_spec = line[len(self.blocktype):].strip() self.name = self.generic_spec # XXX return BeginStatement.process_item(self)
def process_item(self): ''' Populate the state of this Select object by parsing the associated line of code ''' item = self.item # TODO make the following more robust, particularly to the # presence of a name at the beginning # (e.g. "a_name: select case(...)") line = item.get_line()[6:].lstrip()[4:].lstrip()[1:-1].strip() self.expr = item.apply_map(line) self.construct_name = self.item.name return BeginStatement.process_item(self)
def process_subitem(self, item): r = False if self.endlabel: label = item.label if label == self.endlabel: r = True if isinstance(self.parent, Do) and label == self.parent.endlabel: # the same item label may be used for different block ends self.put_item(item) return BeginStatement.process_subitem(self, item) or r
def process_item(self): item = self.item line = item.get_line() m = self.item_re(line) label = m.group('label').strip() or None if label: label = int(label) self.endlabel = label self.construct_name = item.name self.loopcontrol = m.group('loopcontrol').strip() return BeginStatement.process_item(self)
def process_subitem(self, item): # MAIN block does not define start/end line conditions, # so it should never end until all lines are read. # However, sometimes F77 programs lack the PROGRAM statement, # and here we fix that: if self.reader.format.is_f77: line = item.get_line() if line == 'end': message = item.reader.format_message( 'WARNING', 'assuming the end of undefined PROGRAM statement', item.span[0], item.span[1]) logger.warning(message) # print >> sys.stderr, message p = Program(self) p.content.extend(self.content) p.content.append(EndProgram(p, item)) self.content[:] = [p] return return BeginStatement.process_subitem(self, item)
def process_item(self): self.name = self.item.get_line()[5:].lstrip()[4:].lstrip() return BeginStatement.process_item(self)
def process_item(self): self.name = self.item.get_line().replace(' ', '') self.name = self.name[len(self.blocktype):].strip() return BeginStatement.process_item(self)
def process_item(self): return BeginStatement.process_item(self)
def process_item(self): line = self.item.get_line()[9:].lstrip() self.associations = line[1:-1].strip() return BeginStatement.process_item(self)
def process_item(self): self.specs = self.item.get_line()[6:].lstrip()[1:-1].strip() return BeginStatement.process_item(self)
def process_item(self): self.expr = self.item.apply_map( self.item.get_line()[5:].lstrip()[1:-1].strip()) self.construct_name = self.item.name return BeginStatement.process_item(self)
def tofortran(self, isfix=None): if isfix: tab = 'C' else: tab = self.get_indent_tab(isfix=isfix) + '!' return tab + BeginStatement.tofortran(self, isfix=isfix)