Пример #1
0
def run():
    import parsed_text
    import os, sys
    if os.fork() == 0:
        for v in variables.values():
            do_print(v)
        for s in subroutines.values():
            do_print_subroutines(s)
        sys.exit(0)

    if os.fork() == 0:
        tags = []
        l = variables.keys()
        file = open("irpf90_entities", "w")
        l.sort()
        for v in l:
            do_print_short(file, variables[v])
            line = variables[v].line
            #     tags.append( '%s\t%s\t/%s/;"\n'%(v,line.filename[0],line.text.split('!')[0].strip()) )
            tags.append('%s\t%s\t%d\n' % (v, line.filename[0], line.i))
        file.close()
        l = subroutines.keys()
        for v in l:
            line = subroutines[v].line
            #     tags.append('%s\t%s\t/%s/;"\n'%(v,line.filename,line.text.split('!')[0].strip()))
            tags.append('%s\t%s\t%d\n' % (v, line.filename, line.i))
        tags.sort()
        file = open("tags", "w")
        for line in tags:
            file.write(line)
        file.close()
        sys.exit(0)
Пример #2
0
def run():
  import parsed_text
  import os,sys
  pid1 = os.fork()
  if pid1 == 0:
    for v in variables.values():
      do_print(v)
    for s in subroutines.values():
      do_print_subroutines(s)
    sys.exit(0)

  pid2 = os.fork()
  if pid2 == 0:
    tags = []
    l = variables.keys()
    file = open("irpf90_entities","w")
    l.sort()
    for v in l:
      do_print_short(file,variables[v])
      line = variables[v].line
#     tags.append( '%s\t%s\t/%s/;"\n'%(v,line.filename[0],line.text.split('!')[0].strip()) )
      tags.append( '%s\t%s\t%d\n'%(v,line.filename[0],line.i) )
    file.close()
    l = subroutines.keys()
    for v in l:
      line = subroutines[v].line
#     tags.append('%s\t%s\t/%s/;"\n'%(v,line.filename,line.text.split('!')[0].strip()))
      tags.append('%s\t%s\t%d\n'%(v,line.filename,line.i))
    tags.sort()
    file = open("tags","w")
    for line in tags:
      file.write(line)
    file.close()
    sys.exit(0)

  os.waitpid(pid1,0)
  os.waitpid(pid2,0)
Пример #3
0
#   Universite Paul Sabatier
#   118, route de Narbonne
#   31062 Toulouse Cedex 4
#   [email protected]


from util import *
from irpf90_t import *
from variables import variables
from preprocessed_text import preprocessed_text
from subroutines import subroutines
import regexps, re
import error

vtuple = map(lambda v: (v, variables[v].same_as, variables[v].regexp), variables.keys())
stuple = map(lambda s: (s, subroutines[s].regexp), subroutines.keys())
stuple = filter(lambda s: subroutines[s[0]].is_function, stuple)
re_string_sub = regexps.re_string.sub

regexps_re_string_sub = regexps.re_string.sub
def find_variables_in_line(line):
  assert isinstance(line,Line)
  result = []
  sub_done = False
  buffer = line.lower
  ap = result.append
  for v,same_as,regexp in vtuple:
    if v in buffer:
      if not sub_done:
        buffer = regexps_re_string_sub('',buffer)
        sub_done = True
Пример #4
0
#   Universite Paul Sabatier
#   118, route de Narbonne
#   31062 Toulouse Cedex 4
#   [email protected]

from util import *
from irpf90_t import *
from variables import variables
from preprocessed_text import preprocessed_text
from subroutines import subroutines
import regexps, re
import error

vtuple = map(lambda v: (v, variables[v].same_as, variables[v].regexp),
             variables.keys())
stuple = map(lambda s: (s, subroutines[s].regexp), subroutines.keys())
stuple = filter(lambda s: subroutines[s[0]].is_function, stuple)
re_string_sub = regexps.re_string.sub

regexps_re_string_sub = regexps.re_string.sub


def find_variables_in_line(line):
    assert isinstance(line, Line)
    result = []
    sub_done = False
    buffer = line.lower
    ap = result.append
    for v, same_as, regexp in vtuple:
        if v in buffer:
            if not sub_done: