Coverage Report - com.sun.tools.javafx.tree.JFXBlockExpression
 
Classes in this File Line Coverage Branch Coverage Complexity
JFXBlockExpression
86%
30/35
72%
13/18
0
 
 1  
 /*
 2  
  * Copyright 2007 Sun Microsystems, Inc.  All Rights Reserved.
 3  
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 4  
  *
 5  
  * This code is free software; you can redistribute it and/or modify it
 6  
  * under the terms of the GNU General Public License version 2 only, as
 7  
  * published by the Free Software Foundation.  Sun designates this
 8  
  * particular file as subject to the "Classpath" exception as provided
 9  
  * by Sun in the LICENSE file that accompanied this code.
 10  
  *
 11  
  * This code is distributed in the hope that it will be useful, but WITHOUT
 12  
  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 13  
  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 14  
  * version 2 for more details (a copy is included in the LICENSE file that
 15  
  * accompanied this code).
 16  
  *
 17  
  * You should have received a copy of the GNU General Public License version
 18  
  * 2 along with this work; if not, write to the Free Software Foundation,
 19  
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 20  
  *
 21  
  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
 22  
  * CA 95054 USA or visit www.sun.com if you need additional information or
 23  
  * have any questions.
 24  
  */
 25  
 
 26  
 package com.sun.tools.javafx.tree;
 27  
 
 28  
 import com.sun.javafx.api.tree.BlockExpressionTree;
 29  
 import com.sun.javafx.api.tree.JavaFXTree.JavaFXKind;
 30  
 import com.sun.javafx.api.tree.JavaFXTreeVisitor;
 31  
 import com.sun.source.tree.Tree.Kind;
 32  
 import com.sun.tools.javac.util.List;
 33  
 import com.sun.tools.javac.util.*;
 34  
 import com.sun.tools.javac.tree.*;
 35  
 import com.sun.source.tree.*;
 36  
 import com.sun.tools.javac.code.*;
 37  
 import com.sun.source.tree.*;
 38  
 import com.sun.tools.javac.tree.JCTree.*;
 39  
 import com.sun.tools.javafx.comp.*;
 40  
 /**
 41  
  *
 42  
  * @author bothner
 43  
  */
 44  6
 public class JFXBlockExpression extends JFXExpression implements BlockExpressionTree {
 45  
     public long flags;
 46  
     public List<JCStatement> stats;
 47  
     public JCExpression value;
 48  
     /** Position of closing brace, optional. */
 49  3131
     public int endpos = Position.NOPOS;
 50  3131
     protected JFXBlockExpression(long flags, List<JCStatement> stats, JCExpression value) {
 51  3131
         this.stats = stats;
 52  3131
         this.flags = flags;
 53  3131
         this.value = value;
 54  3131
     }
 55  
     
 56  10781
     public void accept(JavafxVisitor v) { v.visitBlockExpression(this);}
 57  
 
 58  
     public List<JCStatement> getStatements() {
 59  2040
         return stats;
 60  
     }
 61  
     
 62  
     public JCExpression getValue() {
 63  3
         return value;
 64  
     }
 65  
     
 66  
     public void accept(Visitor v) {
 67  
         // Kludge
 68  18594
         if (v instanceof JavafxVisitor)
 69  10781
             this.accept((JavafxVisitor)v);
 70  7813
         else if (v instanceof Pretty)
 71  0
             JavaPretty.visitBlockExpression((Pretty) v, this);
 72  7813
         else if (v instanceof BlockExprAttr)
 73  1198
             ((BlockExprAttr) v).visitBlockExpression(this);
 74  6615
         else if (v instanceof BlockExprEnter)
 75  0
             ((BlockExprEnter) v).visitBlockExpression(this);
 76  6615
         else if (v instanceof BlockExprMemberEnter)
 77  0
             ((BlockExprMemberEnter) v).visitBlockExpression(this);
 78  6615
         else if (v instanceof JavafxPrepForBackEnd)
 79  1198
             ((JavafxPrepForBackEnd) v).visitBlockExpression(this);
 80  
         
 81  5417
         else if (v instanceof TreeScanner) {
 82  1892
             ((TreeScanner)v).scan(stats);
 83  1892
             ((TreeScanner)v).scan(value);
 84  3525
         } else if (v instanceof TreeTranslator) {
 85  2360
             stats = ((TreeTranslator)v).translate(stats);
 86  2360
             value = ((TreeTranslator)v).translate(value);
 87  2360
             ((TreeTranslator)v).result = this;
 88  
         } else {
 89  1165
             v.visitTree(this);
 90  
         }
 91  18591
     }
 92  0
     public boolean isStatic() { return (flags & Flags.STATIC) != 0; }
 93  
 
 94  
     @Override
 95  
     public int getTag() {
 96  7530
         return JavafxTag.BLOCK_EXPRESSION;
 97  
     }
 98  
 
 99  
     @Override
 100  
     public <R, D> R accept(JavaFXTreeVisitor<R, D> v, D d) {
 101  3
         return v.visitBlockExpression(this, d);
 102  
     }
 103  
 
 104  
     public JavaFXKind getJavaFXKind() {
 105  0
         return JavaFXKind.BLOCK_EXPRESSION;
 106  
     }
 107  
 
 108  
 }