コード例 #1
0
def getPythonCode(code):
    '''Convert the given Racecar code into the Python code that will
    run in the GUI.'''

    # first parse the string
    ast = parseString(code)

    # then check for errors
    if len(ast.errors) > 0:
        return (None, ast.errors)

    # then run the string through the semantic analyzer
    # ast = runSemanticAnalyzer(ast)

    # then generate python code!
    pythonCode = generatePythonCode(ast)

    return (pythonCode, None)
コード例 #2
0
ファイル: MultiplyStrings.py プロジェクト: yanh/pyshua
 def output(self):
     from Parser import parseString
     for o in parseString(open(self.outputPath)):
         yield o[0]
コード例 #3
0
ファイル: SimplifyPath.py プロジェクト: beyondai/pyshua
 def output(self):
     from Parser import parseString
     for o in parseString(open(self.outputPath)):
         yield o[0]
コード例 #4
0
ファイル: SimplifyPath.py プロジェクト: beyondai/pyshua
 def input(self):
     from Parser import parseString
     return parseString(open(self.inputPath))
コード例 #5
0
 def input(self):
     from Parser import parseString
     return parseString(open(self.inputPath))