Changeset 63 in default for v2/trunk


Ignore:
Timestamp:
04/27/14 16:04:29 (11 years ago)
Author:
hkaulbersch
Message:

Added first quickfixes

Location:
v2/trunk/de.ugoe.cs.swe.bnftools.ebnf
Files:
2 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • v2/trunk/de.ugoe.cs.swe.bnftools.ebnf/src/de/ugoe/cs/swe/bnftools/formatting/EbnfFormatter.xtend

    r61 r63  
    3333                c.setLinewrap.before(f.ruleRule); 
    3434                c.setLinewrap.before(f.importRule); 
     35                c.setNoSpace.after(f.ruleAccess.rulenumberINTTerminalRuleCall_0_0_0) 
    3536//              //c.setLinewrap.after(f.); 
    3637//              for (Keyword bar : f.findKeywords("|")) { 
  • v2/trunk/de.ugoe.cs.swe.bnftools.ebnf/src/de/ugoe/cs/swe/bnftools/generator/EbnfGenerator.xtend

    r62 r63  
    2626 */ 
    2727class EbnfGenerator implements IGenerator { 
    28         //generation of the file blaaa 
     28        //generation of the xsl-file 
    2929        override void doGenerate(Resource resource, IFileSystemAccess fsa) { 
    3030                for (e : resource.allContents.toIterable.filter(EtsiBnf)) { 
     
    3939        ''' 
    4040        <?xml version="1.0"?> 
    41         <!-- fop hello.xml -rtf hello.rtf --> 
     41        <!-- fop «bnf.name».xml -rtf «bnf.name».rtf --> 
    4242        <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> 
    4343 
     
    6363        ''' 
    6464         
    65         def compile(Rule rule)'''<fo:block><fo:inline id="«rule.name»"  color="purple">«rule.name»</fo:inline>  ::=     «rule.definitionList.compile»</block>''' 
     65        def compile(Rule rule)'''<fo:block><fo:inline id="«rule.name»"  color="purple">«IF rule.rulenumber!=0»«rule.rulenumber».\t«ENDIF»«rule.name»</fo:inline>        ::=     «rule.definitionList.compile»</block>''' 
    6666         
    6767        def compile(DefinitionList dList)'''«FOR sDef:dList.singleDefinition»«sDef.compile»«IF !sDef.equals(dList.singleDefinition.last)» | «ENDIF»«ENDFOR»''' 
  • v2/trunk/de.ugoe.cs.swe.bnftools.ebnf/src/de/ugoe/cs/swe/bnftools/validation/EbnfValidator.xtend

    r61 r63  
    2626class EbnfValidator extends AbstractEbnfValidator { 
    2727 
    28         static final String ruleReferencedOneDescription = "The rule is only referenced by one other rule"; 
    29         static final String passthroughRuleDescription = "The rule is a passthrough rule"; 
    30         static final String unreferencedPassthroughRuleDescription = "The rule is an unreferenced passthrough rule"; 
    31         static final String unusedRuleDescription = "The rule is not referenced anywhere"; 
    32         static final String equalAlternativeDescription = "The rule contains equal alternatives"; 
    33         static final String duplicateRulesDescription = "The rule is a duplicate"; 
    34         //      static final String duplicateSubRulesDescription = "A part the of rule is a duplicate"; 
    35         static final String nonUniqueNameDescription = "The rule has the same Name as the Rule in Line "; 
     28        public static final String ruleReferencedOneDescription = "The rule is only referenced by one other rule"; 
     29        public static final String passthroughRuleDescription = "The rule is a passthrough rule"; 
     30        public static final String unreferencedPassthroughRuleDescription = "The rule is an unreferenced passthrough rule"; 
     31        public static final String unusedRuleDescription = "The rule is not referenced anywhere"; 
     32        public static final String equalAlternativeDescription = "The rule contains equal alternatives"; 
     33        public static final String duplicateRulesDescription = "The rule is a duplicate"; 
     34        //public static final String duplicateSubRulesDescription = "A part the of rule is a duplicate"; 
     35        public static final String nonUniqueNameDescription = "The rule has the same Name as the Rule in Line "; 
    3636 
    3737        // ---------------------------------------------------------------------------------------------------- 
     
    4949 
    5050                if (references.size() == 1 && rule.rulenumber != 1) { 
    51                         warning(ruleReferencedOneDescription, EbnfPackage$Literals::RULE__NAME); 
     51                        warning(ruleReferencedOneDescription, EbnfPackage$Literals::RULE__NAME,ruleReferencedOneDescription,rule.name); 
    5252                } 
    5353        } 
     
    122122 
    123123                if ((references.size() == 0) && (rule.getRulenumber() != 1)) 
    124                         warning(unusedRuleDescription, EbnfPackage$Literals::RULE__NAME); 
     124                        warning(unusedRuleDescription, EbnfPackage$Literals::RULE__NAME,unusedRuleDescription,rule.name); 
    125125        } 
    126126 
  • v2/trunk/de.ugoe.cs.swe.bnftools.ebnf/xtend-gen/de/ugoe/cs/swe/bnftools/formatting/EbnfFormatter.java

    r61 r63  
    88import org.eclipse.xtext.IGrammarAccess; 
    99import org.eclipse.xtext.ParserRule; 
     10import org.eclipse.xtext.RuleCall; 
    1011import org.eclipse.xtext.TerminalRule; 
    1112import org.eclipse.xtext.formatting.impl.AbstractDeclarativeFormatter; 
     
    4546    ParserRule _importRule = f.getImportRule(); 
    4647    _setLinewrap_4.before(_importRule); 
     48    FormattingConfig.NoSpaceLocator _setNoSpace = c.setNoSpace(); 
     49    EbnfGrammarAccess.RuleElements _ruleAccess = f.getRuleAccess(); 
     50    RuleCall _rulenumberINTTerminalRuleCall_0_0_0 = _ruleAccess.getRulenumberINTTerminalRuleCall_0_0_0(); 
     51    _setNoSpace.after(_rulenumberINTTerminalRuleCall_0_0_0); 
    4752  } 
    4853} 
  • v2/trunk/de.ugoe.cs.swe.bnftools.ebnf/xtend-gen/de/ugoe/cs/swe/bnftools/generator/EbnfGenerator.java

    r61 r63  
    5656    _builder.append("<?xml version=\"1.0\"?>"); 
    5757    _builder.newLine(); 
    58     _builder.append("<!-- fop hello.xml -rtf hello.rtf -->"); 
    59     _builder.newLine(); 
     58    _builder.append("<!-- fop "); 
     59    String _name = bnf.getName(); 
     60    _builder.append(_name, ""); 
     61    _builder.append(".xml -rtf "); 
     62    String _name_1 = bnf.getName(); 
     63    _builder.append(_name_1, ""); 
     64    _builder.append(".rtf -->"); 
     65    _builder.newLineIfNotEmpty(); 
    6066    _builder.append("<fo:root xmlns:fo=\"http://www.w3.org/1999/XSL/Format\">"); 
    6167    _builder.newLine(); 
     
    123129    _builder.append(_name, ""); 
    124130    _builder.append("\"\tcolor=\"purple\">"); 
     131    { 
     132      int _rulenumber = rule.getRulenumber(); 
     133      boolean _notEquals = (_rulenumber != 0); 
     134      if (_notEquals) { 
     135        int _rulenumber_1 = rule.getRulenumber(); 
     136        _builder.append(_rulenumber_1, ""); 
     137        _builder.append(".\\t"); 
     138      } 
     139    } 
    125140    String _name_1 = rule.getName(); 
    126141    _builder.append(_name_1, ""); 
  • v2/trunk/de.ugoe.cs.swe.bnftools.ebnf/xtend-gen/de/ugoe/cs/swe/bnftools/validation/EbnfValidator.java

    r61 r63  
    2626@SuppressWarnings("all") 
    2727public class EbnfValidator extends AbstractEbnfValidator { 
    28   private final static String ruleReferencedOneDescription = "The rule is only referenced by one other rule"; 
    29    
    30   private final static String passthroughRuleDescription = "The rule is a passthrough rule"; 
    31    
    32   private final static String unreferencedPassthroughRuleDescription = "The rule is an unreferenced passthrough rule"; 
    33    
    34   private final static String unusedRuleDescription = "The rule is not referenced anywhere"; 
    35    
    36   private final static String equalAlternativeDescription = "The rule contains equal alternatives"; 
    37    
    38   private final static String duplicateRulesDescription = "The rule is a duplicate"; 
    39    
    40   private final static String nonUniqueNameDescription = "The rule has the same Name as the Rule in Line "; 
     28  public final static String ruleReferencedOneDescription = "The rule is only referenced by one other rule"; 
     29   
     30  public final static String passthroughRuleDescription = "The rule is a passthrough rule"; 
     31   
     32  public final static String unreferencedPassthroughRuleDescription = "The rule is an unreferenced passthrough rule"; 
     33   
     34  public final static String unusedRuleDescription = "The rule is not referenced anywhere"; 
     35   
     36  public final static String equalAlternativeDescription = "The rule contains equal alternatives"; 
     37   
     38  public final static String duplicateRulesDescription = "The rule is a duplicate"; 
     39   
     40  public final static String nonUniqueNameDescription = "The rule has the same Name as the Rule in Line "; 
    4141   
    4242  /** 
     
    6363    } 
    6464    if (_and) { 
    65       this.warning(EbnfValidator.ruleReferencedOneDescription, EbnfPackage.Literals.RULE__NAME); 
     65      String _name = rule.getName(); 
     66      this.warning(EbnfValidator.ruleReferencedOneDescription, EbnfPackage.Literals.RULE__NAME, EbnfValidator.ruleReferencedOneDescription, _name); 
    6667    } 
    6768  } 
     
    158159    } 
    159160    if (_and) { 
    160       this.warning(EbnfValidator.unusedRuleDescription, EbnfPackage.Literals.RULE__NAME); 
     161      String _name = rule.getName(); 
     162      this.warning(EbnfValidator.unusedRuleDescription, EbnfPackage.Literals.RULE__NAME, EbnfValidator.unusedRuleDescription, _name); 
    161163    } 
    162164  } 
Note: See TracChangeset for help on using the changeset viewer.