EMMA Coverage Report (generated Sat Dec 08 18:10:06 GMT 2007)
[all classes][uk.co.zonetora.fj.ast.node]

COVERAGE SUMMARY FOR SOURCE FILE [AClassDecl.java]

nameclass, %method, %block, %line, %
AClassDecl.java100% (3/3)59%  (19/32)31%  (232/744)34%  (72.6/213)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class AClassDecl$FieldDecl_Cast100% (1/1)67%  (2/3)26%  (10/39)11%  (1/9)
cast (Object): Object 0%   (0/1)0%   (0/29)0%   (0/8)
AClassDecl$FieldDecl_Cast (AClassDecl): void 100% (1/1)100% (6/6)100% (1/1)
AClassDecl$FieldDecl_Cast (AClassDecl, AClassDecl$FieldDecl_Cast): void 100% (1/1)100% (4/4)100% (1/1)
     
class AClassDecl100% (1/1)54%  (14/26)27%  (183/666)32%  (62.6/195)
AClassDecl (): void 0%   (0/1)0%   (0/23)0%   (0/4)
AClassDecl (TTclass, TIdentifier, TExtends, TIdentifier, TLBrace, List, PCons... 0%   (0/1)0%   (0/60)0%   (0/15)
clone (): Object 0%   (0/1)0%   (0/47)0%   (0/10)
getExtends (): TExtends 0%   (0/1)0%   (0/3)0%   (0/1)
getLBrace (): TLBrace 0%   (0/1)0%   (0/3)0%   (0/1)
getRBrace (): TRBrace 0%   (0/1)0%   (0/3)0%   (0/1)
getTclass (): TTclass 0%   (0/1)0%   (0/3)0%   (0/1)
removeChild (Node): void 0%   (0/1)0%   (0/69)0%   (0/26)
replaceChild (Node, Node): void 0%   (0/1)0%   (0/118)0%   (0/40)
setFieldDecl (List): void 0%   (0/1)0%   (0/9)0%   (0/3)
setMethodDecl (List): void 0%   (0/1)0%   (0/9)0%   (0/3)
toString (): String 0%   (0/1)0%   (0/50)0%   (0/10)
setClassname (TIdentifier): void 100% (1/1)65%  (15/23)75%  (6/8)
setConstructorDecl (PConstructorDecl): void 100% (1/1)65%  (15/23)75%  (6/8)
setExtends (TExtends): void 100% (1/1)65%  (15/23)75%  (6/8)
setExtendsname (TIdentifier): void 100% (1/1)65%  (15/23)75%  (6/8)
setLBrace (TLBrace): void 100% (1/1)65%  (15/23)75%  (6/8)
setRBrace (TRBrace): void 100% (1/1)65%  (15/23)75%  (6/8)
setTclass (TTclass): void 100% (1/1)65%  (15/23)75%  (6/8)
AClassDecl (TTclass, TIdentifier, TExtends, TIdentifier, TLBrace, XPFieldDecl... 100% (1/1)66%  (58/88)71%  (15/21)
apply (Switch): void 100% (1/1)100% (5/5)100% (2/2)
getClassname (): TIdentifier 100% (1/1)100% (3/3)100% (1/1)
getConstructorDecl (): PConstructorDecl 100% (1/1)100% (3/3)100% (1/1)
getExtendsname (): TIdentifier 100% (1/1)100% (3/3)100% (1/1)
getFieldDecl (): LinkedList 100% (1/1)100% (3/3)100% (1/1)
getMethodDecl (): LinkedList 100% (1/1)100% (3/3)100% (1/1)
     
class AClassDecl$MethodDecl_Cast100% (1/1)100% (3/3)100% (39/39)100% (9/9)
AClassDecl$MethodDecl_Cast (AClassDecl): void 100% (1/1)100% (6/6)100% (1/1)
AClassDecl$MethodDecl_Cast (AClassDecl, AClassDecl$MethodDecl_Cast): void 100% (1/1)100% (4/4)100% (1/1)
cast (Object): Object 100% (1/1)100% (29/29)100% (8/8)

1/* This file was generated by SableCC (http://www.sablecc.org/). */
2 
3package uk.co.zonetora.fj.ast.node;
4 
5import java.util.*;
6import uk.co.zonetora.fj.ast.analysis.*;
7 
8public final class AClassDecl extends PClassDecl
9{
10    private TTclass _tclass_;
11    private TIdentifier _classname_;
12    private TExtends _extends_;
13    private TIdentifier _extendsname_;
14    private TLBrace _lBrace_;
15    private final LinkedList _fieldDecl_ = new TypedLinkedList(new FieldDecl_Cast());
16    private PConstructorDecl _constructorDecl_;
17    private final LinkedList _methodDecl_ = new TypedLinkedList(new MethodDecl_Cast());
18    private TRBrace _rBrace_;
19 
20    public AClassDecl()
21    {
22    }
23 
24    public AClassDecl(
25        TTclass _tclass_,
26        TIdentifier _classname_,
27        TExtends _extends_,
28        TIdentifier _extendsname_,
29        TLBrace _lBrace_,
30        List _fieldDecl_,
31        PConstructorDecl _constructorDecl_,
32        List _methodDecl_,
33        TRBrace _rBrace_)
34    {
35        setTclass(_tclass_);
36 
37        setClassname(_classname_);
38 
39        setExtends(_extends_);
40 
41        setExtendsname(_extendsname_);
42 
43        setLBrace(_lBrace_);
44 
45        {
46            this._fieldDecl_.clear();
47            this._fieldDecl_.addAll(_fieldDecl_);
48        }
49 
50        setConstructorDecl(_constructorDecl_);
51 
52        {
53            this._methodDecl_.clear();
54            this._methodDecl_.addAll(_methodDecl_);
55        }
56 
57        setRBrace(_rBrace_);
58 
59    }
60 
61    public AClassDecl(
62        TTclass _tclass_,
63        TIdentifier _classname_,
64        TExtends _extends_,
65        TIdentifier _extendsname_,
66        TLBrace _lBrace_,
67        XPFieldDecl _fieldDecl_,
68        PConstructorDecl _constructorDecl_,
69        XPMethodDecl _methodDecl_,
70        TRBrace _rBrace_)
71    {
72        setTclass(_tclass_);
73 
74        setClassname(_classname_);
75 
76        setExtends(_extends_);
77 
78        setExtendsname(_extendsname_);
79 
80        setLBrace(_lBrace_);
81 
82        if(_fieldDecl_ != null)
83        {
84            while(_fieldDecl_ instanceof X1PFieldDecl)
85            {
86                this._fieldDecl_.addFirst(((X1PFieldDecl) _fieldDecl_).getPFieldDecl());
87                _fieldDecl_ = ((X1PFieldDecl) _fieldDecl_).getXPFieldDecl();
88            }
89            this._fieldDecl_.addFirst(((X2PFieldDecl) _fieldDecl_).getPFieldDecl());
90        }
91 
92        setConstructorDecl(_constructorDecl_);
93 
94        if(_methodDecl_ != null)
95        {
96            while(_methodDecl_ instanceof X1PMethodDecl)
97            {
98                this._methodDecl_.addFirst(((X1PMethodDecl) _methodDecl_).getPMethodDecl());
99                _methodDecl_ = ((X1PMethodDecl) _methodDecl_).getXPMethodDecl();
100            }
101            this._methodDecl_.addFirst(((X2PMethodDecl) _methodDecl_).getPMethodDecl());
102        }
103 
104        setRBrace(_rBrace_);
105 
106    }
107    public Object clone()
108    {
109        return new AClassDecl(
110            (TTclass) cloneNode(_tclass_),
111            (TIdentifier) cloneNode(_classname_),
112            (TExtends) cloneNode(_extends_),
113            (TIdentifier) cloneNode(_extendsname_),
114            (TLBrace) cloneNode(_lBrace_),
115            cloneList(_fieldDecl_),
116            (PConstructorDecl) cloneNode(_constructorDecl_),
117            cloneList(_methodDecl_),
118            (TRBrace) cloneNode(_rBrace_));
119    }
120 
121    public void apply(Switch sw)
122    {
123        ((Analysis) sw).caseAClassDecl(this);
124    }
125 
126    public TTclass getTclass()
127    {
128        return _tclass_;
129    }
130 
131    public void setTclass(TTclass node)
132    {
133        if(_tclass_ != null)
134        {
135            _tclass_.parent(null);
136        }
137 
138        if(node != null)
139        {
140            if(node.parent() != null)
141            {
142                node.parent().removeChild(node);
143            }
144 
145            node.parent(this);
146        }
147 
148        _tclass_ = node;
149    }
150 
151    public TIdentifier getClassname()
152    {
153        return _classname_;
154    }
155 
156    public void setClassname(TIdentifier node)
157    {
158        if(_classname_ != null)
159        {
160            _classname_.parent(null);
161        }
162 
163        if(node != null)
164        {
165            if(node.parent() != null)
166            {
167                node.parent().removeChild(node);
168            }
169 
170            node.parent(this);
171        }
172 
173        _classname_ = node;
174    }
175 
176    public TExtends getExtends()
177    {
178        return _extends_;
179    }
180 
181    public void setExtends(TExtends node)
182    {
183        if(_extends_ != null)
184        {
185            _extends_.parent(null);
186        }
187 
188        if(node != null)
189        {
190            if(node.parent() != null)
191            {
192                node.parent().removeChild(node);
193            }
194 
195            node.parent(this);
196        }
197 
198        _extends_ = node;
199    }
200 
201    public TIdentifier getExtendsname()
202    {
203        return _extendsname_;
204    }
205 
206    public void setExtendsname(TIdentifier node)
207    {
208        if(_extendsname_ != null)
209        {
210            _extendsname_.parent(null);
211        }
212 
213        if(node != null)
214        {
215            if(node.parent() != null)
216            {
217                node.parent().removeChild(node);
218            }
219 
220            node.parent(this);
221        }
222 
223        _extendsname_ = node;
224    }
225 
226    public TLBrace getLBrace()
227    {
228        return _lBrace_;
229    }
230 
231    public void setLBrace(TLBrace node)
232    {
233        if(_lBrace_ != null)
234        {
235            _lBrace_.parent(null);
236        }
237 
238        if(node != null)
239        {
240            if(node.parent() != null)
241            {
242                node.parent().removeChild(node);
243            }
244 
245            node.parent(this);
246        }
247 
248        _lBrace_ = node;
249    }
250 
251    public LinkedList getFieldDecl()
252    {
253        return _fieldDecl_;
254    }
255 
256    public void setFieldDecl(List list)
257    {
258        _fieldDecl_.clear();
259        _fieldDecl_.addAll(list);
260    }
261 
262    public PConstructorDecl getConstructorDecl()
263    {
264        return _constructorDecl_;
265    }
266 
267    public void setConstructorDecl(PConstructorDecl node)
268    {
269        if(_constructorDecl_ != null)
270        {
271            _constructorDecl_.parent(null);
272        }
273 
274        if(node != null)
275        {
276            if(node.parent() != null)
277            {
278                node.parent().removeChild(node);
279            }
280 
281            node.parent(this);
282        }
283 
284        _constructorDecl_ = node;
285    }
286 
287    public LinkedList getMethodDecl()
288    {
289        return _methodDecl_;
290    }
291 
292    public void setMethodDecl(List list)
293    {
294        _methodDecl_.clear();
295        _methodDecl_.addAll(list);
296    }
297 
298    public TRBrace getRBrace()
299    {
300        return _rBrace_;
301    }
302 
303    public void setRBrace(TRBrace node)
304    {
305        if(_rBrace_ != null)
306        {
307            _rBrace_.parent(null);
308        }
309 
310        if(node != null)
311        {
312            if(node.parent() != null)
313            {
314                node.parent().removeChild(node);
315            }
316 
317            node.parent(this);
318        }
319 
320        _rBrace_ = node;
321    }
322 
323    public String toString()
324    {
325        return ""
326            + toString(_tclass_)
327            + toString(_classname_)
328            + toString(_extends_)
329            + toString(_extendsname_)
330            + toString(_lBrace_)
331            + toString(_fieldDecl_)
332            + toString(_constructorDecl_)
333            + toString(_methodDecl_)
334            + toString(_rBrace_);
335    }
336 
337    void removeChild(Node child)
338    {
339        if(_tclass_ == child)
340        {
341            _tclass_ = null;
342            return;
343        }
344 
345        if(_classname_ == child)
346        {
347            _classname_ = null;
348            return;
349        }
350 
351        if(_extends_ == child)
352        {
353            _extends_ = null;
354            return;
355        }
356 
357        if(_extendsname_ == child)
358        {
359            _extendsname_ = null;
360            return;
361        }
362 
363        if(_lBrace_ == child)
364        {
365            _lBrace_ = null;
366            return;
367        }
368 
369        if(_fieldDecl_.remove(child))
370        {
371            return;
372        }
373 
374        if(_constructorDecl_ == child)
375        {
376            _constructorDecl_ = null;
377            return;
378        }
379 
380        if(_methodDecl_.remove(child))
381        {
382            return;
383        }
384 
385        if(_rBrace_ == child)
386        {
387            _rBrace_ = null;
388            return;
389        }
390 
391    }
392 
393    void replaceChild(Node oldChild, Node newChild)
394    {
395        if(_tclass_ == oldChild)
396        {
397            setTclass((TTclass) newChild);
398            return;
399        }
400 
401        if(_classname_ == oldChild)
402        {
403            setClassname((TIdentifier) newChild);
404            return;
405        }
406 
407        if(_extends_ == oldChild)
408        {
409            setExtends((TExtends) newChild);
410            return;
411        }
412 
413        if(_extendsname_ == oldChild)
414        {
415            setExtendsname((TIdentifier) newChild);
416            return;
417        }
418 
419        if(_lBrace_ == oldChild)
420        {
421            setLBrace((TLBrace) newChild);
422            return;
423        }
424 
425        for(ListIterator i = _fieldDecl_.listIterator(); i.hasNext();)
426        {
427            if(i.next() == oldChild)
428            {
429                if(newChild != null)
430                {
431                    i.set(newChild);
432                    oldChild.parent(null);
433                    return;
434                }
435 
436                i.remove();
437                oldChild.parent(null);
438                return;
439            }
440        }
441 
442        if(_constructorDecl_ == oldChild)
443        {
444            setConstructorDecl((PConstructorDecl) newChild);
445            return;
446        }
447 
448        for(ListIterator i = _methodDecl_.listIterator(); i.hasNext();)
449        {
450            if(i.next() == oldChild)
451            {
452                if(newChild != null)
453                {
454                    i.set(newChild);
455                    oldChild.parent(null);
456                    return;
457                }
458 
459                i.remove();
460                oldChild.parent(null);
461                return;
462            }
463        }
464 
465        if(_rBrace_ == oldChild)
466        {
467            setRBrace((TRBrace) newChild);
468            return;
469        }
470 
471    }
472 
473    private class FieldDecl_Cast implements Cast
474    {
475        public Object cast(Object o)
476        {
477            PFieldDecl node = (PFieldDecl) o;
478 
479            if((node.parent() != null) &&
480                (node.parent() != AClassDecl.this))
481            {
482                node.parent().removeChild(node);
483            }
484 
485            if((node.parent() == null) ||
486                (node.parent() != AClassDecl.this))
487            {
488                node.parent(AClassDecl.this);
489            }
490 
491            return node;
492        }
493    }
494 
495    private class MethodDecl_Cast implements Cast
496    {
497        public Object cast(Object o)
498        {
499            PMethodDecl node = (PMethodDecl) o;
500 
501            if((node.parent() != null) &&
502                (node.parent() != AClassDecl.this))
503            {
504                node.parent().removeChild(node);
505            }
506 
507            if((node.parent() == null) ||
508                (node.parent() != AClassDecl.this))
509            {
510                node.parent(AClassDecl.this);
511            }
512 
513            return node;
514        }
515    }
516}

[all classes][uk.co.zonetora.fj.ast.node]
EMMA 2.0.5312 (C) Vladimir Roubtsov