Converting a string from user input to an expression
<p>So I've spent most of the day Googling and StackExchanging for answers or guidance and I've given up. I have to ask the following:</p>

<p>I want to make a Java application that asks for the user to enter an expression similar to this:</p>

<pre><code>t&gt;&gt;7|t|t&gt;&gt;6
</code></pre>

<p>Let's assume that this is then stored as a String. What I want is to convert this String into an expression where <code>t</code> becomes a variable and <code>&gt;&gt;</code> and <code>|</code> become operators. Basically I would like to figure out how implement this <a href="http://www.redcode.nl/blog/2011/12/bytebeat-algorithmic-symphonies/" rel="nofollow">http://www.redcode.nl/blog/2011/12/bytebeat-algorithmic-symphonies/</a> but somehow pass user input to <code>private static int f(int t)</code> instead of hard coding the expression.</p>

<p>I've been reading a bit about ScriptEngineManager and using JavaScript but I don't know if that's the way to go.</p>

<p>Anyway, this is just for personal education and entertainment. Thanks in advance.</p>
