mirror of
https://github.com/Minres/RDL-Editor.git
synced 2025-07-01 13:33:27 +02:00
remove generated files
This commit is contained in:
1
com.minres.rdl.parent/com.minres.rdl.ui/xtend-gen/.gitignore
vendored
Normal file
1
com.minres.rdl.parent/com.minres.rdl.ui/xtend-gen/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/*
|
@ -1,3 +0,0 @@
|
||||
/RDLEObjectDocumentationProvider.java
|
||||
/RDLEObjectHoverProvider.java
|
||||
/RDLUiModule.java
|
@ -1,12 +0,0 @@
|
||||
package com.minres.rdl.ui;
|
||||
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
import org.eclipse.xtext.documentation.IEObjectDocumentationProvider;
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public class RDLEObjectDocumentationProvider implements IEObjectDocumentationProvider {
|
||||
@Override
|
||||
public String getDocumentation(final EObject o) {
|
||||
return null;
|
||||
}
|
||||
}
|
@ -1,46 +0,0 @@
|
||||
package com.minres.rdl.ui;
|
||||
|
||||
import com.minres.rdl.rdl.ComponentDefinition;
|
||||
import com.minres.rdl.rdl.ComponentDefinitionType;
|
||||
import com.minres.rdl.rdl.ComponentInstance;
|
||||
import com.minres.rdl.rdl.Instantiation;
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
import org.eclipse.xtext.ui.editor.hover.html.DefaultEObjectHoverProvider;
|
||||
import org.eclipse.xtext.xbase.lib.StringExtensions;
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public class RDLEObjectHoverProvider extends DefaultEObjectHoverProvider {
|
||||
@Override
|
||||
protected String getFirstLine(final EObject o) {
|
||||
boolean _matched = false;
|
||||
if (o instanceof ComponentDefinition) {
|
||||
_matched=true;
|
||||
String _name = ((ComponentDefinition)o).getName();
|
||||
String _plus = ("Component " + _name);
|
||||
String _plus_1 = (_plus + " of type ");
|
||||
String _literal = ((ComponentDefinition)o).getType().getLiteral();
|
||||
return (_plus_1 + _literal);
|
||||
}
|
||||
if (!_matched) {
|
||||
if (o instanceof ComponentInstance) {
|
||||
_matched=true;
|
||||
final EObject parent = ((ComponentInstance)o).eContainer();
|
||||
if ((parent instanceof Instantiation)) {
|
||||
ComponentDefinitionType _xifexpression = null;
|
||||
ComponentDefinition _componentRef = ((Instantiation)parent).getComponentRef();
|
||||
boolean _tripleNotEquals = (_componentRef != null);
|
||||
if (_tripleNotEquals) {
|
||||
_xifexpression = ((Instantiation)parent).getComponentRef().getType();
|
||||
} else {
|
||||
_xifexpression = ((Instantiation)parent).getComponent().getType();
|
||||
}
|
||||
String _firstUpper = StringExtensions.toFirstUpper(_xifexpression.getLiteral());
|
||||
String _plus = (_firstUpper + " ");
|
||||
String _name = ((ComponentInstance)o).getName();
|
||||
return (_plus + _name);
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.getFirstLine(o);
|
||||
}
|
||||
}
|
@ -1,47 +0,0 @@
|
||||
/**
|
||||
* generated by Xtext 2.14.0
|
||||
*/
|
||||
package com.minres.rdl.ui;
|
||||
|
||||
import com.minres.structural.ui.hyperlink.MyHyperlinkHelper;
|
||||
import com.minres.structural.ui.hyperlink.MyXtextHyperlink;
|
||||
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
||||
import org.eclipse.xtend.lib.annotations.FinalFieldsConstructor;
|
||||
import org.eclipse.xtext.documentation.IEObjectDocumentationProvider;
|
||||
import org.eclipse.xtext.ui.editor.hover.IEObjectHoverProvider;
|
||||
import org.eclipse.xtext.ui.editor.hyperlinking.HyperlinkHelper;
|
||||
import org.eclipse.xtext.ui.editor.hyperlinking.XtextHyperlink;
|
||||
import org.eclipse.xtext.ui.resource.IResourceSetProvider;
|
||||
import org.eclipse.xtext.ui.resource.SimpleResourceSetProvider;
|
||||
|
||||
/**
|
||||
* Use this class to register components to be used within the Eclipse IDE.
|
||||
*/
|
||||
@FinalFieldsConstructor
|
||||
@SuppressWarnings("all")
|
||||
public class RDLUiModule extends AbstractRDLUiModule {
|
||||
public Class<? extends IEObjectHoverProvider> bindIEObjectHoverProvider() {
|
||||
return RDLEObjectHoverProvider.class;
|
||||
}
|
||||
|
||||
public Class<? extends IEObjectDocumentationProvider> bindIEObjectDocumentationProviderr() {
|
||||
return RDLEObjectDocumentationProvider.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends IResourceSetProvider> bindIResourceSetProvider() {
|
||||
return SimpleResourceSetProvider.class;
|
||||
}
|
||||
|
||||
public Class<? extends HyperlinkHelper> bindHyperlinkHelper() {
|
||||
return MyHyperlinkHelper.class;
|
||||
}
|
||||
|
||||
public Class<? extends XtextHyperlink> bindHyperlink() {
|
||||
return MyXtextHyperlink.class;
|
||||
}
|
||||
|
||||
public RDLUiModule(final AbstractUIPlugin plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
}
|
@ -1 +0,0 @@
|
||||
/RDLProposalProvider.java
|
@ -1,12 +0,0 @@
|
||||
/**
|
||||
* generated by Xtext 2.14.0
|
||||
*/
|
||||
package com.minres.rdl.ui.contentassist;
|
||||
|
||||
/**
|
||||
* See https://www.eclipse.org/Xtext/documentation/304_ide_concepts.html#content-assist
|
||||
* on how to customize the content assistant.
|
||||
*/
|
||||
@SuppressWarnings("all")
|
||||
public class RDLProposalProvider extends AbstractRDLProposalProvider {
|
||||
}
|
@ -1,2 +0,0 @@
|
||||
/RDLDescriptionLabelProvider.java
|
||||
/RDLLabelProvider.java
|
@ -1,15 +0,0 @@
|
||||
/**
|
||||
* generated by Xtext 2.14.0
|
||||
*/
|
||||
package com.minres.rdl.ui.labeling;
|
||||
|
||||
import org.eclipse.xtext.ui.label.DefaultDescriptionLabelProvider;
|
||||
|
||||
/**
|
||||
* Provides labels for IEObjectDescriptions and IResourceDescriptions.
|
||||
*
|
||||
* See https://www.eclipse.org/Xtext/documentation/304_ide_concepts.html#label-provider
|
||||
*/
|
||||
@SuppressWarnings("all")
|
||||
public class RDLDescriptionLabelProvider extends DefaultDescriptionLabelProvider {
|
||||
}
|
@ -1,381 +0,0 @@
|
||||
/**
|
||||
* generated by Xtext 2.14.0
|
||||
*/
|
||||
package com.minres.rdl.ui.labeling;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
import com.google.inject.Inject;
|
||||
import com.minres.rdl.IntegerWithRadix;
|
||||
import com.minres.rdl.rdl.ComponentDefinition;
|
||||
import com.minres.rdl.rdl.ComponentDefinitionType;
|
||||
import com.minres.rdl.rdl.ComponentInstance;
|
||||
import com.minres.rdl.rdl.EnumDefinition;
|
||||
import com.minres.rdl.rdl.EnumEntry;
|
||||
import com.minres.rdl.rdl.EnumProperty;
|
||||
import com.minres.rdl.rdl.ExplicitPropertyAssignment;
|
||||
import com.minres.rdl.rdl.InstancePropertyRef;
|
||||
import com.minres.rdl.rdl.InstanceRef;
|
||||
import com.minres.rdl.rdl.PostPropertyAssignment;
|
||||
import com.minres.rdl.rdl.PropertyAssignment;
|
||||
import com.minres.rdl.rdl.PropertyAssignmentRhs;
|
||||
import com.minres.rdl.rdl.PropertyDefinition;
|
||||
import com.minres.rdl.rdl.PropertyEnum;
|
||||
import com.minres.rdl.rdl.PropertyModifier;
|
||||
import com.minres.rdl.rdl.RValue;
|
||||
import com.minres.rdl.rdl.RValueConstant;
|
||||
import com.minres.rdl.rdl.Range;
|
||||
import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
|
||||
import org.eclipse.xtext.ui.label.DefaultEObjectLabelProvider;
|
||||
import org.eclipse.xtext.xbase.lib.Functions.Function1;
|
||||
import org.eclipse.xtext.xbase.lib.IterableExtensions;
|
||||
import org.eclipse.xtext.xbase.lib.ListExtensions;
|
||||
|
||||
/**
|
||||
* Provides labels for EObjects.
|
||||
*
|
||||
* See https://www.eclipse.org/Xtext/documentation/304_ide_concepts.html#label-provider
|
||||
*/
|
||||
@SuppressWarnings("all")
|
||||
public class RDLLabelProvider extends DefaultEObjectLabelProvider {
|
||||
@Inject
|
||||
public RDLLabelProvider(final AdapterFactoryLabelProvider delegate) {
|
||||
super(delegate);
|
||||
}
|
||||
|
||||
public String text(final ComponentDefinition e) {
|
||||
String _xifexpression = null;
|
||||
String _name = e.getName();
|
||||
boolean _tripleNotEquals = (_name != null);
|
||||
if (_tripleNotEquals) {
|
||||
String _literal = e.getType().getLiteral();
|
||||
String _plus = (_literal + " ");
|
||||
String _name_1 = e.getName();
|
||||
_xifexpression = (_plus + _name_1);
|
||||
} else {
|
||||
String _xblockexpression = null;
|
||||
{
|
||||
final Function1<PropertyAssignment, Boolean> _function = (PropertyAssignment pa) -> {
|
||||
return Boolean.valueOf(((pa instanceof ExplicitPropertyAssignment) && Objects.equal(((ExplicitPropertyAssignment) pa).getName(), PropertyEnum.NAME)));
|
||||
};
|
||||
final PropertyAssignment pa = IterableExtensions.<PropertyAssignment>findFirst(e.getPropertyAssignments(), _function);
|
||||
String _xifexpression_1 = null;
|
||||
if ((pa != null)) {
|
||||
String _literal_1 = e.getType().getLiteral();
|
||||
String _plus_1 = (_literal_1 + " ");
|
||||
Object _text = this.text(((ExplicitPropertyAssignment) pa).getRhs());
|
||||
_xifexpression_1 = (_plus_1 + _text);
|
||||
} else {
|
||||
_xifexpression_1 = e.getType().getLiteral();
|
||||
}
|
||||
_xblockexpression = _xifexpression_1;
|
||||
}
|
||||
_xifexpression = _xblockexpression;
|
||||
}
|
||||
return _xifexpression;
|
||||
}
|
||||
|
||||
public String text(final ExplicitPropertyAssignment e) {
|
||||
String res = "";
|
||||
PropertyModifier _modifier = e.getModifier();
|
||||
boolean _notEquals = (!Objects.equal(_modifier, PropertyModifier.UNDEFINED));
|
||||
if (_notEquals) {
|
||||
String _res = res;
|
||||
String _literal = e.getModifier().getLiteral();
|
||||
String _plus = (_literal + " ");
|
||||
res = (_res + _plus);
|
||||
}
|
||||
String _res_1 = res;
|
||||
PropertyEnum _name = e.getName();
|
||||
res = (_res_1 + _name);
|
||||
PropertyAssignmentRhs _rhs = e.getRhs();
|
||||
boolean _tripleNotEquals = (_rhs != null);
|
||||
if (_tripleNotEquals) {
|
||||
String _res_2 = res;
|
||||
Object _text = this.text(e.getRhs());
|
||||
String _plus_1 = (" = " + _text);
|
||||
res = (_res_2 + _plus_1);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
public String text(final PostPropertyAssignment e) {
|
||||
String res = "";
|
||||
String _res = res;
|
||||
String _text = this.text(e.getInstance());
|
||||
res = (_res + _text);
|
||||
PropertyDefinition _property = e.getProperty();
|
||||
boolean _tripleNotEquals = (_property != null);
|
||||
if (_tripleNotEquals) {
|
||||
String _res_1 = res;
|
||||
String _name = e.getProperty().getName();
|
||||
String _plus = ("->" + _name);
|
||||
res = (_res_1 + _plus);
|
||||
} else {
|
||||
PropertyEnum _propertyEnum = e.getPropertyEnum();
|
||||
boolean _notEquals = (!Objects.equal(_propertyEnum, PropertyEnum.UNSPECIFIED));
|
||||
if (_notEquals) {
|
||||
String _res_2 = res;
|
||||
String _literal = e.getPropertyEnum().getLiteral();
|
||||
String _plus_1 = ("->" + _literal);
|
||||
res = (_res_2 + _plus_1);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
public String text(final InstanceRef e) {
|
||||
String _xifexpression = null;
|
||||
InstanceRef _tail = e.getTail();
|
||||
boolean _tripleNotEquals = (_tail != null);
|
||||
if (_tripleNotEquals) {
|
||||
String _name = e.getInstance().getName();
|
||||
String _plus = (_name + ".");
|
||||
String _text = this.text(e.getTail());
|
||||
_xifexpression = (_plus + _text);
|
||||
} else {
|
||||
_xifexpression = e.getInstance().getName();
|
||||
}
|
||||
return _xifexpression;
|
||||
}
|
||||
|
||||
public String text(final ComponentInstance e) {
|
||||
String res = e.getName();
|
||||
Range _range = e.getRange();
|
||||
boolean _tripleNotEquals = (_range != null);
|
||||
if (_tripleNotEquals) {
|
||||
String _res = res;
|
||||
String _xifexpression = null;
|
||||
Object _size = e.getRange().getSize();
|
||||
boolean _tripleNotEquals_1 = (_size != null);
|
||||
if (_tripleNotEquals_1) {
|
||||
_xifexpression = e.getRange().getSize().toString();
|
||||
} else {
|
||||
Object _left = e.getRange().getLeft();
|
||||
String _plus = (_left + ":");
|
||||
Object _right = e.getRange().getRight();
|
||||
_xifexpression = (_plus + _right);
|
||||
}
|
||||
String _plus_1 = ("[" + _xifexpression);
|
||||
String _plus_2 = (_plus_1 + "]");
|
||||
res = (_res + _plus_2);
|
||||
}
|
||||
Object _address = e.getAddress();
|
||||
boolean _tripleNotEquals_2 = (_address != null);
|
||||
if (_tripleNotEquals_2) {
|
||||
String _res_1 = res;
|
||||
Object _address_1 = e.getAddress();
|
||||
String _plus_3 = (" @" + _address_1);
|
||||
res = (_res_1 + _plus_3);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
public Object text(final PropertyAssignmentRhs e) {
|
||||
Object _xifexpression = null;
|
||||
RValue _value = e.getValue();
|
||||
boolean _tripleNotEquals = (_value != null);
|
||||
if (_tripleNotEquals) {
|
||||
_xifexpression = this.text(e.getValue());
|
||||
} else {
|
||||
Object _xifexpression_1 = null;
|
||||
InstancePropertyRef _instPropRef = e.getInstPropRef();
|
||||
boolean _tripleNotEquals_1 = (_instPropRef != null);
|
||||
if (_tripleNotEquals_1) {
|
||||
_xifexpression_1 = this.text(e.getInstPropRef());
|
||||
} else {
|
||||
Object _xifexpression_2 = null;
|
||||
EnumDefinition _enumRef = e.getEnumRef();
|
||||
boolean _tripleNotEquals_2 = (_enumRef != null);
|
||||
if (_tripleNotEquals_2) {
|
||||
_xifexpression_2 = this.text(e.getEnumRef());
|
||||
}
|
||||
_xifexpression_1 = _xifexpression_2;
|
||||
}
|
||||
_xifexpression = _xifexpression_1;
|
||||
}
|
||||
return _xifexpression;
|
||||
}
|
||||
|
||||
public String text(final InstancePropertyRef ref) {
|
||||
String _text = this.text(ref.getInstance());
|
||||
String _xifexpression = null;
|
||||
PropertyDefinition _property = ref.getProperty();
|
||||
boolean _tripleNotEquals = (_property != null);
|
||||
if (_tripleNotEquals) {
|
||||
String _name = ref.getProperty().getName();
|
||||
_xifexpression = ("->" + _name);
|
||||
} else {
|
||||
String _xifexpression_1 = null;
|
||||
PropertyEnum _propertyEnum = ref.getPropertyEnum();
|
||||
boolean _notEquals = (!Objects.equal(_propertyEnum, PropertyEnum.UNSPECIFIED));
|
||||
if (_notEquals) {
|
||||
String _literal = ref.getPropertyEnum().getLiteral();
|
||||
_xifexpression_1 = ("->" + _literal);
|
||||
} else {
|
||||
_xifexpression_1 = "";
|
||||
}
|
||||
_xifexpression = _xifexpression_1;
|
||||
}
|
||||
return (_text + _xifexpression);
|
||||
}
|
||||
|
||||
public String text(final RValue e) {
|
||||
String _xifexpression = null;
|
||||
String _str = e.getStr();
|
||||
boolean _tripleNotEquals = (_str != null);
|
||||
if (_tripleNotEquals) {
|
||||
_xifexpression = this.elipse(e.getStr());
|
||||
} else {
|
||||
RValueConstant _val = e.getVal();
|
||||
boolean _notEquals = (!Objects.equal(_val, RValueConstant.UNDEFINED));
|
||||
if (_notEquals) {
|
||||
return e.getVal().getLiteral();
|
||||
} else {
|
||||
Object _num = e.getNum();
|
||||
boolean _tripleNotEquals_1 = (_num != null);
|
||||
if (_tripleNotEquals_1) {
|
||||
Object _num_1 = e.getNum();
|
||||
final IntegerWithRadix num = ((IntegerWithRadix) _num_1);
|
||||
return num.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
return _xifexpression;
|
||||
}
|
||||
|
||||
public String elipse(final String string) {
|
||||
final int pos = string.indexOf("\n");
|
||||
if ((pos > 0)) {
|
||||
String _substring = string.substring(0, (pos - 1));
|
||||
return (_substring + "...");
|
||||
} else {
|
||||
int _length = string.length();
|
||||
boolean _greaterThan = (_length > 30);
|
||||
if (_greaterThan) {
|
||||
String _substring_1 = string.substring(0, 30);
|
||||
return (_substring_1 + "...");
|
||||
} else {
|
||||
return string;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String text(final EnumEntry e) {
|
||||
String _xifexpression = null;
|
||||
Object _index = e.getIndex();
|
||||
boolean _tripleNotEquals = (_index != null);
|
||||
if (_tripleNotEquals) {
|
||||
String _name = e.getName();
|
||||
String _plus = (_name + "=");
|
||||
String _string = e.getIndex().toString();
|
||||
_xifexpression = (_plus + _string);
|
||||
} else {
|
||||
String _name_1 = e.getName();
|
||||
String _plus_1 = (_name_1 + "=");
|
||||
final Function1<EnumProperty, String> _function = (EnumProperty it) -> {
|
||||
return this.text(it);
|
||||
};
|
||||
String _join = IterableExtensions.join(ListExtensions.<EnumProperty, String>map(e.getProperties(), _function), ",");
|
||||
_xifexpression = (_plus_1 + _join);
|
||||
}
|
||||
return _xifexpression;
|
||||
}
|
||||
|
||||
public String text(final EnumProperty e) {
|
||||
String _name = e.getName();
|
||||
String _plus = (_name + "=");
|
||||
String _elipse = this.elipse(e.getValue());
|
||||
return (_plus + _elipse);
|
||||
}
|
||||
|
||||
public String image(final ComponentDefinition e) {
|
||||
ComponentDefinitionType _type = e.getType();
|
||||
if (_type != null) {
|
||||
switch (_type) {
|
||||
case ADDRMAP:
|
||||
return "A.png";
|
||||
case FIELD:
|
||||
return "F.png";
|
||||
case REG:
|
||||
return "R.png";
|
||||
case REGFILE:
|
||||
return "R.png";
|
||||
case SIGNAL:
|
||||
return "S.png";
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public String image(final PropertyAssignmentRhs e) {
|
||||
String _xifexpression = null;
|
||||
RValue _value = e.getValue();
|
||||
boolean _tripleNotEquals = (_value != null);
|
||||
if (_tripleNotEquals) {
|
||||
_xifexpression = "V.png";
|
||||
} else {
|
||||
String _xifexpression_1 = null;
|
||||
InstancePropertyRef _instPropRef = e.getInstPropRef();
|
||||
boolean _tripleNotEquals_1 = (_instPropRef != null);
|
||||
if (_tripleNotEquals_1) {
|
||||
_xifexpression_1 = this.image(e.getInstPropRef());
|
||||
} else {
|
||||
String _xifexpression_2 = null;
|
||||
EnumDefinition _enumRef = e.getEnumRef();
|
||||
boolean _tripleNotEquals_2 = (_enumRef != null);
|
||||
if (_tripleNotEquals_2) {
|
||||
_xifexpression_2 = "E.png";
|
||||
}
|
||||
_xifexpression_1 = _xifexpression_2;
|
||||
}
|
||||
_xifexpression = _xifexpression_1;
|
||||
}
|
||||
return _xifexpression;
|
||||
}
|
||||
|
||||
public String image(final InstancePropertyRef ref) {
|
||||
String _xifexpression = null;
|
||||
PropertyDefinition _property = ref.getProperty();
|
||||
boolean _tripleNotEquals = (_property != null);
|
||||
if (_tripleNotEquals) {
|
||||
_xifexpression = "P.png";
|
||||
} else {
|
||||
String _xifexpression_1 = null;
|
||||
PropertyEnum _propertyEnum = ref.getPropertyEnum();
|
||||
boolean _notEquals = (!Objects.equal(_propertyEnum, PropertyEnum.UNSPECIFIED));
|
||||
if (_notEquals) {
|
||||
_xifexpression_1 = "E.png";
|
||||
} else {
|
||||
_xifexpression_1 = "I.png";
|
||||
}
|
||||
_xifexpression = _xifexpression_1;
|
||||
}
|
||||
return _xifexpression;
|
||||
}
|
||||
|
||||
public String image(final EnumDefinition e) {
|
||||
return "E.png";
|
||||
}
|
||||
|
||||
public String image(final ExplicitPropertyAssignment e) {
|
||||
return "P.png";
|
||||
}
|
||||
|
||||
public String image(final PostPropertyAssignment e) {
|
||||
return "P.png";
|
||||
}
|
||||
|
||||
public String image(final ComponentInstance e) {
|
||||
return "I.png";
|
||||
}
|
||||
|
||||
public String image(final EnumEntry v) {
|
||||
return "V.png";
|
||||
}
|
||||
|
||||
public String image(final EnumProperty e) {
|
||||
return "P.png";
|
||||
}
|
||||
}
|
@ -1 +0,0 @@
|
||||
/RDLOutlineTreeProvider.java
|
@ -1,118 +0,0 @@
|
||||
/**
|
||||
* generated by Xtext 2.14.0
|
||||
*/
|
||||
package com.minres.rdl.ui.outline;
|
||||
|
||||
import com.minres.rdl.rdl.ComponentDefinition;
|
||||
import com.minres.rdl.rdl.ComponentInstance;
|
||||
import com.minres.rdl.rdl.EnumDefinition;
|
||||
import com.minres.rdl.rdl.EnumEntry;
|
||||
import com.minres.rdl.rdl.ExplicitPropertyAssignment;
|
||||
import com.minres.rdl.rdl.Instantiation;
|
||||
import com.minres.rdl.rdl.PostPropertyAssignment;
|
||||
import com.minres.rdl.rdl.PropertyAssignment;
|
||||
import com.minres.rdl.rdl.PropertyAssignmentRhs;
|
||||
import com.minres.rdl.rdl.PropertyDefinition;
|
||||
import com.minres.rdl.rdl.Root;
|
||||
import java.util.function.Consumer;
|
||||
import org.eclipse.xtext.ui.editor.outline.IOutlineNode;
|
||||
import org.eclipse.xtext.ui.editor.outline.impl.DefaultOutlineTreeProvider;
|
||||
import org.eclipse.xtext.ui.editor.outline.impl.DocumentRootNode;
|
||||
|
||||
/**
|
||||
* Customization of the default outline structure.
|
||||
*
|
||||
* See https://www.eclipse.org/Xtext/documentation/310_eclipse_support.html#outline
|
||||
*/
|
||||
@SuppressWarnings("all")
|
||||
public class RDLOutlineTreeProvider extends DefaultOutlineTreeProvider {
|
||||
protected void _createChildren(final DocumentRootNode parentNode, final Root domainModel) {
|
||||
final Consumer<EnumDefinition> _function = (EnumDefinition it) -> {
|
||||
this.createNode(parentNode, it);
|
||||
};
|
||||
domainModel.getEnumDefinitions().forEach(_function);
|
||||
final Consumer<PropertyDefinition> _function_1 = (PropertyDefinition it) -> {
|
||||
this.createNode(parentNode, it);
|
||||
};
|
||||
domainModel.getPropertyDefinitions().forEach(_function_1);
|
||||
final Consumer<ComponentDefinition> _function_2 = (ComponentDefinition it) -> {
|
||||
this.createNode(parentNode, it);
|
||||
};
|
||||
domainModel.getComponentDefinitions().forEach(_function_2);
|
||||
final Consumer<PropertyAssignment> _function_3 = (PropertyAssignment it) -> {
|
||||
this.createNode(parentNode, it);
|
||||
};
|
||||
domainModel.getPropertyAssignments().forEach(_function_3);
|
||||
final Consumer<Instantiation> _function_4 = (Instantiation instantiation) -> {
|
||||
ComponentDefinition _component = instantiation.getComponent();
|
||||
boolean _tripleNotEquals = (_component != null);
|
||||
if (_tripleNotEquals) {
|
||||
this.createNode(parentNode, instantiation.getComponent());
|
||||
}
|
||||
final Consumer<ComponentInstance> _function_5 = (ComponentInstance it) -> {
|
||||
this.createNode(parentNode, it);
|
||||
};
|
||||
instantiation.getComponentInstances().forEach(_function_5);
|
||||
};
|
||||
domainModel.getInstantiations().forEach(_function_4);
|
||||
}
|
||||
|
||||
protected void _createChildren(final IOutlineNode parentNode, final ComponentDefinition compDef) {
|
||||
final Consumer<EnumDefinition> _function = (EnumDefinition it) -> {
|
||||
this.createNode(parentNode, it);
|
||||
};
|
||||
compDef.getEnumDefinitions().forEach(_function);
|
||||
final Consumer<ComponentDefinition> _function_1 = (ComponentDefinition it) -> {
|
||||
this.createNode(parentNode, it);
|
||||
};
|
||||
compDef.getComponentDefinitions().forEach(_function_1);
|
||||
final Consumer<PropertyAssignment> _function_2 = (PropertyAssignment it) -> {
|
||||
this.createNode(parentNode, it);
|
||||
};
|
||||
compDef.getPropertyAssignments().forEach(_function_2);
|
||||
final Consumer<Instantiation> _function_3 = (Instantiation instantiation) -> {
|
||||
ComponentDefinition _component = instantiation.getComponent();
|
||||
boolean _tripleNotEquals = (_component != null);
|
||||
if (_tripleNotEquals) {
|
||||
this.createNode(parentNode, instantiation.getComponent());
|
||||
}
|
||||
final Consumer<ComponentInstance> _function_4 = (ComponentInstance it) -> {
|
||||
this.createNode(parentNode, it);
|
||||
};
|
||||
instantiation.getComponentInstances().forEach(_function_4);
|
||||
};
|
||||
compDef.getInstantiations().forEach(_function_3);
|
||||
}
|
||||
|
||||
protected void _createChildren(final IOutlineNode parentNode, final EnumDefinition e) {
|
||||
final Consumer<EnumEntry> _function = (EnumEntry it) -> {
|
||||
this.createNode(parentNode, it);
|
||||
};
|
||||
e.getBody().getEntries().forEach(_function);
|
||||
}
|
||||
|
||||
protected void _createChildren(final IOutlineNode parentNode, final PostPropertyAssignment p) {
|
||||
this.createNode(parentNode, p.getRhs());
|
||||
}
|
||||
|
||||
protected boolean _isLeaf(final ExplicitPropertyAssignment feature) {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected boolean _isLeaf(final Instantiation feature) {
|
||||
return ((feature.getComponent() == null) && (feature.getComponentInstances().size() == 0));
|
||||
}
|
||||
|
||||
protected boolean _isLeaf(final PropertyAssignmentRhs feature) {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected boolean _isLeaf(final ComponentInstance feature) {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected boolean _isLeaf(final EnumEntry feature) {
|
||||
int _size = feature.getProperties().size();
|
||||
return (_size == 0);
|
||||
}
|
||||
}
|
@ -1 +0,0 @@
|
||||
/RdlPreferencePage.java
|
@ -1,35 +0,0 @@
|
||||
package com.minres.rdl.ui.preferences;
|
||||
|
||||
import com.minres.rdl.preferences.PreferenceConstants;
|
||||
import org.eclipse.core.runtime.preferences.InstanceScope;
|
||||
import org.eclipse.jface.preference.BooleanFieldEditor;
|
||||
import org.eclipse.jface.preference.ComboFieldEditor;
|
||||
import org.eclipse.jface.preference.FieldEditorPreferencePage;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.ui.IWorkbench;
|
||||
import org.eclipse.ui.IWorkbenchPreferencePage;
|
||||
import org.eclipse.ui.preferences.ScopedPreferenceStore;
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public class RdlPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
|
||||
public RdlPreferencePage() {
|
||||
super(FieldEditorPreferencePage.GRID);
|
||||
final ScopedPreferenceStore store = new ScopedPreferenceStore(InstanceScope.INSTANCE, PreferenceConstants.SCOPE_NAME);
|
||||
this.setPreferenceStore(store);
|
||||
this.setDescription("Code generator configuration options");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createFieldEditors() {
|
||||
Composite _fieldEditorParent = this.getFieldEditorParent();
|
||||
BooleanFieldEditor _booleanFieldEditor = new BooleanFieldEditor(PreferenceConstants.P_GENERATE_CSV, "Generate CSV:", _fieldEditorParent);
|
||||
this.addField(_booleanFieldEditor);
|
||||
Composite _fieldEditorParent_1 = this.getFieldEditorParent();
|
||||
ComboFieldEditor _comboFieldEditor = new ComboFieldEditor(PreferenceConstants.P_ADDRESSUNIT, "Address unit size", new String[][] { new String[] { "Byte (8bit)", "byte" }, new String[] { "Word (16bit)", "word" }, new String[] { "DWord (32bit)", "dword" } }, _fieldEditorParent_1);
|
||||
this.addField(_comboFieldEditor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(final IWorkbench workbench) {
|
||||
}
|
||||
}
|
@ -1 +0,0 @@
|
||||
/RDLQuickfixProvider.java
|
@ -1,15 +0,0 @@
|
||||
/**
|
||||
* generated by Xtext 2.14.0
|
||||
*/
|
||||
package com.minres.rdl.ui.quickfix;
|
||||
|
||||
import org.eclipse.xtext.ui.editor.quickfix.DefaultQuickfixProvider;
|
||||
|
||||
/**
|
||||
* Custom quickfixes.
|
||||
*
|
||||
* See https://www.eclipse.org/Xtext/documentation/310_eclipse_support.html#quick-fixes
|
||||
*/
|
||||
@SuppressWarnings("all")
|
||||
public class RDLQuickfixProvider extends DefaultQuickfixProvider {
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
/**
|
||||
* generated by Xtext 2.14.0
|
||||
*/
|
||||
package com.minres.rdl.ui.wizard;
|
||||
|
||||
import org.eclipse.xtext.ui.wizard.template.AbstractProjectTemplate;
|
||||
import org.eclipse.xtext.ui.wizard.template.IProjectTemplateProvider;
|
||||
|
||||
/**
|
||||
* Create a list with all project templates to be shown in the template new project wizard.
|
||||
*
|
||||
* Each template is able to generate one or more projects. Each project can be configured such that any number of files are included.
|
||||
*/
|
||||
@SuppressWarnings("all")
|
||||
public class RDLProjectTemplateProvider implements IProjectTemplateProvider {
|
||||
@Override
|
||||
public AbstractProjectTemplate[] getProjectTemplates() {
|
||||
RdlProject _rdlProject = new RdlProject();
|
||||
return new AbstractProjectTemplate[] { _rdlProject };
|
||||
}
|
||||
}
|
@ -1,94 +0,0 @@
|
||||
/**
|
||||
* generated by Xtext 2.14.0
|
||||
*/
|
||||
package com.minres.rdl.ui.wizard;
|
||||
|
||||
import java.util.List;
|
||||
import org.eclipse.xtend2.lib.StringConcatenation;
|
||||
import org.eclipse.xtext.ui.XtextProjectHelper;
|
||||
import org.eclipse.xtext.ui.util.PluginProjectFactory;
|
||||
import org.eclipse.xtext.ui.wizard.template.AbstractProjectTemplate;
|
||||
import org.eclipse.xtext.ui.wizard.template.IProjectGenerator;
|
||||
import org.eclipse.xtext.ui.wizard.template.ProjectTemplate;
|
||||
import org.eclipse.xtext.xbase.lib.ObjectExtensions;
|
||||
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
|
||||
|
||||
@ProjectTemplate(label = "RDL template", icon = "project_template.png", description = "<p><b>RDL</b></p><p>This is a simple project for RDL.</p>")
|
||||
@SuppressWarnings("all")
|
||||
public final class RdlProject extends AbstractProjectTemplate {
|
||||
@Override
|
||||
public void generateProjects(final IProjectGenerator generator) {
|
||||
PluginProjectFactory _pluginProjectFactory = new PluginProjectFactory();
|
||||
final Procedure1<PluginProjectFactory> _function = (PluginProjectFactory it) -> {
|
||||
it.setProjectName(this.getProjectInfo().getProjectName());
|
||||
it.setLocation(this.getProjectInfo().getLocationPath());
|
||||
List<String> _projectNatures = it.getProjectNatures();
|
||||
_projectNatures.add(XtextProjectHelper.NATURE_ID);
|
||||
List<String> _builderIds = it.getBuilderIds();
|
||||
_builderIds.add(XtextProjectHelper.BUILDER_ID);
|
||||
List<String> _folders = it.getFolders();
|
||||
_folders.add("src");
|
||||
StringConcatenation _builder = new StringConcatenation();
|
||||
_builder.append("src/Model.rdl");
|
||||
StringConcatenation _builder_1 = new StringConcatenation();
|
||||
_builder_1.append("enum ERRSLICE0_MISSIONERR_ENABLE_ERR25_enum{");
|
||||
_builder_1.newLine();
|
||||
_builder_1.append(" ");
|
||||
_builder_1.append("DISABLE = 1\'d0;");
|
||||
_builder_1.newLine();
|
||||
_builder_1.append(" ");
|
||||
_builder_1.append("ENABLE = 1\'d1;");
|
||||
_builder_1.newLine();
|
||||
_builder_1.append("};");
|
||||
_builder_1.newLine();
|
||||
_builder_1.append("addrmap {");
|
||||
_builder_1.newLine();
|
||||
_builder_1.append(" ");
|
||||
_builder_1.append("name = \"foo registers\";");
|
||||
_builder_1.newLine();
|
||||
_builder_1.append(" ");
|
||||
_builder_1.append("desc = \"this is a bunch of foo regs bla bla bla\";");
|
||||
_builder_1.newLine();
|
||||
_builder_1.append(" ");
|
||||
_builder_1.newLine();
|
||||
_builder_1.append(" ");
|
||||
_builder_1.append("regfile bar_regs {");
|
||||
_builder_1.newLine();
|
||||
_builder_1.append(" ");
|
||||
_builder_1.append("name = \"bar registers\";");
|
||||
_builder_1.newLine();
|
||||
_builder_1.append(" ");
|
||||
_builder_1.append("desc = \"this is a bunch of bar regs bla bla bla\";");
|
||||
_builder_1.newLine();
|
||||
_builder_1.append(" ");
|
||||
_builder_1.newLine();
|
||||
_builder_1.append("\t ");
|
||||
_builder_1.append("reg {");
|
||||
_builder_1.newLine();
|
||||
_builder_1.append(" ");
|
||||
_builder_1.append("field { name=\"field 1\"; sw=rw; hw=rw; we; } fld1[9:0] = 10\'d0;");
|
||||
_builder_1.newLine();
|
||||
_builder_1.append(" ");
|
||||
_builder_1.append("field { name=\"field 2\"; sw=rw; hw=r; } fld2[15:15];");
|
||||
_builder_1.newLine();
|
||||
_builder_1.append(" ");
|
||||
_builder_1.append("field {encode=ERRSLICE0_MISSIONERR_ENABLE_ERR25_enum; sw=rw; hw=r; reset=1\'h1;} ERR25[25:25];");
|
||||
_builder_1.newLine();
|
||||
_builder_1.append("\t ");
|
||||
_builder_1.append("} a_reg[2];\t ");
|
||||
_builder_1.newLine();
|
||||
_builder_1.append("\t ");
|
||||
_builder_1.newLine();
|
||||
_builder_1.append(" ");
|
||||
_builder_1.append("} bar;");
|
||||
_builder_1.newLine();
|
||||
_builder_1.append(" ");
|
||||
_builder_1.newLine();
|
||||
_builder_1.append("} foo;");
|
||||
_builder_1.newLine();
|
||||
this.addFile(it, _builder, _builder_1);
|
||||
};
|
||||
PluginProjectFactory _doubleArrow = ObjectExtensions.<PluginProjectFactory>operator_doubleArrow(_pluginProjectFactory, _function);
|
||||
generator.generate(_doubleArrow);
|
||||
}
|
||||
}
|
@ -1,71 +0,0 @@
|
||||
package com.minres.structural.ui.hyperlink;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import org.eclipse.emf.common.util.URI;
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
import org.eclipse.emf.ecore.resource.Resource;
|
||||
import org.eclipse.emf.ecore.util.EcoreUtil;
|
||||
import org.eclipse.jface.text.Region;
|
||||
import org.eclipse.xtext.EcoreUtil2;
|
||||
import org.eclipse.xtext.nodemodel.ILeafNode;
|
||||
import org.eclipse.xtext.nodemodel.INode;
|
||||
import org.eclipse.xtext.nodemodel.util.NodeModelUtils;
|
||||
import org.eclipse.xtext.parser.IParseResult;
|
||||
import org.eclipse.xtext.resource.XtextResource;
|
||||
import org.eclipse.xtext.scoping.impl.ImportUriResolver;
|
||||
import org.eclipse.xtext.ui.editor.hyperlinking.HyperlinkHelper;
|
||||
import org.eclipse.xtext.ui.editor.hyperlinking.IHyperlinkAcceptor;
|
||||
import org.eclipse.xtext.ui.editor.hyperlinking.XtextHyperlink;
|
||||
import org.eclipse.xtext.util.ITextRegion;
|
||||
import org.eclipse.xtext.util.TextRegion;
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public class MyHyperlinkHelper extends HyperlinkHelper {
|
||||
@Inject
|
||||
private ImportUriResolver resolver;
|
||||
|
||||
@Override
|
||||
public void createHyperlinksByOffset(final XtextResource resource, final int offset, final IHyperlinkAcceptor acceptor) {
|
||||
final TextRegion region = new TextRegion(offset, 0);
|
||||
final INode crossRefNode = this.getEObjectAtOffsetHelper().getCrossReferenceNode(resource, region);
|
||||
if ((crossRefNode == null)) {
|
||||
final IParseResult parseResult = resource.getParseResult();
|
||||
if ((parseResult != null)) {
|
||||
final ILeafNode leaf = NodeModelUtils.findLeafNodeAtOffset(parseResult.getRootNode(), region.getOffset());
|
||||
final EObject semObj = NodeModelUtils.findActualSemanticObjectFor(leaf);
|
||||
final String importURI = this.resolver.resolve(semObj);
|
||||
if (((importURI != null) && EcoreUtil2.isValidUri(semObj, URI.createURI(importURI)))) {
|
||||
final Resource referencedResource = EcoreUtil2.getResource(resource, importURI);
|
||||
if (((referencedResource != null) && (referencedResource.getContents().size() > 0))) {
|
||||
final EObject top = referencedResource.getContents().get(0);
|
||||
final ITextRegion textRegion = leaf.getTextRegion();
|
||||
final URI uri = EcoreUtil.getURI(top);
|
||||
final XtextHyperlink result = this.getHyperlinkProvider().get();
|
||||
int _offset = textRegion.getOffset();
|
||||
int _length = textRegion.getLength();
|
||||
Region _region = new Region(_offset, _length);
|
||||
result.setHyperlinkRegion(_region);
|
||||
URI _xifexpression = null;
|
||||
boolean _isPlatformResource = uri.isPlatformResource();
|
||||
if (_isPlatformResource) {
|
||||
_xifexpression = uri;
|
||||
} else {
|
||||
_xifexpression = resource.getResourceSet().getURIConverter().normalize(uri);
|
||||
}
|
||||
result.setURI(_xifexpression);
|
||||
result.setHyperlinkText(this.getLabelProvider().getText(top));
|
||||
if ((result instanceof MyXtextHyperlink)) {
|
||||
((MyXtextHyperlink)result).setSelectTarget(false);
|
||||
}
|
||||
acceptor.accept(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
final EObject crossLinkedEObject = this.getEObjectAtOffsetHelper().getCrossReferencedElement(crossRefNode);
|
||||
if (((crossLinkedEObject != null) && (!crossLinkedEObject.eIsProxy()))) {
|
||||
this.createHyperlinksTo(resource, crossRefNode, crossLinkedEObject, acceptor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
package com.minres.structural.ui.hyperlink;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import org.eclipse.xtext.ui.editor.IURIEditorOpener;
|
||||
import org.eclipse.xtext.ui.editor.hyperlinking.XtextHyperlink;
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public class MyXtextHyperlink extends XtextHyperlink {
|
||||
private boolean select = true;
|
||||
|
||||
@Inject
|
||||
private IURIEditorOpener uriEditorOpener;
|
||||
|
||||
@Override
|
||||
public void open() {
|
||||
this.uriEditorOpener.open(this.getURI(), this.select);
|
||||
}
|
||||
|
||||
public boolean getSelectTarget() {
|
||||
return this.select;
|
||||
}
|
||||
|
||||
public void setSelectTarget(final boolean select) {
|
||||
this.select = select;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user