Hi,
i am using a program to parse a 4GL progress code, it works fine when there is no table definition is used but fails if i use a table refrence, gives me below error -
---------------------------
Error (Press HELP to view stack trace)
---------------------------
org.prorefactor.refactor.RefactorException: testparse_table.p:1: Unknown table name: customer
---------------------------
OK Help
---------------------------
i am having sports database connected on editor. below is the code i am using to parse and my pf file is using sports db -
using org.prorefactor.refactor.* from assembly.
using org.prorefactor.treeparser.* from assembly.
using org.prorefactor.core.* from assembly.
using java.io.* from assembly.
def var filename as char init "testparse_table.p".
def var indent as int no-undo.
def var outed as char view-as editor large scrollbar-vertical size 78 by 22.
display outed with frame f1 no-box no-labels.
def var prsession as class org.prorefactor.refactor.RefactorSession.
prsession = org.prorefactor.refactor.RefactorSession:getInstance().
def var javafile as class java.io.File.
javafile = new java.io.File(filename).
if (not javafile:exists()) then do:
message "Could not find file: " + fileName view-as alert-box.
return.
end.
def var pu as class org.prorefactor.treeparser.ParseUnit.
pu = new ParseUnit(javafile).
pu:treeParser01().
run walker(pu:getTopNode()).
enable outed with frame f1.
wait-for "endkey" of default-window.
procedure walker:
def input param node as class JPNode.
if (node eq ?) then
return.
outed:insert-string(fill(" ", indent) + node:ToString() + "~r~n") in frame f1.
indent = indent + 1.
run walker(node:firstChild()).
indent = indent - 1.
run walker(node:nextSibling()).
end procedure.
Any idea, why i am getting this error, am i missing some configuration?
Regards,
Ganesh
Proparse? I suspect Thomas Mercer-Hursh will be able to help, or maybe Mike Fechner ? I've never implemented this, but from my understanding you need to provide proparse with a schema of your database so it recognises the tables. Not sure how though!
Flag this post as spam/abuse.
Sample code provided in response to your query on OE Hive.
www.oehive.org/.../2300 which is just posted to the Proparse Group
Note that it would be better to post it to the Proparse Forum at www.oehive.org/.../413
Thanks Thomas,
I did load schema with Prolint code snippet as i was not able to find those methods in your example.
It worked after that.
Regards,
Ganesh
Note that I unintentionally posted the code there using my Proparse utilities from ABL2DB rather than the naked Proparse code. The utilities are described here www.oehive.org/.../2294