[antlr-interest] ANTLR input and output

Evan Metheny evanpmeth at gmail.com
Wed Oct 14 18:11:29 PDT 2009


Tim, (Please reply to the mail group as well)
-------------------------
On Wed, Oct 14, 2009 at 4:17 PM,  <tmarcoe at comcast.net> wrote:
> Wow! Thank you for getting back with me so soon. To clear things up, let me
> give you a for instance. This will also give you a glimps of a rule engine
> (which I think will grow in popularity, by the way):
>
> Let's say that I have a form, written in Java, that assigns Medicaid account
> numbers to dispurse funds to the medical staff.
>
> What I want to do is gather all of the applicable demographic information
> and determine an account number, based upon the aforementioned information.
> For example, I would take the age, facility of care, sex of the indivual (to
> flag a pregnacy test to a male) and anything else to determine what Medicade
> account the state will draw from (I actually worked on a system like this in
> PA).
>
> The problem is that these rules are constantly changing because... well...
> it's the government. So, what if we define our own language (that's where
> ANTLR comes in), have our core application written in Java but have the
> business decision information written in our new language. That will help 2
> ways:
>
>
> It will further seperate the data from the core application.
> It will be more easily modified, without having to go through a whole
> development cycle, just to change data.
>
> Now for the question:
>
> Using our above example, I have my demographic information gathered from the
> tables, in Java so I need to execute my ANTRL generated script which will
> gather the information from my core application (the first part that I'm
> having trouble with), process it and send out the result back to the core
> application (the second part that I'm having trouble with). To add humor to
> the issue: "it seems that what goes on in an ANTLR generated script, stays
> in an ANTLR generated script." I just need to be able to pass in and out
> data structures between my core application and my ANTLR generated script.
>
> Does that help clear in up?
>
>
>
> Once again, thank you for getting back to me so quickly.
>
>
>
> Tim -

--------------











>
>
>
> ----- Original Message -----
>
> From: "Evan Metheny" <evanpmeth at gmail.com>
> To: <tmarcoe at comcast.net>
> Cc: <antlr-interest at antlr.org>
> Sent: Wednesday, October 14, 2009 5:42 PM
> Subject: Re: [antlr-interest] ANTLR input and output
>> Tim,
>>
>> Not exactly sure what you are trying to ask, but ill take a stab at
>> it.  Im not sure what Sun's JS94 Standard is? Im guessing it has to do
>> with some sort of data traversal techniques. But I am unclear how
>> ANTLR relates, except for the fact that antlr could probably be used
>> to re-write this JS94 standard the way you want.
>>
>>>How do I get values in and out of the script from my Java code.
>> Im not sure on this one either, This script you are talking about is
>> presumably ANTLR itself or what you created in ANTLR?
>> ANTLR's output can be in any of the target languages you want: java,
>> python, etc.
>> So if your writing your "program" in Java it can easily be
>> incorporated. This is because the code generated from the grammar
>> files by ANTLR is written in the TARGET language you desire.
>>
>>
>>
>>
>> On Wed, Oct 14, 2009 at 12:27 PM,  <tmarcoe at comcast.net> wrote:
>>> Hello,
>>>
>>>
>>>
>>> I am a bit new to ANTLR (I love it by the way) so if this is an obvious
>>> question, forgive me in advance.
>>>
>>>
>>>
>>> I am in the process of writing a rule engine. I know that Sun came up
>>> with
>>> the JS94 standard but I have some ideas to enhance that standard. In
>>> order
>>> to do this, I'm using ANTLR for the rule definition language, which
>>> brings
>>> me to my question.
>>>
>>>
>>>
>>> How do I get values in and out of the script from my Java code. I do have
>>> a
>>> way to do this but I didn't want to reinvent the wheel, if there is
>>> already
>>> something in place to do this. I thought I remembered something in the
>>> documentation but I can't seem to find it now.
>>>
>>>
>>>
>>> Tim -
>>>
>>>
>>> List: http://www.antlr.org/mailman/listinfo/antlr-interest
>>> Unsubscribe:
>>> http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>>>
>>>
>


More information about the antlr-interest mailing list