Giter Site home page Giter Site logo

mwisslead / vfp2py Goto Github PK

View Code? Open in Web Editor NEW
43.0 15.0 21.0 4.42 MB

Convert Visual FoxPro(VFP) code into python code

License: MIT License

Makefile 0.13% ANTLR 3.12% Python 95.67% Vim Script 0.10% xBase 0.97% C 0.01%
foxpro vfp conversion rewrite python parser parse antlr4

vfp2py's Introduction

vfp2py

vfp2py is an attempt to create a tool to automatically create python code from foxpro 9 code.

Many but not nearly all commands are currently supported with missing commands to be added as need arises. Conversion can be done on individual prg files or whole projects pjx files.

Features

  • Translates code comments
  • Handles preprocessor commands
  • Support for reading and writing dbf files via Ethan Furman's dbf package
  • Many functions are inlined in the generated python code.
  • Many complex functions and commands are available through a runtime - vfpfunc.py
  • Somewhat functioning gui using PySide

Future work

  • Add more commands to parser
  • Improve gui
  • Rework scoping to facilitate operation of some commands.
  • Add missing code conversion for some commands currently supported by parser
  • Add more runtime functions
  • Put package on pypi for easier install
  • Speed up parsing

Installation

python -m pip install vfp2py

Usage

    $ vfp2py --help
    usage: vfp2py [-h] [--logging] infile outpath [search [search ...]]
    
    Tool for rewriting Foxpro code in Python
    
    positional arguments:
      infile      file to convert - supported file types are prg, mpr, spr, scx,
                  vcx, or pjx,
      outpath     path to output converted code, will be a filename for all but
                  pjx which will be a directory
      search      directory to search for included files
    
    optional arguments:
      -h, --help  show this help message and exit
      --logging   file to convert

To convert a file simply run vfp2py --logging input_file.prg output_file.py or vfp2py --logging input_project.pjx output_directory

Acknowledgments

Jayanta Narayan Choudhuri for providing a list of keyword and function abbreviations.

vfp2py's People

Contributors

mwisslead avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vfp2py's Issues

Runtime errors

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!

Let me know if there's anything I can do to help!

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

Error while running tests

ERROR: testbed.test_conversion.Test0
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/kevinclough/Projects/Jarvus/vfp2py/.eggs/nose-1.3.7-py2.7.egg/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/Users/kevinclough/Projects/Jarvus/vfp2py/testbed/test_conversion.py", line 59, in Test0
    test_output_str = vfp2py.vfp2py.prg2py(input_str, parser_start='lines', prepend_data='').strip()
  File "/Users/kevinclough/Projects/Jarvus/vfp2py/vfp2py/vfp2py.py", line 401, in prg2py
    tokens = preprocess_code(data).tokens
  File "/Users/kevinclough/Projects/Jarvus/vfp2py/vfp2py/vfp2py.py", line 198, in preprocess_code
    tree = parser.preprocessorCode()
  File "/Users/kevinclough/Projects/Jarvus/vfp2py/vfp2py/VisualFoxpro9Parser.py", line 1562, in preprocessorCode
    self.nonpreprocessorLine()
  File "/Users/kevinclough/Projects/Jarvus/vfp2py/vfp2py/VisualFoxpro9Parser.py", line 1903, in nonpreprocessorLine
    self.consume()
  File "build/bdist.macosx-10.11-x86_64/egg/antlr4/Parser.py", line 324, in consume
    self.getInputStream().consume()
  File "build/bdist.macosx-10.11-x86_64/egg/antlr4/BufferedTokenStream.py", line 97, in consume
    if self.sync(self.index + 1):
  File "build/bdist.macosx-10.11-x86_64/egg/antlr4/BufferedTokenStream.py", line 109, in sync
    fetched = self.fetch(n)
  File "build/bdist.macosx-10.11-x86_64/egg/antlr4/BufferedTokenStream.py", line 121, in fetch
    t = self.tokenSource.nextToken()
  File "build/bdist.macosx-10.11-x86_64/egg/antlr4/Lexer.py", line 126, in nextToken
    ttype = self._interp.match(self._input, self._mode)
  File "build/bdist.macosx-10.11-x86_64/egg/antlr4/atn/LexerATNSimulator.py", line 94, in match
    return self.execATN(input, dfa.s0)
  File "build/bdist.macosx-10.11-x86_64/egg/antlr4/atn/LexerATNSimulator.py", line 163, in execATN
    target = self.computeTargetState(input, s, t)
  File "build/bdist.macosx-10.11-x86_64/egg/antlr4/atn/LexerATNSimulator.py", line 221, in computeTargetState
    self.getReachableConfigSet(input, s.configs, reach, t)
  File "build/bdist.macosx-10.11-x86_64/egg/antlr4/atn/LexerATNSimulator.py", line 270, in getReachableConfigSet
    if self.closure(input, config, reach, currentAltReachedAcceptState, True, treatEofAsEpsilon):
  File "build/bdist.macosx-10.11-x86_64/egg/antlr4/atn/LexerATNSimulator.py", line 349, in closure
    currentAltReachedAcceptState = self.closure(input, c, configs, currentAltReachedAcceptState, speculative, treatEofAsEpsilon)
  File "build/bdist.macosx-10.11-x86_64/egg/antlr4/atn/LexerATNSimulator.py", line 337, in closure
    currentAltReachedAcceptState, speculative, treatEofAsEpsilon)
  File "build/bdist.macosx-10.11-x86_64/egg/antlr4/atn/LexerATNSimulator.py", line 347, in closure
    c = self.getEpsilonTarget(input, config, t, configs, speculative, treatEofAsEpsilon)
  File "build/bdist.macosx-10.11-x86_64/egg/antlr4/atn/LexerATNSimulator.py", line 385, in getEpsilonTarget
    if self.evaluatePredicate(input, t.ruleIndex, t.predIndex, speculative):
  File "build/bdist.macosx-10.11-x86_64/egg/antlr4/atn/LexerATNSimulator.py", line 454, in evaluatePredicate
    return self.recog.sempred(None, ruleIndex, predIndex)
  File "/Users/kevinclough/Projects/Jarvus/vfp2py/vfp2py/VisualFoxpro9Lexer.py", line 1768, in sempred
    return pred(localctx, predIndex)
  File "/Users/kevinclough/Projects/Jarvus/vfp2py/vfp2py/VisualFoxpro9Lexer.py", line 1774, in LINECOMMENT_sempred
    return _tokenStartCharPositionInLine == 0
NameError: global name '_tokenStartCharPositionInLine' is not defined```

I'm getting this error when I run `python setup.py test`

ImportError: attempted relative import with no known parent package

I am very new to Python so maybe the error I am getting could look silly and might have an obvious solution but I am struggling to solve it. I downloaded the vfp2py-master zipped file and extracted it in the Python folder in my c drive. Somehow managed to install the setup.py and now I am trying to run vfp2py where I get the below error:
File "C:\Users\DPA524\AppData\Local\Programs\Python\Python37-32\vfp2py-master\vfp2py_main_.py", line 7,
in
from . import vfp2py
ImportError: attempted relative import with no known parent package

Please guide me.
Thank you.

Syntax Error - Possible Missing Grammar Entry?

First, thank you for publishing the project. I haven't quite got it working for what I need just yet, but even so it's already saved me a headache and a half.

I'm getting a syntax error during conversion of this line: CALCULATE MAX(LEN(ALLTRIM(memofile))) TO ln

Looking at a couple of the closed issues, I'm assuming this is due to either not having an entry for CALCULATE in the grammar, (if I'm reading this correctly, it looks to be commented out) or not having an entry for the added TO clause.

I looked at adding it myself, but after a cursory look over the project I'm fairly sure that meddling with any of the source would be well beyond my pay grade. That said, I'm a Python programmer by trade so if you let me know the rough basics of adding the requisite information I'll happily make the updates and submit a PR when I have everything working.

AttributeError: module 'isort' has no attribute 'SortImports'

(base) girish@girish-System-Product-Name:~/Downloads/vfp2py-master$ vfp2py area.prg area.py
Traceback (most recent call last):
File "/home/girish/anaconda3/bin/vfp2py", line 33, in <module>
sys.exit(load_entry_point('vfp2py==0.1.0', 'console_scripts', 'vfp2py')())
File "/home/girish/anaconda3/lib/python3.8/site-packages/vfp2py-0.1.0-py3.8.egg/vfp2py/__main__.py", line 28, in main
vfp2py.convert_file(args.infile, args.outpath, encoding=args.encoding)
File "/home/girish/anaconda3/lib/python3.8/site-packages/vfp2py-0.1.0-py3.8.egg/vfp2py/vfp2py.py", line 536, in convert_file
output = prg2py_after_preproc(data, 'prg', os.path.splitext(os.path.basename(infile))[0])
File "/home/girish/anaconda3/lib/python3.8/site-packages/vfp2py-0.1.0-py3.8.egg/vfp2py/vfp2py.py", line 481, in prg2py_after_preproc
output_tree = PythonConvertVisitor(input_filename).visit(tree)
File "/home/girish/anaconda3/lib/python3.8/site-packages/vfp2py-0.1.0-py3.8.egg/vfp2py/vfp2py_convert_visitor.py", line 143, in visit
return super(type(self), self).visit(ctx)
File "/home/girish/anaconda3/lib/python3.8/site-packages/antlr4_python3_runtime-4.8-py3.8.egg/antlr4/tree/Tree.py", line 34, in visit
return tree.accept(self)
File "/home/girish/anaconda3/lib/python3.8/site-packages/vfp2py-0.1.0-py3.8.egg/vfp2py/VisualFoxpro9Parser.py", line 2305, in accept
return visitor.visitPrg(self)
File "/home/girish/anaconda3/lib/python3.8/site-packages/vfp2py-0.1.0-py3.8.egg/vfp2py/vfp2py_convert_visitor.py", line 186, in visitPrg
imports = isort.SortImports(file_contents='\n'.join(set(self.imports)), line_length=100000).output.splitlines()
AttributeError: module 'isort' has no attribute 'SortImports'
(base) girish@girish-System-Product-Name:~/Downloads/vfp2py-master$ ls
total 76K
drwx------ 2 girish girish 4.0K Dec 16 2020 vfp2py
-rw-rw-r-- 1 girish girish 45 Dec 16 2020 test.h
drwx------ 2 girish girish 4.0K Dec 16 2020 testbed
-rw-rw-r-- 1 girish girish 1.1K Dec 16 2020 setup.py
-rw-rw-r-- 1 girish girish 1.8K Dec 16 2020 README.md
-rw-rw-r-- 1 girish girish 565 Dec 16 2020 Makefile
-rw-rw-r-- 1 girish girish 1.1K Dec 16 2020 LICENSE
-rw-rw-r-- 1 girish girish 1.1K Dec 16 2020 .gitignore
drwx------ 2 girish girish 4.0K Dec 16 2020 extras
drwxr-xr-x 28 girish girish 20K Oct 15 17:42 ..
drwxrwxr-x 2 girish girish 4.0K Oct 15 17:42 vfp2py.egg-info
drwxrwxr-x 4 girish girish 4.0K Oct 15 17:42 build
drwxrwxr-x 2 girish girish 4.0K Oct 15 17:42 dist
-rwxrwxr-x 1 girish girish 1.2K Oct 15 17:48 area.prg
drwx------ 8 girish girish 4.0K Oct 15 17:48 .

I downloaded the zip and follow the python3 setup.py install, all went fine but when I tried to convert a .prg to .py, I got above error.

Install Issue

Hi there! I'm currently trying to get this running on mac OS using terminal, Py3, and pip3, I got the following error below but was unsure exactly if this error is more a user error of software error, please let me know, thank you!

Screen Shot 2023-02-08 at 10 09 55 AM

Syntax: SET UDFPARMS to VALUE

I'm not sure but this just feels like an issue because I'm on mac or a bad package version.
Thoughts?

python 3.7
OSX

pip3 list
Package Version


aenum 2.2.3
antlr4-python3-runtime 4.8
autopep8 1.5.3
dbf 0.98.3
isort 4.3.21
pip 20.1.1
pycodestyle 2.6.0
pyodbc 4.0.30
python-dateutil 2.8.1
setuptools 49.2.0
six 1.15.0
toml 0.10.1
wheel 0.34.2

vfp2py file.prg test

Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/vfp2py-0.1.0-py3.7.egg/vfp2py/vfp2py.py", line 465, in run_parser
return getattr(parser, parser_start)()
File "/usr/local/lib/python3.7/site-packages/vfp2py-0.1.0-py3.7.egg/vfp2py/VisualFoxpro9Parser.py", line 2371, in prg
self.match(VisualFoxpro9Parser.EOF)
File "/usr/local/lib/python3.7/site-packages/antlr4_python3_runtime-4.8-py3.7.egg/antlr4/Parser.py", line 118, in match
t = self._errHandler.recoverInline(self)
File "/usr/local/lib/python3.7/site-packages/antlr4_python3_runtime-4.8-py3.7.egg/antlr4/error/ErrorStrategy.py", line 692, in recoverInline
self.recover(recognizer, InputMismatchException(recognizer))
File "/usr/local/lib/python3.7/site-packages/antlr4_python3_runtime-4.8-py3.7.egg/antlr4/error/ErrorStrategy.py", line 686, 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 "/usr/local/bin/vfp2py", line 11, in
load_entry_point('vfp2py==0.1.0', 'console_scripts', 'vfp2py')()
File "/usr/local/lib/python3.7/site-packages/vfp2py-0.1.0-py3.7.egg/vfp2py/main.py", line 28, in main
vfp2py.convert_file(args.infile, args.outpath, encoding=args.encoding)
File "/usr/local/lib/python3.7/site-packages/vfp2py-0.1.0-py3.7.egg/vfp2py/vfp2py.py", line 536, in convert_file
output = prg2py_after_preproc(data, 'prg', os.path.splitext(os.path.basename(infile))[0])
File "/usr/local/lib/python3.7/site-packages/vfp2py-0.1.0-py3.7.egg/vfp2py/vfp2py.py", line 479, in prg2py_after_preproc
tree = run_parser(stream, parser, parser_start)
File "/usr/local/lib/python3.7/site-packages/vfp2py-0.1.0-py3.7.egg/vfp2py/vfp2py.py", line 472, in run_parser
return getattr(parser, parser_start)()
File "/usr/local/lib/python3.7/site-packages/vfp2py-0.1.0-py3.7.egg/vfp2py/VisualFoxpro9Parser.py", line 2367, in prg
self._errHandler.sync(self)
File "/usr/local/lib/python3.7/site-packages/antlr4_python3_runtime-4.8-py3.7.egg/antlr4/error/ErrorStrategy.py", line 223, in sync
self.reportUnwantedToken(recognizer)
File "/usr/local/lib/python3.7/site-packages/antlr4_python3_runtime-4.8-py3.7.egg/antlr4/error/ErrorStrategy.py", line 307, in reportUnwantedToken
recognizer.notifyErrorListeners(msg, t, None)
File "/usr/local/lib/python3.7/site-packages/antlr4_python3_runtime-4.8-py3.7.egg/antlr4/Parser.py", line 314, in notifyErrorListeners
listener.syntaxError(self, offendingToken, line, column, msg, e)
File "/usr/local/lib/python3.7/site-packages/antlr4_python3_runtime-4.8-py3.7.egg/antlr4/error/ErrorListener.py", line 60, in syntaxError
delegate.syntaxError(recognizer, offendingSymbol, line, column, msg, e)
File "/usr/local/lib/python3.7/site-packages/vfp2py-0.1.0-py3.7.egg/vfp2py/vfp2py.py", line 458, in syntaxError
raise Exception('Syntax Error on line {}: {}'.format(line, linetxt))
Exception: Syntax Error on line 17: SET UDFPARMS to VALUE

positional argument error

I came across the project and have a similar need. Attempting to run it against a .pjx I get the following:

Traceback (most recent call last):
File "/usr/local/bin/vfp2py", line 11, in
load_entry_point('vfp2py==0.1.0', 'console_scripts', 'vfp2py')()
File "/usr/local/lib/python3.7/site-packages/vfp2py-0.1.0-py3.7.egg/vfp2py/main.py", line 28, in main
vfp2py.convert_file(args.infile, args.outpath, encoding=args.encoding)
File "/usr/local/lib/python3.7/site-packages/vfp2py-0.1.0-py3.7.egg/vfp2py/vfp2py.py", line 503, in convert_file
convert_project(infile, outfile, encoding)
TypeError: convert_project() takes 2 positional arguments but 3 were given

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.