Parse program which is having table definition

Posted by Gpandye on 24-Jun-2015 04:35

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

All Replies

Posted by Mike Fechner on 24-Jun-2015 05:01

I assume, you copied your proparse code from another program (prolint?).
 
Look for code executing schemadump1.p and then loads this using the proparseSchema static class.
Von: James Palmer [mailto:bounce-jdpjamesp@community.progress.com]
Gesendet: Mittwoch, 24. Juni 2015 11:58
An: TU.General@community.progress.com
Betreff: RE: [Community Groups - General] Parse program which is having table definition
 
Reply by James Palmer

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!

Stop receiving emails on this subject.

Flag this post as spam/abuse.

Posted by Thomas Mercer-Hursh on 24-Jun-2015 09:26

Sample code provided in response to your query on OE Hive.

Posted by Mike Fechner on 24-Jun-2015 09:30

Do you mind sharing the link to the thread?

 

Posted by Thomas Mercer-Hursh on 24-Jun-2015 09:40

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

Posted by Gpandye on 25-Jun-2015 05:52

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

Posted by Thomas Mercer-Hursh on 25-Jun-2015 09:29

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

This thread is closed