(SemanticsVisitor visitor, Node[] args, FormulaSemantics semantics)
| 56 | } |
| 57 | |
| 58 | @Override |
| 59 | public final FormatManager<?> allowArgs(SemanticsVisitor visitor, Node[] args, FormulaSemantics semantics) |
| 60 | { |
| 61 | int argCount = args.length; |
| 62 | if (argCount != 1) |
| 63 | { |
| 64 | throw new SemanticsFailureException("Function " + getFunctionName() |
| 65 | + " received incorrect # of arguments, expected: 1 got " + args.length + ' ' + Arrays.asList(args)); |
| 66 | } |
| 67 | //String node (name) |
| 68 | Node inputNode = args[0]; |
| 69 | if (inputNode.getId() != FormulaParserTreeConstants.JJTQUOTSTRING) |
| 70 | { |
| 71 | throw new SemanticsFailureException("Parse Error: Invalid Value: " + ((SimpleNode) inputNode).getText() |
| 72 | + " found in " + inputNode.getClass().getName() + " found in location requiring a literal" |
| 73 | + " String (cannot be evaluated)"); |
| 74 | } |
| 75 | String inputName = ((SimpleNode) inputNode).getText(); |
| 76 | String varName = ChannelUtilities.createVarName(inputName); |
| 77 | VariableLibrary varLib = semantics.get(FormulaSemantics.FMANAGER).getFactory(); |
| 78 | LegalScope scope = semantics.get(FormulaSemantics.SCOPE); |
| 79 | FormatManager<?> formatManager = varLib.getVariableFormat(scope, varName); |
| 80 | if (formatManager == null) |
| 81 | { |
| 82 | throw new SemanticsFailureException("Input Channel: " + varName + " was not found"); |
| 83 | } |
| 84 | return formatManager; |
| 85 | } |
| 86 | |
| 87 | @Override |
| 88 | public Object evaluate(EvaluateVisitor visitor, Node[] args, EvaluationManager manager) |
nothing calls this directly
no test coverage detected