コード例 #1
0
 public void visit(Tree.CharLiteral literal) {
   if (annotationConstructor != null) {
     if (checkingArguments || checkingDefaults) {
       LiteralAnnotationTerm argument =
           new CharacterLiteralAnnotationTerm(ExpressionTransformer.literalValue(literal));
       appendLiteralArgument(literal, argument);
     }
   }
 }
コード例 #2
0
 public void visit(Tree.NegativeOp op) {
   if (annotationConstructor != null) {
     if (checkingArguments || checkingDefaults) {
       try {
         if (op.getTerm() instanceof Tree.NaturalLiteral) {
           LiteralAnnotationTerm argument =
               new IntegerLiteralAnnotationTerm(ExpressionTransformer.literalValue(op));
           appendLiteralArgument(op, argument);
         } else if (op.getTerm() instanceof Tree.FloatLiteral) {
           LiteralAnnotationTerm argument =
               new FloatLiteralAnnotationTerm(
                   -ExpressionTransformer.literalValue((Tree.FloatLiteral) op.getTerm()));
           appendLiteralArgument(op, argument);
         }
       } catch (ErroneousException e) {
         // Ignore it: The ExpressionTransformer will produce an error later in codegen
       }
     }
   }
 }
コード例 #3
0
 public void visit(Tree.NaturalLiteral literal) {
   if (annotationConstructor != null) {
     if (checkingArguments || checkingDefaults) {
       try {
         LiteralAnnotationTerm argument =
             new IntegerLiteralAnnotationTerm(ExpressionTransformer.literalValue(literal));
         appendLiteralArgument(literal, argument);
       } catch (ErroneousException e) {
         // Ignore it: The ExpressionTransformer will produce an error later in codegen
       }
     }
   }
 }