/** * @see org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.eclipse.jdt.internal.compiler.ast.DoubleLiteral, org.eclipse.jdt.internal.compiler.lookup.BlockScope) */ public boolean visit(DoubleLiteral doubleLiteral, BlockScope scope) { final int numberOfParens = (doubleLiteral.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT; if (numberOfParens > 0) { manageOpeningParenthesizedExpression(doubleLiteral, numberOfParens); } if (isNextToken(TerminalTokens.TokenNameMINUS)) { this.scribe.printNextToken(TerminalTokens.TokenNameMINUS); } this.scribe.printNextToken(TerminalTokens.TokenNameDoubleLiteral); if (numberOfParens > 0) { manageClosingParenthesizedExpression(doubleLiteral, numberOfParens); } return false; }
private static Expression getDefaultExpr(TypeReference type, int s, int e) { char[] lastToken = type.getLastToken(); if (Arrays.equals(TypeConstants.BOOLEAN, lastToken)) return new FalseLiteral(s, e); if (Arrays.equals(TypeConstants.CHAR, lastToken)) return new CharLiteral(new char[] {'\'', '\\', '0', '\''}, s, e); if (Arrays.equals(TypeConstants.BYTE, lastToken) || Arrays.equals(TypeConstants.SHORT, lastToken) || Arrays.equals(TypeConstants.INT, lastToken)) return IntLiteral.buildIntLiteral(new char[] {'0'}, s, e); if (Arrays.equals(TypeConstants.LONG, lastToken)) return LongLiteral.buildLongLiteral(new char[] {'0', 'L'}, s, e); if (Arrays.equals(TypeConstants.FLOAT, lastToken)) return new FloatLiteral(new char[] {'0', 'F'}, s, e); if (Arrays.equals(TypeConstants.DOUBLE, lastToken)) return new DoubleLiteral(new char[] {'0', 'D'}, s, e); return new NullLiteral(s, e); }
@Override public void endVisit(DoubleLiteral x, BlockScope scope) { try { push(JDoubleLiteral.get(x.constant.doubleValue())); } catch (Throwable e) { throw translateException(x, e); } }
@Override public boolean visit(DoubleLiteral node, BlockScope scope) { fixPositions(setGeneratedBy(node, source)); return super.visit(node, scope); }
public boolean visit(DoubleLiteral doubleLiteral, BlockScope scope) { addSmallFragment(doubleLiteral); return false; }
@Override public boolean visit(DoubleLiteral node, BlockScope scope) { setGeneratedBy(node, source); applyOffsetExpression(node); return super.visit(node, scope); }