[Tutor] python parser
bob gailer
bgailer at gmail.com
Tue Dec 23 00:03:44 CET 2008
More thoughts on converting VFP to Python:
line-by-line can take into account control structures. One just
increases or decreases the indent when encountering the start or end of
a structure.
a bigger challenge is handling the work-area related commands such as
Scan, Replace, Skip, Set Relation, ....
the concept of data sessions
macro substitution
all the GUI stuff would be translated to one of the python GUI packages.
Not a trivial task!
An outline:
create initial dictionary of all initial special characters, keywords
including their abbreviations, ...?
create dictionary to hold all user-generated names (variables, classes,
procedures, windows, ...?)
awareness while scanning of #define and blocks such as text .. endtext
to ignore
scan file for procedure/function/define
certain initial characters take precedence = ? & # * && @ \
this list may be extended temporarily by commands like text
; is a special final character
assignment statement?
initial word a keyword or function?
if none of the above error?
and on and on.
--
Bob Gailer
Chapel Hill NC
919-636-4239
More information about the Tutor
mailing list