Package: VdmRtKeywords

VdmRtKeywords

nameinstructionbranchcomplexitylinemethod
VdmRtKeywords()
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%
getAllSingleWordKeywords()
M: 80 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 17 C: 0
0%
M: 1 C: 0
0%
getBasictypes()
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getBinarySymbolOperators()
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getBinaryoperators()
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getMultipleKeywords()
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getReservedwords()
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getTextvalues()
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getUnaryoperators()
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getUnderscorePrefixKeywords()
M: 19 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getUnderscorePrefixReservedWords()
M: 19 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
static {...}
M: 913 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 50 C: 0
0%
M: 1 C: 0
0%
supportsQuoteTypes()
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
supportsTypleSelect()
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*
2: * #%~
3: * org.overture.ide.vdmrt.ui
4: * %%
5: * Copyright (C) 2008 - 2014 Overture
6: * %%
7: * This program is free software: you can redistribute it and/or modify
8: * it under the terms of the GNU General Public License as
9: * published by the Free Software Foundation, either version 3 of the
10: * License, or (at your option) any later version.
11: *
12: * This program is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15: * GNU General Public License for more details.
16: *
17: * You should have received a copy of the GNU General Public
18: * License along with this program. If not, see
19: * <http://www.gnu.org/licenses/gpl-3.0.html>.
20: * #~%
21: */
22: package org.overture.ide.vdmrt.ui.editor.syntax;
23:
24: import org.overture.ide.ui.editor.syntax.IVdmKeywords;
25:
26: public class VdmRtKeywords implements IVdmKeywords {
27:
28:         public static final String[] reservedwords = {
29:          "#act", "#active", "#else", "#endif", "#fin", "#ifdef", "#ifndef", "#req", "#waiting",
30:          "abs", "all", "always", "and", "async", "atomic",
31:          "be", "bool", "by", "card", "cases", "char",
32:          "class", "comp", "compose", "conc",
33:          "cycles",
34:          "dcl", "def", "dinter", "div", "do", "dom", "dunion",
35:          "duration",
36:          "elems", "else", "elseif", "end", "error", "errs", "eq",
37:          "exists", "exists1", "exit", "ext", "false", "floor",
38:          "for", "forall", "from", "functions", "hd", "if",
39:          "in", "inds", "inmap", "instance", "int", "inter",
40:          "inv", "inverse", "iota", "is", "isofbaseclass",
41:          "isofclass", "lambda", "len", "let", "map", "measure",
42:          "merge", "mod", "mu", "munion", "mutex", "nat", "nat1",
43:          "new", "nil", "not", "of", "operations", "or", "ord", "others",
44:          "per", "periodic", "post", "power", "pre", "private",
45:          "protected", "psubset", "public", "pure", "rat", "rd", "real",
46:          "rem", "responsibility", "return", "reverse", "rng",
47:          "samebaseclass", "sameclass", "self", "seq", "seq1",
48:          "set", "set1", "skip", "specified", "sporadic", "st", "static",
49:                  "start", "startlist", "stop", "stoplist","subclass",
50:                  "subset", "sync", "system", "then", "thread", "threadid",
51:          "time",
52:          "tixe", "tl", "to", "token", "traces", "trap", "true",
53:          "types", "undefined", "union", "values", "variables",
54:          "while", "with", "wr", "yet", "RESULT",
55:                  };
56:         
57:          /*
58:          * It does not make sense to distinguish between keywords like this since
59:          * words like 'specified' are already reserved. This means that:
60:          * private specified : nat := 0; is not valid
61:          */
62:          public static final String[] multipleKeywords = {
63:                  "is not yet specified", "for all",
64:                  "in set", "be st", "not in set",
65:                  "is subclass of", "instance variables",
66:                  "is subclass responsibility"
67:          };
68:         
69:          public static String[] historyCounters = {
70:                  "#act", "#fin", "#active", "#req", "#waiting"
71:          };
72:
73:          public static final String[] binaryoperators = {
74:          "comp", "and", "or", "in set", "not in set",
75:                  "union", "inter", "munion", "subset",
76:                  "psubset","div","mod", "rem"
77:          };
78:         
79:          public static final String[] binarySymbolOperators = {
80:          "=>","<=>","=","<>","+",
81:          "-","*","/", "<",">","<=",">=", "<>",
82:          "\\","++","<:","<-:",":>",":->", "**"
83:          };
84:         
85:          public static final String[] basictypes = {"bool", "int", "nat", "nat1", "real", "rat", "char", "token"};
86:
87:          public static final String[] textvalues = {"true", "false", "nil"};
88:         
89:         
90:          public static final String[] unaryoperators = {
91:          "abs", "card", "floor",         
92:          "hd", "tl", "len", "elems", "inds", "conc", "dom",
93:          "rng", "merge", "not", "inverse",
94:          "dunion", "dinter", "power", "isofbaseclass", "isofclass",
95:                  "samebaseclass", "sameclass"};
96:         
97:         
98:
99:
100:          public String[] getBasictypes()
101:                 {
102:                         return basictypes;
103:                 }
104:
105:                 public String[] getBinaryoperators()
106:                 {
107:                         return binaryoperators;
108:                 }
109:
110:                 public String[] getMultipleKeywords()
111:                 {
112:                         return multipleKeywords;
113:                 }
114:
115:                 public String[] getReservedwords()
116:                 {
117:                         return reservedwords;
118:                 }
119:
120:                 public String[] getTextvalues()
121:                 {
122:                         return textvalues;
123:                 }
124:
125:                 public String[] getUnaryoperators()
126:                 {
127:                         return unaryoperators;
128:                 }
129:
130:                 public String[] getAllSingleWordKeywords() {
131:                         int offset = 0;
132:                         String[] all = new String[basictypes.length
133:                          + binaryoperators.length
134: //                         + multipleKeywords.length
135:                          + reservedwords.length
136:                          + textvalues.length
137:                          + unaryoperators.length];
138:                         
139:                         System.arraycopy(basictypes, 0, all, offset, basictypes.length);
140:                         offset = offset + basictypes.length;
141:                         
142:                         System.arraycopy(binaryoperators, 0, all, offset, binaryoperators.length);
143:                         offset = offset + binaryoperators.length;
144:                         
145: //                        System.arraycopy(multipleKeywords, 0, all, offset, multipleKeywords.length);
146: //                        offset = offset + multipleKeywords.length;
147:                         
148:                         System.arraycopy(reservedwords, 0, all, offset, reservedwords.length);
149:                         offset = offset + reservedwords.length;
150:                         
151:                         System.arraycopy(textvalues, 0, all, offset, textvalues.length);
152:                         offset = offset + textvalues.length;
153:                         
154:                         System.arraycopy(unaryoperators, 0, all, offset, unaryoperators.length);
155:                         offset = offset + binaryoperators.length;
156:                         
157:                         return all;
158:                 }
159:
160:                 public String[] getBinarySymbolOperators()
161:                 {
162:                         return binarySymbolOperators;
163:                 }
164:
165:                 public String[] getUnderscorePrefixKeywords()
166:                 {
167:                         return new String[]{"is","mk", "narrow", "obj"};
168:                 }
169:
170:                 public String[] getUnderscorePrefixReservedWords()
171:                 {
172:                         return new String[]{"init","inv", "pre", "post"};
173:                 }
174:
175:                 public boolean supportsQuoteTypes()
176:                 {
177:                         return true;
178:                 }
179:
180:                 public boolean supportsTypleSelect()
181:                 {
182:                         return true;
183:                 }
184:
185: }