[antlr-interest] Re: simple function call translator

atripp54321 atripp at comcast.net
Fri Nov 19 15:16:09 PST 2004



--- In antlr-interest at yahoogroups.com, "jm42163jm" <jmcclain at t...> wrote:
> 
> 
> Howdy, at work, we have a simple rules engine in powerbuilder that 
> reads a condition field, a operator field, a result field and a 
> consequence field from a table. This information is entered to the 
> table via client server app to define when to apply computed fields 
> and field properties (hidden, disabled, etc..) to a client / server 
> screen - similar to a rudimentary workflow e.g. 
> condition field: function(paramter_expression, parameter_ 
> expresion,...)
> 
> operator: standar logical operator 
> 
> result: function(paramter_expression, paramter_ expression,...)
> 
> parameter_expression: could be another function call, a 
> value/variable, or an expression
> 
> the consequence will be a computed field, e.g. function call, a 
> value/variable, or an expression
> 
> we need to be able to translate these powerbuilder function calls 
> into java function calls that reproduce the same functionality
> 
> what tool is best to do this type of translation?
> 
> what do I do since I do not have a formal grammar - I only have the 
> function declarations, and an understanding that this does not have 
> to be completey robust as only a subset of powerbuilder functions are 
> involved and there are no standard programming constructs (loops, 
> conditions, assignments, etc..)?

My advice would be to at least start writing it "by hand" first.
That is, don't bother yet with a lexer or parser, just
write some simple code to do read in your powerbuilder
output and generate the Java code.

Only if you get to the point where you say "this is ridiculous,
the input format is just too complicated for me to write
all this code to handle it"...only then should you resort to
an ANTLR-like tool.

Andy





 
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