[antlr-interest] antlr newbie - I need help on this one
John MccLain
jmcclain at tcshealthcare.com
Wed Nov 24 11:01:36 PST 2004
Howdy,
Here is my problem:
I have list of ~150 powerbuilder functions that I need to translate into
their associated Java function calls.
I do not need to translate the entire powerscript language, I am only
translating powerscript expression.
Here is an example of a typical expression that would need to be translated:
left(gf_RetrieveValue( 'patient', 'phone',
'patient_identity='+string(gf_GetPatientIdentity( )), 'No Phone Number on
File' ),3)+'-'+mid(gf_RetrieveValue( 'patient', 'phone',
'patient_identity='+string(gf_GetPatientIdentity( )), 'No Phone Number on
File' ), 0, 100)
the function prototypes would be:
left(String s, int n) => return a string of the leftmost 3 chars
gf_RetrieveValue(String table, String column, String whereClause, String
default) => returns a string from a table/field/whereclause in a DB
string(int n)=> converts into to string
gf_GetPatientIdentity( )=> Returns an int. This would be the patientID in
the current context
mid(String s, int start, int length)=>returns subtring of s starting from
start and ending at length
Some of these functions do not have associated standard java function calls
(e.g., gf_RetrieveValue), so I would have to write them.
All function parameters can themselves be string or numeric expressions
I do not wish to compute the values of the expressions, as they could be
dependent on data that would not be available in the running context. I only
wish to generate the associated java specific translation. This translation
along with a condition under which to execute the code will be put into a
format that will be sent to a rules engine (http://www.drools.org/) for
processing.
Is there any easy way to do this???
Is there an example/tutorial out there of something similar to this?
What would be a good way to approach this problem?
I have ~ 1.5 months to get this done, and it's been a long time since class
141, compiler construction!
John McClain
Senior Software Engineer
TCS Healthcare
jmcclain at tcshealthcare.com
(530)886-1700x235
"Before you criticize someone, walk a mile in their shoes.
That way, you'll be a mile from them, and you'll have their shoes."
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/antlr-interest/
<*> To unsubscribe from this group, send an email to:
antlr-interest-unsubscribe at yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list