Hi again! Was trying to convert a file over and got some errors that spit out. I'm assuming the errors I'm getting are from something I approached incorrectly, but here is the full output for development reference. I've got some files that are 8 thousand lines long of FoxPro so hoping we can get this figured out!
sh-3.2# vfp2py --logging /Users/login/Downloads/0bin_BKP1Vpxs.prg /Users/login/Downloads/Output.py
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/vfp2py/vfp2py.py", line 465, in run_parser
return getattr(parser, parser_start)()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/vfp2py/VisualFoxpro9Parser.py", line 2080, in prg
self.funcDef()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/vfp2py/VisualFoxpro9Parser.py", line 2924, in funcDef
self.lines()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/vfp2py/VisualFoxpro9Parser.py", line 2364, in lines
self.line()
^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/vfp2py/VisualFoxpro9Parser.py", line 2255, in line
self.controlStmt()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/vfp2py/VisualFoxpro9Parser.py", line 4029, in controlStmt
self.ifStmt()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/vfp2py/VisualFoxpro9Parser.py", line 3068, in ifStmt
localctx.ifBody = self.lines()
^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/vfp2py/VisualFoxpro9Parser.py", line 2364, in lines
self.line()
^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/vfp2py/VisualFoxpro9Parser.py", line 2255, in line
self.controlStmt()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/vfp2py/VisualFoxpro9Parser.py", line 4029, in controlStmt
self.ifStmt()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/vfp2py/VisualFoxpro9Parser.py", line 3068, in ifStmt
localctx.ifBody = self.lines()
^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/vfp2py/VisualFoxpro9Parser.py", line 2364, in lines
self.line()
^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/vfp2py/VisualFoxpro9Parser.py", line 2255, in line
self.controlStmt()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/vfp2py/VisualFoxpro9Parser.py", line 4029, in controlStmt
self.ifStmt()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/vfp2py/VisualFoxpro9Parser.py", line 3078, in ifStmt
localctx.elseBody = self.lines()
^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/vfp2py/VisualFoxpro9Parser.py", line 2364, in lines
self.line()
^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/vfp2py/VisualFoxpro9Parser.py", line 2265, in line
self.lineEnd()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/vfp2py/VisualFoxpro9Parser.py", line 2313, in lineEnd
self._errHandler.recoverInline(self)
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/antlr4/error/ErrorStrategy.py", line 703, in recoverInline
self.recover(recognizer, InputMismatchException(recognizer))
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/antlr4/error/ErrorStrategy.py", line 697, in recover
raise ParseCancellationException(e)
antlr4.error.Errors.ParseCancellationException: None
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.11/bin/vfp2py", line 33, in <module>
sys.exit(load_entry_point('vfp2py==0.1.0', 'console_scripts', 'vfp2py')())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/vfp2py/__main__.py", line 28, in main
vfp2py.convert_file(args.infile, args.outpath, encoding=args.encoding)
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/vfp2py/vfp2py.py", line 536, in convert_file
output = prg2py_after_preproc(data, 'prg', os.path.splitext(os.path.basename(infile))[0])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/vfp2py/vfp2py.py", line 479, in prg2py_after_preproc
tree = run_parser(stream, parser, parser_start)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/vfp2py/vfp2py.py", line 472, in run_parser
return getattr(parser, parser_start)()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/vfp2py/VisualFoxpro9Parser.py", line 2080, in prg
self.funcDef()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/vfp2py/VisualFoxpro9Parser.py", line 2924, in funcDef
self.lines()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/vfp2py/VisualFoxpro9Parser.py", line 2364, in lines
self.line()
^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/vfp2py/VisualFoxpro9Parser.py", line 2255, in line
self.controlStmt()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/vfp2py/VisualFoxpro9Parser.py", line 4029, in controlStmt
self.ifStmt()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/vfp2py/VisualFoxpro9Parser.py", line 3068, in ifStmt
localctx.ifBody = self.lines()
^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/vfp2py/VisualFoxpro9Parser.py", line 2364, in lines
self.line()
^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/vfp2py/VisualFoxpro9Parser.py", line 2255, in line
self.controlStmt()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/vfp2py/VisualFoxpro9Parser.py", line 4029, in controlStmt
self.ifStmt()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/vfp2py/VisualFoxpro9Parser.py", line 3068, in ifStmt
localctx.ifBody = self.lines()
^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/vfp2py/VisualFoxpro9Parser.py", line 2364, in lines
self.line()
^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/vfp2py/VisualFoxpro9Parser.py", line 2255, in line
self.controlStmt()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/vfp2py/VisualFoxpro9Parser.py", line 4029, in controlStmt
self.ifStmt()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/vfp2py/VisualFoxpro9Parser.py", line 3078, in ifStmt
localctx.elseBody = self.lines()
^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/vfp2py/VisualFoxpro9Parser.py", line 2364, in lines
self.line()
^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/vfp2py/VisualFoxpro9Parser.py", line 2265, in line
self.lineEnd()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/vfp2py/VisualFoxpro9Parser.py", line 2313, in lineEnd
self._errHandler.recoverInline(self)
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/antlr4/error/ErrorStrategy.py", line 403, in recoverInline
if self.singleTokenInsertion(recognizer):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/antlr4/error/ErrorStrategy.py", line 436, in singleTokenInsertion
self.reportMissingToken(recognizer)
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/antlr4/error/ErrorStrategy.py", line 344, in reportMissingToken
recognizer.notifyErrorListeners(msg, t, None)
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/antlr4/Parser.py", line 322, in notifyErrorListeners
listener.syntaxError(self, offendingToken, line, column, msg, e)
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/antlr4/error/ErrorListener.py", line 60, in syntaxError
delegate.syntaxError(recognizer, offendingSymbol, line, column, msg, e)
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/vfp2py/vfp2py.py", line 458, in syntaxError
raise Exception('Syntax Error on line {}: {}'.format(line, linetxt))
Exception: Syntax Error on line 166: ENDIF IF RECCOUNT()=0