Package: LexComment

LexComment

nameinstructionbranchcomplexitylinemethod
LexComment(ILexLocation, String, boolean)
M: 0 C: 12
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 5
100%
M: 0 C: 1
100%
getComment()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getLocation()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
isBlock()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
toString()
M: 25 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: *
3: *        Copyright (c) 2018 Nick Battle.
4: *
5: *        Author: Nick Battle
6: *
7: *        This file is part of VDMJ.
8: *
9: *        VDMJ is free software: you can redistribute it and/or modify
10: *        it under the terms of the GNU General Public License as published by
11: *        the Free Software Foundation, either version 3 of the License, or
12: *        (at your option) any later version.
13: *
14: *        VDMJ is distributed in the hope that it will be useful,
15: *        but WITHOUT ANY WARRANTY; without even the implied warranty of
16: *        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17: *        GNU General Public License for more details.
18: *
19: *        You should have received a copy of the GNU General Public License
20: *        along with VDMJ. If not, see <http://www.gnu.org/licenses/>.
21: *
22: ******************************************************************************/
23:
24: package org.overture.ast.lex;
25:
26: import java.io.Serializable;
27:
28: import org.overture.ast.intf.lex.ILexComment;
29: import org.overture.ast.intf.lex.ILexLocation;
30:
31: /**
32: * A comment within the spec. This isn't part of the grammar, as such.
33: */
34: public class LexComment implements ILexComment, Serializable
35: {
36:         private static final long serialVersionUID = 1L;
37:         private final ILexLocation location;
38:         private final String comment;
39:         private final boolean block;
40:
41:         public LexComment(ILexLocation location, String comment, boolean block)
42:         {
43:                 super();
44:                 
45:                 this.location = location;
46:                 this.comment = comment;
47:                 this.block = block;
48:         }
49:         
50:         @Override
51:         public String toString()
52:         {
53:•                return block ? "/*" + comment + "*/" : "--" + comment;
54:         }
55:
56:         @Override
57:         public ILexLocation getLocation()
58:         {
59:                 return location;
60:         }
61:
62:         @Override
63:         public String getComment()
64:         {
65:                 return comment;
66:         }
67:
68:         @Override
69:         public boolean isBlock()
70:         {
71:                 return block;
72:         }
73: }