Changeset 66 in default for v2/trunk/de.ugoe.cs.swe.bnftools.ebnf/src/de/ugoe/cs/swe/bnftools/validation/EbnfValidator.xtend
- Timestamp:
- 05/14/14 10:07:49 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
v2/trunk/de.ugoe.cs.swe.bnftools.ebnf/src/de/ugoe/cs/swe/bnftools/validation/EbnfValidator.xtend
r65 r66 15 15 import de.ugoe.cs.swe.bnftools.ebnf.SingleDefinition 16 16 import java.util.ArrayList 17 import com.google.inject.Inject 18 import org.eclipse.xtext.resource.IResourceDescriptions 17 19 18 20 //import java.util.HashMap … … 27 29 class EbnfValidator extends AbstractEbnfValidator { 28 30 31 32 @Inject 33 IResourceDescriptions resourceDescriptions; 34 35 29 36 public static final String ruleReferencedOneDescription = "The rule is only referenced by one other rule"; 30 37 public static final String passthroughRuleDescription = "The rule is a passthrough rule"; … … 48 55 return; 49 56 50 var List<Rule Reference> references = EbnfAnalysisUtils.findReferences(rule);51 52 if (references.size ()== 1 && rule.rulenumber != 1) {57 var List<Rule> references = EbnfAnalysisUtils.findReferences(rule,resourceDescriptions); 58 var List<RuleReference> references1 = EbnfAnalysisUtils.findReferences(rule); 59 if (references.size+references1.size == 1 && rule.rulenumber != 1) { 53 60 warning(ruleReferencedOneDescription, EbnfPackage$Literals::RULE__NAME, ruleReferencedOneDescription, 54 61 rule.name); … … 172 179 173 180 var List<RuleReference> references = EbnfAnalysisUtils.findReferences(rule); 174 175 if ((references.size ()== 0) && (rule.getRulenumber() != 1))181 var List<Rule> references1 = EbnfAnalysisUtils.findReferences(rule,resourceDescriptions); 182 if ((references.size+references1.size == 0) && (rule.getRulenumber() != 1)) 176 183 warning(unusedRuleDescription, EbnfPackage$Literals::RULE__NAME, unusedRuleDescription, rule.name); 177 184 } … … 214 221 215 222 var List<RuleReference> references = EbnfAnalysisUtils.findReferences(rule); 216 223 var List<Rule> references1 = EbnfAnalysisUtils.findReferences(rule,resourceDescriptions); 217 224 if (EbnfAnalysisUtils.isPassthroughRule(rule) && rule.rulenumber != 1) { 218 if (references.size ()== 0) {225 if (references.size+references1.size == 0) { 219 226 warning(unreferencedPassthroughRuleDescription, EbnfPackage$Literals::RULE__NAME); 220 227 } else {
Note: See TracChangeset
for help on using the changeset viewer.