Advice on creating an interpreted syntax in Java
<p>I deal a lot with POS (Point of Sale) terminals in my line of work. They basically talk to a system endpoint that is written in Java that will the communicated with the back end system. </p>

<p>For receipts, we will write the code in the endpoint that will generate the data that needs to be printed. These receipts can only take 40 characters per line, so we basically will hardcode each receipt type that needs to be printed. </p>

<p>What I would like to do is basically come up with a sort of scripting syntax that I could use to generate these receipts. </p>

<p>My idea is to have a GUI program where you can design the receipt such as</p>

<pre><code>Welcome To John Doe Services
Your current balance is $(F4).Format(currency)
</code></pre>

<p>Or something of the like. With this i could then interpret the syntax <strong>$(F4).Format(currency)</strong> and actually pull the data and format it correctly.</p>

<p>I would love some advice in where i should start looking on how to do this. I would like to write this in Java but I am not sure where to start. I would rather try and stay away from some substring magic.</p>

<p>Thanks in advance.</p>

<p><strong>EDIT:</strong> Sorry i should have mentioned, the software that we extend was written in J++ so i cant use Java 5 or 6, the lastest Java i can use is 1.4</p>
