Beispiel #1
0
	def __init__(self):
		Replacer.__init__(self,
			[
				(r'for\s+(\w+)\s+in\srange\((\d+),(\d+)\)\s*:', r'for(int \1 = \2; \1 < \3; \1++)'),
				(r'for\s+(\w+)\s+in\srange\((\d+),(\d+),([-+]{0,1})(\d+)\)\s*:', r'for(int \1 = \2; \1 < \3; \1 \4= \5)')
			]
			)
Beispiel #2
0
 def __init__(self):
     Replacer.__init__(
         self,
         [(r'for\s+(\w+)\s+in\srange\((\d+),(\d+)\)\s*:',
           r'for(int \1 = \2; \1 < \3; \1++)'),
          (r'for\s+(\w+)\s+in\srange\((\d+),(\d+),([-+]{0,1})(\d+)\)\s*:',
           r'for(int \1 = \2; \1 < \3; \1 \4= \5)')])
	def __init__(self):
		Replacer.__init__(self, 
			(r'([a-z]\w*)\s*=\s*(\d*)\.(\d+)\s*', r'double \1 = \2.\3;')
			)


#TODO: .6 unterstuetzen
 def __init__(self):
     Replacer.__init__(self, (r'if\s+(.*):', r'if (\1)'))
 def __init__(self):
     Replacer.__init__(self, [
         (),
     ])
Beispiel #6
0
 def __init__(self):
     Replacer.__init__(self, [
         (r"print\s*\((.*)\)", r"System.out.println(\1);"),
     ])
	def __init__(self):
		Replacer.__init__(self,
			(r"(.*\w)[^;{]$", r"\1 ;")
			)
	def __init__(self):
		Replacer.__init__(self, 
			(r'((?:\n\s+.*)+)', r'{\n\1\n}')
			)
Beispiel #9
0
 def __init__(self):
     Replacer.__init__(self, (r"(.*\w)[^;{]$", r"\1 ;"))
Beispiel #10
0
	def __init__(self):
		Replacer.__init__(self, 
			[
				(),
			]
			)
Beispiel #11
0
 def __init__(self):
     Replacer.__init__(
         self, (r'([a-z]\w*)\s*=\s*"(.*)"\s*', r'String \1 = "\2";'))
	def __init__(self):
		Replacer.__init__(self, 
			(r'([a-z]\w*)\s*=\s*(\d+)\s*$', r'int \1 = \2;')
			)
 def __init__(self):
     Replacer.__init__(self, [(r"print\s*\((.*)\)", r"System.out.println(\1);")])
Beispiel #14
0
	def __init__(self):
		Replacer.__init__(self, 
			(r'if\s+(.*):', r'if (\1)')
			)		
Beispiel #15
0
    def __init__(self):
        Replacer.__init__(
            self, (r'([a-z]\w*)\s*=\s*(\d*)\.(\d+)\s*', r'double \1 = \2.\3;'))


#TODO: .6 unterstuetzen
Beispiel #16
0
	def __init__(self):
		Replacer.__init__(self, 
			(r'([a-z]\w*)\s*=\s*"(.*)"\s*', r'String \1 = "\2";')
			)