X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=core%2Fsrc%2Fde%2Fcongrace%2Fexp4j%2FFunctionSeparatorToken.java;fp=core%2Fsrc%2Fde%2Fcongrace%2Fexp4j%2FFunctionSeparatorToken.java;h=24b1109d4f2e839d7c401092b5717d7d4b902f02;hb=9349577cdfdff682b2aabd6daa24fdc3a7449b58;hp=0000000000000000000000000000000000000000;hpb=30ba0a882f0c061176ba14dbf86d3d6fad096c02;p=debian%2Fopenrocket diff --git a/core/src/de/congrace/exp4j/FunctionSeparatorToken.java b/core/src/de/congrace/exp4j/FunctionSeparatorToken.java new file mode 100644 index 00000000..24b1109d --- /dev/null +++ b/core/src/de/congrace/exp4j/FunctionSeparatorToken.java @@ -0,0 +1,17 @@ +package de.congrace.exp4j; + +import java.util.Stack; + +public class FunctionSeparatorToken extends Token{ + public FunctionSeparatorToken() { + super(","); + } + @Override + void mutateStackForInfixTranslation(Stack operatorStack, StringBuilder output) { + Token token; + while (!((token=operatorStack.peek()) instanceof ParenthesisToken) && !token.getValue().equals("(")){ + output.append(operatorStack.pop().getValue()).append(" "); + } + } + +}