StellarCompiler extends StellarBaseListener { @Override public void exitLongLiteral(StellarParser.LongLiteralContext ctx) { expression.tokenDeque.push(numberLiteralEvaluator.evaluate(ctx, getArgContext())); } StellarCompiler(
          final ArithmeticEvaluator arithmeticEvaluator,
          final NumberLiteralEvaluator numberLiteralEvaluator,
          final ComparisonExpressionWithOperatorEvaluator comparisonExpressionWithOperatorEvaluator
  );  StellarCompiler(
          final Expression expression,
          final ArithmeticEvaluator arithmeticEvaluator,
          final NumberLiteralEvaluator numberLiteralEvaluator,
          final ComparisonExpressionWithOperatorEvaluator comparisonExpressionWithOperatorEvaluator
  ); @Override void enterTransformation(StellarParser.TransformationContext ctx); @Override void exitNullConst(StellarParser.NullConstContext ctx); @Override void exitNaNArith(StellarParser.NaNArithContext ctx); @Override void exitArithExpr_plus(StellarParser.ArithExpr_plusContext ctx); @Override void exitArithExpr_minus(StellarParser.ArithExpr_minusContext ctx); @Override void exitArithExpr_div(StellarParser.ArithExpr_divContext ctx); @Override void exitArithExpr_mul(StellarParser.ArithExpr_mulContext ctx); @Override void exitIf_expr(StellarParser.If_exprContext ctx); @Override void enterThen_expr(StellarParser.Then_exprContext ctx); @Override void enterElse_expr(StellarParser.Else_exprContext ctx); @Override void exitElse_expr(StellarParser.Else_exprContext ctx); @Override void exitInExpressionStatement(StellarParser.InExpressionStatementContext ctx); @Override void exitNInExpressionStatement(StellarParser.NInExpressionStatementContext ctx); @Override @SuppressWarnings("unchecked") void exitNotFunc(StellarParser.NotFuncContext ctx); @Override void exitVariable(StellarParser.VariableContext ctx); @Override void exitStringLiteral(StellarParser.StringLiteralContext ctx); @Override void exitIntLiteral(StellarParser.IntLiteralContext ctx); @Override void exitDoubleLiteral(StellarParser.DoubleLiteralContext ctx); @Override void exitFloatLiteral(StellarParser.FloatLiteralContext ctx); @Override void exitLongLiteral(StellarParser.LongLiteralContext ctx); @Override void enterB_expr(StellarParser.B_exprContext ctx); @Override void exitB_expr(StellarParser.B_exprContext ctx); @Override void exitLogicalExpressionAnd(StellarParser.LogicalExpressionAndContext ctx); @Override void exitLogicalExpressionOr(StellarParser.LogicalExpressionOrContext ctx); @Override void exitLogicalConst(StellarParser.LogicalConstContext ctx); @Override void enterSingle_lambda_variable(StellarParser.Single_lambda_variableContext ctx); @Override void exitSingle_lambda_variable(StellarParser.Single_lambda_variableContext ctx); @Override void enterLambda_variables(StellarParser.Lambda_variablesContext ctx); @Override void exitLambda_variables(StellarParser.Lambda_variablesContext ctx); @Override void exitLambda_variable(StellarParser.Lambda_variableContext ctx); @Override void enterLambda_with_args(StellarParser.Lambda_with_argsContext ctx); @Override void exitLambda_with_args(StellarParser.Lambda_with_argsContext ctx); @Override void enterLambda_without_args(StellarParser.Lambda_without_argsContext ctx); @Override void exitLambda_without_args(StellarParser.Lambda_without_argsContext ctx); @Override void exitTransformationFunc(StellarParser.TransformationFuncContext ctx); @Override void exitExistsFunc(StellarParser.ExistsFuncContext ctx); @Override void enterFunc_args(StellarParser.Func_argsContext ctx); @Override void exitFunc_args(StellarParser.Func_argsContext ctx); @Override void enterMap_entity(StellarParser.Map_entityContext ctx); @Override void exitMap_entity(StellarParser.Map_entityContext ctx); @Override void exitList_entity(StellarParser.List_entityContext ctx); @Override void exitDefault(StellarParser.DefaultContext ctx); @Override void exitMatchClauseCheckExpr(StellarParser.MatchClauseCheckExprContext ctx); @Override void exitMatchClauseAction(StellarParser.MatchClauseActionContext ctx); @Override void exitMatch_clause(StellarParser.Match_clauseContext ctx); @Override void exitMatchClauses(StellarParser.MatchClausesContext ctx); @Override void exitComparisonExpressionWithOperator(StellarParser.ComparisonExpressionWithOperatorContext ctx); @Override void enterList_entity(StellarParser.List_entityContext ctx); Expression getExpression();  }
@Test @SuppressWarnings("unchecked") public void exitLongLiteralShouldProperlyParseStringsAsLongs() { StellarParser.LongLiteralContext ctx = mock(StellarParser.LongLiteralContext.class); when(ctx.getText()).thenReturn("1000l"); Token result = mock(Token.class); when(numberLiteralEvaluator.evaluate(ctx, null)).thenReturn(result); compiler.exitLongLiteral(ctx); verify(numberLiteralEvaluator).evaluate(ctx, null); assertEquals(1, tokenStack.size()); assertEquals(tokenStack.getFirst(), result); verifyNoInteractions(variableResolver); verifyNoInteractions(functionResolver); verifyNoInteractions(context); verifyNoInteractions(arithmeticEvaluator); verifyNoInteractions(comparisonExpressionWithOperatorEvaluator); }