mirror of https://github.com/Minres/RDL-Editor.git
Compare commits
3 Commits
96c8c1310e
...
26fc38b7ee
Author | SHA1 | Date |
---|---|---|
Eyck Jentzsch | 26fc38b7ee | |
Eyck Jentzsch | 1d2384257e | |
Eyck Jentzsch | 1c9c0ee340 |
|
@ -0,0 +1,24 @@
|
|||
#%Module######################################################################
|
||||
##
|
||||
## Project Module
|
||||
##
|
||||
proc ModulesHelp { } {
|
||||
puts stderr "\tThe TGFS-CG Project Module\n"
|
||||
puts stderr "\tThis module loads PATHs and variables for accessing Verilator."
|
||||
}
|
||||
|
||||
|
||||
#set distro [exec /bin/lsb_release -i -s]
|
||||
#if { $distro == "CentOS" && ![info exists ::env(PROJECT)] && ![info exists ::env(PCP_DIR)] } {
|
||||
# puts stderr "Don't forget to execute 'scl enable devtoolset-7 bash'"
|
||||
#}
|
||||
|
||||
if {![info exists ::env(PROJECT)] && [file exists $::env(HOME)/.sdkman/candidates/java/11.0.9.hs-adpt/] != 1} {
|
||||
puts stderr "Please install java via 'sdk install java 11.0.9.hs-adpt'!"
|
||||
prereq java/11.0.9
|
||||
} else {
|
||||
prepend-path PATH $::env(HOME)/.sdkman/candidates/java/11.0.9.hs-adpt/bin
|
||||
}
|
||||
|
||||
setenv PROJECT RDL-Editor
|
||||
|
|
@ -760,13 +760,6 @@
|
|||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="javax.servlet"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="org.objectweb.asm"
|
||||
download-size="0"
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
<product name="RDL Editor" uid="com.minres.rdl.product.product" id="com.minres.rdl.product.product" application="org.eclipse.ui.ide.workbench" version="1.3.0.qualifier" useFeatures="true" includeLaunchers="true">
|
||||
|
||||
|
||||
<configIni use="default">
|
||||
</configIni>
|
||||
|
||||
|
@ -23,80 +24,6 @@
|
|||
</vm>
|
||||
|
||||
<plugins>
|
||||
<plugin id="com.ibm.icu"/>
|
||||
<plugin id="com.minres.rdl.product"/>
|
||||
<plugin id="javax.inject"/>
|
||||
<plugin id="javax.xml"/>
|
||||
<plugin id="org.apache.batik.css"/>
|
||||
<plugin id="org.apache.batik.util"/>
|
||||
<plugin id="org.apache.batik.util.gui"/>
|
||||
<plugin id="org.apache.commons.jxpath"/>
|
||||
<plugin id="org.eclipse.core.commands"/>
|
||||
<plugin id="org.eclipse.core.contenttype"/>
|
||||
<plugin id="org.eclipse.core.databinding"/>
|
||||
<plugin id="org.eclipse.core.databinding.observable"/>
|
||||
<plugin id="org.eclipse.core.databinding.property"/>
|
||||
<plugin id="org.eclipse.core.expressions"/>
|
||||
<plugin id="org.eclipse.core.filesystem"/>
|
||||
<plugin id="org.eclipse.core.filesystem.macosx" fragment="true"/>
|
||||
<plugin id="org.eclipse.core.jobs"/>
|
||||
<plugin id="org.eclipse.core.runtime"/>
|
||||
<plugin id="org.eclipse.e4.core.commands"/>
|
||||
<plugin id="org.eclipse.e4.core.contexts"/>
|
||||
<plugin id="org.eclipse.e4.core.di"/>
|
||||
<plugin id="org.eclipse.e4.core.di.annotations"/>
|
||||
<plugin id="org.eclipse.e4.core.di.extensions"/>
|
||||
<plugin id="org.eclipse.e4.core.services"/>
|
||||
<plugin id="org.eclipse.e4.emf.xpath"/>
|
||||
<plugin id="org.eclipse.e4.ui.bindings"/>
|
||||
<plugin id="org.eclipse.e4.ui.css.core"/>
|
||||
<plugin id="org.eclipse.e4.ui.css.swt"/>
|
||||
<plugin id="org.eclipse.e4.ui.css.swt.theme"/>
|
||||
<plugin id="org.eclipse.e4.ui.di"/>
|
||||
<plugin id="org.eclipse.e4.ui.model.workbench"/>
|
||||
<plugin id="org.eclipse.e4.ui.services"/>
|
||||
<plugin id="org.eclipse.e4.ui.widgets"/>
|
||||
<plugin id="org.eclipse.e4.ui.workbench"/>
|
||||
<plugin id="org.eclipse.e4.ui.workbench.addons.swt"/>
|
||||
<plugin id="org.eclipse.e4.ui.workbench.renderers.swt"/>
|
||||
<plugin id="org.eclipse.e4.ui.workbench.renderers.swt.cocoa" fragment="true"/>
|
||||
<plugin id="org.eclipse.e4.ui.workbench.swt"/>
|
||||
<plugin id="org.eclipse.e4.ui.workbench3"/>
|
||||
<plugin id="org.eclipse.emf.common"/>
|
||||
<plugin id="org.eclipse.emf.ecore"/>
|
||||
<plugin id="org.eclipse.emf.ecore.change"/>
|
||||
<plugin id="org.eclipse.emf.ecore.xmi"/>
|
||||
<plugin id="org.eclipse.equinox.app"/>
|
||||
<plugin id="org.eclipse.equinox.bidi"/>
|
||||
<plugin id="org.eclipse.equinox.common"/>
|
||||
<plugin id="org.eclipse.equinox.p2.core"/>
|
||||
<plugin id="org.eclipse.equinox.p2.engine"/>
|
||||
<plugin id="org.eclipse.equinox.p2.metadata"/>
|
||||
<plugin id="org.eclipse.equinox.p2.metadata.repository"/>
|
||||
<plugin id="org.eclipse.equinox.p2.repository"/>
|
||||
<plugin id="org.eclipse.equinox.preferences"/>
|
||||
<plugin id="org.eclipse.equinox.registry"/>
|
||||
<plugin id="org.eclipse.equinox.security"/>
|
||||
<plugin id="org.eclipse.equinox.security.macosx" fragment="true"/>
|
||||
<plugin id="org.eclipse.help"/>
|
||||
<plugin id="org.eclipse.jface"/>
|
||||
<plugin id="org.eclipse.jface.databinding"/>
|
||||
<plugin id="org.eclipse.jface.text"/>
|
||||
<plugin id="org.eclipse.osgi"/>
|
||||
<plugin id="org.eclipse.osgi.compatibility.state" fragment="true"/>
|
||||
<plugin id="org.eclipse.osgi.services"/>
|
||||
<plugin id="org.eclipse.swt"/>
|
||||
<plugin id="org.eclipse.swt.cocoa.macosx.x86_64" fragment="true"/>
|
||||
<plugin id="org.eclipse.text"/>
|
||||
<plugin id="org.eclipse.ui"/>
|
||||
<plugin id="org.eclipse.ui.cocoa" fragment="true"/>
|
||||
<plugin id="org.eclipse.ui.ide"/>
|
||||
<plugin id="org.eclipse.ui.workbench"/>
|
||||
<plugin id="org.tukaani.xz"/>
|
||||
<plugin id="org.w3c.css.sac"/>
|
||||
<plugin id="org.w3c.dom.events"/>
|
||||
<plugin id="org.w3c.dom.smil"/>
|
||||
<plugin id="org.w3c.dom.svg"/>
|
||||
</plugins>
|
||||
|
||||
<features>
|
||||
|
|
|
@ -1,20 +1,95 @@
|
|||
import static groovy.io.FileType.FILES
|
||||
|
||||
import java.nio.file.Files
|
||||
import java.nio.file.Paths
|
||||
import java.util.zip.ZipEntry
|
||||
|
||||
def needed_jars = [
|
||||
/org\.eclipse\.xtext/,
|
||||
/org\.eclipse\.emf\.ecore\.xmi/,
|
||||
/org\.eclipse\.emf\.ecore/,
|
||||
/org\.eclipse\.emf\.common/,
|
||||
/org\.antlr\.runtime/,
|
||||
/com\.google\.inject/,
|
||||
/org\.eclipse\.emf\.mwe\.core/,
|
||||
/org\.apache\.commons\.cli/,
|
||||
/org\.eclipse\.emf\.mwe2\.runtime/,
|
||||
/org\.eclipse\.emf\.mwe\.utils/,
|
||||
/org\.eclipse\.xtext\.util/,
|
||||
/com\.google\.guava/,
|
||||
/javax\.inject/,
|
||||
/org\.eclipse\.xtext\.xbase/,
|
||||
/org\.eclipse\.xtext\.common\.types/,
|
||||
/org\.eclipse\.xtend\.lib/,
|
||||
/org\.eclipse\.xtext\.xbase\.lib/,
|
||||
/org\.eclipse\.xtend\.lib\.macro/,
|
||||
/org\.eclipse\.equinox\.common/,
|
||||
/eclipse-trace/,
|
||||
/groovy-eclipse/,
|
||||
/ivy-2\.5\.0\.jar/,
|
||||
/groovy-3\.0\.\d-indy/,
|
||||
/groovy-templates-3\.0\.\d/,
|
||||
/org\.eclipse\.xtext\.xtext\.generator/,
|
||||
/org\.eclipse\.emf\.codegen\.ecore/,
|
||||
/org\.eclipse\.emf\.codegen/,
|
||||
/org\.eclipse\.emf\.mwe2\.launch/,
|
||||
/org\.eclipse\.emf\.mwe2\.language/,
|
||||
/org\.eclipse\.emf\.mwe2\.lib/,
|
||||
/org\.objectweb\.asm/,
|
||||
/org\.apache\.commons\.logging/,
|
||||
/org\.apache\.log4j/,
|
||||
/com\.ibm\.icu/,
|
||||
/org\.json/,
|
||||
/com\.minres\.rdl/
|
||||
]
|
||||
|
||||
// Collect all jars.
|
||||
def jars = []
|
||||
def root = new File(project.getBasedir(), 'target/classes')
|
||||
def libs = new File(project.getBasedir(), 'target/classes/lib')
|
||||
def meta_inf = new File(project.getBasedir(), 'target/classes/META-INF')
|
||||
|
||||
libs.eachFileRecurse (FILES) { file ->
|
||||
jars << root.toURI().relativize(file.toURI()).toString()
|
||||
if(file.name =~/org\.codehaus\.groovy_/) { // we need to unpack this one sinc it is already jar in jar
|
||||
println("Unpacking ${file}")
|
||||
def zipFile = new java.util.zip.ZipFile(file)
|
||||
zipFile.entries().findAll {ZipEntry entry -> !entry.directory && entry.name =~/\.jar$/}.each {ZipEntry entry ->
|
||||
def outFile = new File(libs, entry.name.split(/\//)[-1])
|
||||
println "Extracting file ${entry.name} to ${outFile.path} with size ${entry.size}bytes (${entry.compressedSize}bytes)"
|
||||
Files.copy(zipFile.getInputStream(entry), outFile.toPath())
|
||||
}
|
||||
}
|
||||
}
|
||||
libs.eachFileRecurse (FILES) { file ->
|
||||
def fileName = file.name.split("/")[-1]
|
||||
if(needed_jars.find{fileName =~ it}) {
|
||||
println "Adding $file to the included jars"
|
||||
jars << root.toURI().relativize(file.toURI()).toString()
|
||||
} else {
|
||||
file.delete()
|
||||
}
|
||||
}
|
||||
def zipFile = new java.util.zip.ZipFile(new File(project.getBasedir(), 'jar-in-jar-loader.zip'))
|
||||
zipFile.entries().each {ZipEntry it ->
|
||||
def path = Paths.get("${root}/", it.name)
|
||||
if(it.directory){
|
||||
Files.createDirectories(path)
|
||||
} else {
|
||||
def parentDir = path.getParent()
|
||||
if (!Files.exists(parentDir)) {
|
||||
Files.createDirectories(parentDir)
|
||||
}
|
||||
Files.deleteIfExists(path)
|
||||
println "Extracting file ${it.name} to ${path} with size ${it.size}bytes (${it.compressedSize}bytes)"
|
||||
Files.copy(zipFile.getInputStream(it), path)
|
||||
}
|
||||
}
|
||||
|
||||
// Write the manifest file.
|
||||
def manifest = new File(project.getBasedir(), 'target/classes/META-INF/MANIFEST.MF')
|
||||
|
||||
manifest.write ''
|
||||
|
||||
manifest << 'Manifest-Version: 1.0\n'
|
||||
manifest << 'Class-Path: . ' + jars.join(' ') + '\n'
|
||||
manifest << 'Rsrc-Main-Class: com.minres.rdl.generator.Main\n'
|
||||
manifest << 'Main-Class: org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader\n'
|
||||
Files.createDirectories( Paths.get(meta_inf.absolutePath))
|
||||
def mf = new File(project.getBasedir(), 'target/classes/META-INF/MANIFEST.MF')
|
||||
mf.write ''
|
||||
mf << 'Manifest-Version: 1.0\n'
|
||||
mf << 'Rsrc-Class-Path: ./ ' + jars.join(' ') + '\n'
|
||||
mf << 'Rsrc-Main-Class: com.minres.rdl.generator.Main\n'
|
||||
mf << 'Main-Class: org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader\n'
|
||||
|
|
Binary file not shown.
|
@ -1,39 +1,43 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<?pde version="3.8"?>
|
||||
<target name="com.minres.rdl.target" sequenceNumber="1">
|
||||
<locations>
|
||||
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
|
||||
<unit id="org.eclipse.jdt.feature.group" version="0.0.0"/>
|
||||
<unit id="org.eclipse.platform.feature.group" version="0.0.0"/>
|
||||
<unit id="org.eclipse.pde.feature.group" version="0.0.0"/>
|
||||
<unit id="org.eclipse.draw2d.feature.group" version="0.0.0"/>
|
||||
<unit id="org.eclipse.emf.sdk.feature.group" version="0.0.0"/>
|
||||
<unit id="org.eclipse.equinox.executable.feature.group" version="0.0.0"/>
|
||||
<repository location="https://download.eclipse.org/releases/2021-03"/>
|
||||
</location>
|
||||
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
|
||||
<unit id="org.eclipse.emf.mwe2.launcher.feature.group" version="0.0.0"/>
|
||||
<repository location="https://download.eclipse.org/modeling/emft/mwe/updates/releases/2.12.1/"/>
|
||||
</location>
|
||||
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
|
||||
<unit id="org.eclipse.xtext.sdk.feature.group" version="0.0.0"/>
|
||||
<repository location="https://download.eclipse.org/modeling/tmf/xtext/updates/releases/2.25.0/"/>
|
||||
</location>
|
||||
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
|
||||
<unit id="com.google.gson" version="2.8.6.v20201231-1626"/>
|
||||
<unit id="org.antlr.runtime" version="3.2.0.v201101311130"/>
|
||||
<unit id="org.junit" version="4.12.0.v201504281640"/>
|
||||
<unit id="org.junit.jupiter.api" version="5.7.1.v20210222-1948"/>
|
||||
<unit id="org.junit.jupiter.engine" version="5.7.1.v20210222-1948"/>
|
||||
<unit id="org.junit.platform.commons" version="1.7.1.v20210222-1948"/>
|
||||
<unit id="org.junit.platform.engine" version="1.7.1.v20210222-1948"/>
|
||||
<unit id="org.junit.platform.launcher" version="1.7.1.v20210222-1948"/>
|
||||
<unit id="org.junit.platform.runner" version="1.7.1.v20210222-1948"/>
|
||||
<unit id="org.opentest4j" version="1.2.0.v20190826-0900"/>
|
||||
<unit id="org.objectweb.asm" version="9.1.0.v20210209-1849"/>
|
||||
<unit id="org.objectweb.asm.tree" version="9.1.0.v20210209-1849"/>
|
||||
<unit id="io.github.classgraph" version="4.8.35.v20190528-1517"/>
|
||||
<repository location="https://download.eclipse.org/tools/orbit/downloads/2021-03"/>
|
||||
</location>
|
||||
</locations>
|
||||
<target name="com.minres.coredsl.target" sequenceNumber="1">
|
||||
<locations>
|
||||
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
|
||||
<unit id="org.eclipse.jdt.feature.group" version="0.0.0"/>
|
||||
<unit id="org.eclipse.platform.feature.group" version="0.0.0"/>
|
||||
<unit id="org.eclipse.pde.feature.group" version="0.0.0"/>
|
||||
<unit id="org.eclipse.draw2d.feature.group" version="0.0.0"/>
|
||||
<unit id="org.eclipse.emf.sdk.feature.group" version="0.0.0"/>
|
||||
<unit id="org.eclipse.equinox.executable.feature.group" version="0.0.0"/>
|
||||
<repository location="https://download.eclipse.org/releases/2022-03"/>
|
||||
</location>
|
||||
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
|
||||
<unit id="org.eclipse.emf.mwe2.launcher.feature.group" version="0.0.0"/>
|
||||
<repository location="https://download.eclipse.org/modeling/emft/mwe/updates/releases/2.12.2/"/>
|
||||
</location>
|
||||
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
|
||||
<unit id="org.eclipse.xtext.sdk.feature.group" version="0.0.0"/>
|
||||
<repository location="https://download.eclipse.org/modeling/tmf/xtext/updates/releases/2.26.0/"/>
|
||||
</location>
|
||||
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
|
||||
<unit id="com.google.gson" version="2.8.9.v20220111-1409"/>
|
||||
<unit id="com.google.inject" version="5.0.1.v20210324-2015"/>
|
||||
<unit id="javax.inject" version="1.0.0.v20091030"/>
|
||||
<unit id="org.antlr.runtime" version="3.2.0.v201101311130"/>
|
||||
<unit id="org.junit" version="4.13.2.v20211018-1956"/>
|
||||
<unit id="org.apiguardian" version="1.1.2.v20211018-1956"/>
|
||||
<unit id="org.junit.jupiter.api" version="5.8.1.v20211018-1956"/>
|
||||
<unit id="org.junit.jupiter.engine" version="5.8.1.v20211018-1956"/>
|
||||
<unit id="org.junit.platform.commons" version="1.8.1.v20211018-1956"/>
|
||||
<unit id="org.junit.platform.engine" version="1.8.1.v20211018-1956"/>
|
||||
<unit id="org.junit.platform.launcher" version="1.8.1.v20211018-1956"/>
|
||||
<unit id="org.junit.platform.runner" version="1.8.1.v20211018-1956"/>
|
||||
<unit id="org.junit.platform.suite.commons" version="1.8.1.v20211018-1956"/>
|
||||
<unit id="org.opentest4j" version="1.2.0.v20211018-1956"/>
|
||||
<unit id="org.objectweb.asm" version="9.2.0.v20210813-1119"/>
|
||||
<unit id="org.objectweb.asm.tree" version="9.2.0.v20210813-1119"/>
|
||||
<unit id="io.github.classgraph" version="4.8.138.v20211212-1642"/>
|
||||
<repository location="https://download.eclipse.org/tools/orbit/downloads/2022-03"/>
|
||||
</location>
|
||||
</locations>
|
||||
</target>
|
||||
|
|
|
@ -1,466 +1,510 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?eclipse version="3.0"?>
|
||||
<plugin>
|
||||
<extension
|
||||
point="org.eclipse.ui.editors">
|
||||
<editor
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.XtextEditor"
|
||||
contributorClass="org.eclipse.ui.editors.text.TextEditorActionContributor"
|
||||
default="true"
|
||||
extensions="rdl"
|
||||
id="com.minres.rdl.RDL"
|
||||
name="RDL Editor">
|
||||
</editor>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.handlers">
|
||||
<handler
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.hyperlinking.OpenDeclarationHandler"
|
||||
commandId="org.eclipse.xtext.ui.editor.hyperlinking.OpenDeclaration">
|
||||
<activeWhen>
|
||||
<reference
|
||||
definitionId="com.minres.rdl.RDL.Editor.opened">
|
||||
</reference>
|
||||
</activeWhen>
|
||||
</handler>
|
||||
<handler
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.handler.ValidateActionHandler"
|
||||
commandId="com.minres.rdl.RDL.validate">
|
||||
<activeWhen>
|
||||
<reference
|
||||
definitionId="com.minres.rdl.RDL.Editor.opened">
|
||||
</reference>
|
||||
</activeWhen>
|
||||
</handler>
|
||||
<!-- copy qualified name -->
|
||||
<handler
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.copyqualifiedname.EditorCopyQualifiedNameHandler"
|
||||
commandId="org.eclipse.xtext.ui.editor.copyqualifiedname.EditorCopyQualifiedName">
|
||||
<activeWhen>
|
||||
<reference definitionId="com.minres.rdl.RDL.Editor.opened" />
|
||||
</activeWhen>
|
||||
</handler>
|
||||
<handler
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.copyqualifiedname.OutlineCopyQualifiedNameHandler"
|
||||
commandId="org.eclipse.xtext.ui.editor.copyqualifiedname.OutlineCopyQualifiedName">
|
||||
<activeWhen>
|
||||
<and>
|
||||
<reference definitionId="com.minres.rdl.RDL.XtextEditor.opened" />
|
||||
<iterate>
|
||||
<adapt type="org.eclipse.xtext.ui.editor.outline.IOutlineNode" />
|
||||
</iterate>
|
||||
</and>
|
||||
</activeWhen>
|
||||
</handler>
|
||||
</extension>
|
||||
<extension point="org.eclipse.core.expressions.definitions">
|
||||
<definition id="com.minres.rdl.RDL.Editor.opened">
|
||||
<and>
|
||||
<reference definitionId="isActiveEditorAnInstanceOfXtextEditor"/>
|
||||
<with variable="activeEditor">
|
||||
<test property="org.eclipse.xtext.ui.editor.XtextEditor.languageName"
|
||||
value="com.minres.rdl.RDL"
|
||||
forcePluginActivation="true"/>
|
||||
</with>
|
||||
</and>
|
||||
</definition>
|
||||
<definition id="com.minres.rdl.RDL.XtextEditor.opened">
|
||||
<and>
|
||||
<reference definitionId="isXtextEditorActive"/>
|
||||
<with variable="activeEditor">
|
||||
<test property="org.eclipse.xtext.ui.editor.XtextEditor.languageName"
|
||||
value="com.minres.rdl.RDL"
|
||||
forcePluginActivation="true"/>
|
||||
</with>
|
||||
</and>
|
||||
</definition>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.preferencePages">
|
||||
<page
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.preferences.LanguageRootPreferencePage"
|
||||
id="com.minres.rdl.RDL"
|
||||
name="RDL">
|
||||
<keywordReference id="com.minres.rdl.ui.keyword_RDL"/>
|
||||
</page>
|
||||
<page
|
||||
category="com.minres.rdl.RDL"
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.syntaxcoloring.SyntaxColoringPreferencePage"
|
||||
id="com.minres.rdl.RDL.coloring"
|
||||
name="Syntax Coloring">
|
||||
<keywordReference id="com.minres.rdl.ui.keyword_RDL"/>
|
||||
</page>
|
||||
<page
|
||||
category="com.minres.rdl.RDL"
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.templates.XtextTemplatePreferencePage"
|
||||
id="com.minres.rdl.RDL.templates"
|
||||
name="Templates">
|
||||
<keywordReference id="com.minres.rdl.ui.keyword_RDL"/>
|
||||
</page>
|
||||
<page category="com.minres.rdl.RDL"
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:com.minres.rdl.ui.preferences.RdlPreferencePage"
|
||||
id="com.minres.rdl.RDL.preferences"
|
||||
name="Generator">
|
||||
<keywordReference id="com.minres.rdl.ui.keyword_RDL"/>
|
||||
</page>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.propertyPages">
|
||||
<page
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.preferences.LanguageRootPreferencePage"
|
||||
id="com.minres.rdl.RDL"
|
||||
name="RDL">
|
||||
<keywordReference id="com.minres.rdl.ui.keyword_RDL"/>
|
||||
<enabledWhen>
|
||||
<adapt type="org.eclipse.core.resources.IProject"/>
|
||||
</enabledWhen>
|
||||
<filter name="projectNature" value="org.eclipse.xtext.ui.shared.xtextNature"/>
|
||||
</page>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.keywords">
|
||||
<keyword
|
||||
id="com.minres.rdl.ui.keyword_RDL"
|
||||
label="RDL"/>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.commands">
|
||||
<command
|
||||
description="Trigger expensive validation"
|
||||
id="com.minres.rdl.RDL.validate"
|
||||
name="Validate">
|
||||
</command>
|
||||
<!-- copy qualified name -->
|
||||
<command
|
||||
id="org.eclipse.xtext.ui.editor.copyqualifiedname.EditorCopyQualifiedName"
|
||||
categoryId="org.eclipse.ui.category.edit"
|
||||
description="Copy the qualified name for the selected element"
|
||||
name="Copy Qualified Name">
|
||||
</command>
|
||||
<command
|
||||
id="org.eclipse.xtext.ui.editor.copyqualifiedname.OutlineCopyQualifiedName"
|
||||
categoryId="org.eclipse.ui.category.edit"
|
||||
description="Copy the qualified name for the selected element"
|
||||
name="Copy Qualified Name">
|
||||
</command>
|
||||
</extension>
|
||||
<extension point="org.eclipse.ui.menus">
|
||||
<menuContribution
|
||||
locationURI="popup:#TextEditorContext?after=group.edit">
|
||||
<command
|
||||
commandId="com.minres.rdl.RDL.validate"
|
||||
style="push"
|
||||
tooltip="Trigger expensive validation">
|
||||
<visibleWhen checkEnabled="false">
|
||||
<reference
|
||||
definitionId="com.minres.rdl.RDL.Editor.opened">
|
||||
</reference>
|
||||
</visibleWhen>
|
||||
</command>
|
||||
</menuContribution>
|
||||
<!-- copy qualified name -->
|
||||
<menuContribution locationURI="popup:#TextEditorContext?after=copy">
|
||||
<command commandId="org.eclipse.xtext.ui.editor.copyqualifiedname.EditorCopyQualifiedName"
|
||||
style="push" tooltip="Copy Qualified Name">
|
||||
<visibleWhen checkEnabled="false">
|
||||
<reference definitionId="com.minres.rdl.RDL.Editor.opened" />
|
||||
</visibleWhen>
|
||||
</command>
|
||||
</menuContribution>
|
||||
<menuContribution locationURI="menu:edit?after=copy">
|
||||
<command commandId="org.eclipse.xtext.ui.editor.copyqualifiedname.EditorCopyQualifiedName"
|
||||
style="push" tooltip="Copy Qualified Name">
|
||||
<visibleWhen checkEnabled="false">
|
||||
<reference definitionId="com.minres.rdl.RDL.Editor.opened" />
|
||||
</visibleWhen>
|
||||
</command>
|
||||
</menuContribution>
|
||||
<menuContribution locationURI="popup:org.eclipse.xtext.ui.outline?after=additions">
|
||||
<command commandId="org.eclipse.xtext.ui.editor.copyqualifiedname.OutlineCopyQualifiedName"
|
||||
style="push" tooltip="Copy Qualified Name">
|
||||
<visibleWhen checkEnabled="false">
|
||||
<and>
|
||||
<reference definitionId="com.minres.rdl.RDL.XtextEditor.opened" />
|
||||
<iterate>
|
||||
<adapt type="org.eclipse.xtext.ui.editor.outline.IOutlineNode" />
|
||||
</iterate>
|
||||
</and>
|
||||
</visibleWhen>
|
||||
</command>
|
||||
</menuContribution>
|
||||
</extension>
|
||||
<extension point="org.eclipse.ui.menus">
|
||||
<menuContribution locationURI="popup:#TextEditorContext?endof=group.find">
|
||||
<command commandId="org.eclipse.xtext.ui.editor.FindReferences">
|
||||
<visibleWhen checkEnabled="false">
|
||||
<reference definitionId="com.minres.rdl.RDL.Editor.opened">
|
||||
</reference>
|
||||
</visibleWhen>
|
||||
</command>
|
||||
</menuContribution>
|
||||
</extension>
|
||||
<extension point="org.eclipse.ui.handlers">
|
||||
<handler
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.findrefs.FindReferencesHandler"
|
||||
commandId="org.eclipse.xtext.ui.editor.FindReferences">
|
||||
<activeWhen>
|
||||
<reference
|
||||
definitionId="com.minres.rdl.RDL.Editor.opened">
|
||||
</reference>
|
||||
</activeWhen>
|
||||
</handler>
|
||||
</extension>
|
||||
<extension point="org.eclipse.core.contenttype.contentTypes">
|
||||
<content-type
|
||||
base-type="org.eclipse.core.runtime.text"
|
||||
file-extensions="rdl"
|
||||
id="com.minres.rdl.RDL.contenttype"
|
||||
name="RDL File"
|
||||
priority="normal">
|
||||
</content-type>
|
||||
</extension>
|
||||
<!-- adding resource factories -->
|
||||
<extension
|
||||
point="org.eclipse.emf.ecore.extension_parser">
|
||||
<parser
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.resource.IResourceFactory"
|
||||
type="rdl">
|
||||
</parser>
|
||||
</extension>
|
||||
<extension point="org.eclipse.xtext.extension_resourceServiceProvider">
|
||||
<resourceServiceProvider
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.resource.IResourceUIServiceProvider"
|
||||
uriExtension="rdl">
|
||||
</resourceServiceProvider>
|
||||
</extension>
|
||||
<!-- marker definitions for com.minres.rdl.RDL -->
|
||||
<extension
|
||||
id="rdl.check.fast"
|
||||
name="RDL Problem"
|
||||
point="org.eclipse.core.resources.markers">
|
||||
<super type="org.eclipse.xtext.ui.check.fast"/>
|
||||
<persistent value="true"/>
|
||||
</extension>
|
||||
<extension
|
||||
id="rdl.check.normal"
|
||||
name="RDL Problem"
|
||||
point="org.eclipse.core.resources.markers">
|
||||
<super type="org.eclipse.xtext.ui.check.normal"/>
|
||||
<persistent value="true"/>
|
||||
</extension>
|
||||
<extension
|
||||
id="rdl.check.expensive"
|
||||
name="RDL Problem"
|
||||
point="org.eclipse.core.resources.markers">
|
||||
<super type="org.eclipse.xtext.ui.check.expensive"/>
|
||||
<persistent value="true"/>
|
||||
</extension>
|
||||
<extension point="org.eclipse.ui.preferencePages">
|
||||
<page
|
||||
category="com.minres.rdl.RDL"
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.validation.ValidatorPreferencePage"
|
||||
id="com.minres.rdl.RDL.validator.preferencePage"
|
||||
name="Errors/Warnings">
|
||||
<keywordReference id="com.minres.rdl.ui.keyword_RDL"/>
|
||||
</page>
|
||||
</extension>
|
||||
<extension point="org.eclipse.xtext.builder.participant">
|
||||
<participant
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.builder.IXtextBuilderParticipant"
|
||||
fileExtensions="rdl"/>
|
||||
</extension>
|
||||
<extension point="org.eclipse.ui.preferencePages">
|
||||
<page
|
||||
category="com.minres.rdl.RDL"
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.builder.preferences.BuilderPreferencePage"
|
||||
id="com.minres.rdl.RDL.compiler.preferencePage"
|
||||
name="Compiler">
|
||||
<keywordReference id="com.minres.rdl.ui.keyword_RDL"/>
|
||||
</page>
|
||||
</extension>
|
||||
<extension point="org.eclipse.ui.propertyPages">
|
||||
<page
|
||||
category="com.minres.rdl.RDL"
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.builder.preferences.BuilderPreferencePage"
|
||||
id="com.minres.rdl.RDL.compiler.propertyPage"
|
||||
name="Compiler">
|
||||
<keywordReference id="com.minres.rdl.ui.keyword_RDL"/>
|
||||
<enabledWhen>
|
||||
<adapt type="org.eclipse.core.resources.IProject"/>
|
||||
</enabledWhen>
|
||||
<filter name="projectNature" value="org.eclipse.xtext.ui.shared.xtextNature"/>
|
||||
</page>
|
||||
</extension>
|
||||
<extension point="org.eclipse.ui.menus">
|
||||
<menuContribution locationURI="popup:#TextEditorContext?after=xtext.ui.openDeclaration">
|
||||
<command
|
||||
commandId="org.eclipse.xtext.ui.OpenGeneratedFileCommand"
|
||||
id="com.minres.rdl.RDL.OpenGeneratedCode"
|
||||
style="push">
|
||||
<visibleWhen checkEnabled="false">
|
||||
<reference definitionId="com.minres.rdl.RDL.Editor.opened" />
|
||||
</visibleWhen>
|
||||
</command>
|
||||
</menuContribution>
|
||||
</extension>
|
||||
<extension point="org.eclipse.ui.handlers">
|
||||
<handler
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.generator.trace.OpenGeneratedFileHandler"
|
||||
commandId="org.eclipse.xtext.ui.OpenGeneratedFileCommand">
|
||||
<activeWhen>
|
||||
<reference definitionId="com.minres.rdl.RDL.Editor.opened" />
|
||||
</activeWhen>
|
||||
</handler>
|
||||
</extension>
|
||||
<!-- Quick Outline -->
|
||||
<extension
|
||||
point="org.eclipse.ui.handlers">
|
||||
<handler
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.outline.quickoutline.ShowQuickOutlineActionHandler"
|
||||
commandId="org.eclipse.xtext.ui.editor.outline.QuickOutline">
|
||||
<activeWhen>
|
||||
<reference
|
||||
definitionId="com.minres.rdl.RDL.Editor.opened">
|
||||
</reference>
|
||||
</activeWhen>
|
||||
</handler>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.commands">
|
||||
<command
|
||||
description="Open the quick outline."
|
||||
id="org.eclipse.xtext.ui.editor.outline.QuickOutline"
|
||||
name="Quick Outline">
|
||||
</command>
|
||||
</extension>
|
||||
<extension point="org.eclipse.ui.menus">
|
||||
<menuContribution
|
||||
locationURI="popup:#TextEditorContext?after=group.open">
|
||||
<command commandId="org.eclipse.xtext.ui.editor.outline.QuickOutline"
|
||||
style="push"
|
||||
tooltip="Open Quick Outline">
|
||||
<visibleWhen checkEnabled="false">
|
||||
<reference definitionId="com.minres.rdl.RDL.Editor.opened"/>
|
||||
</visibleWhen>
|
||||
</command>
|
||||
</menuContribution>
|
||||
</extension>
|
||||
<!-- quickfix marker resolution generator for com.minres.rdl.RDL -->
|
||||
<extension
|
||||
point="org.eclipse.ui.ide.markerResolution">
|
||||
<markerResolutionGenerator
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.quickfix.MarkerResolutionGenerator"
|
||||
markerType="com.minres.rdl.ui.rdl.check.fast">
|
||||
<attribute
|
||||
name="FIXABLE_KEY"
|
||||
value="true">
|
||||
</attribute>
|
||||
</markerResolutionGenerator>
|
||||
<markerResolutionGenerator
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.quickfix.MarkerResolutionGenerator"
|
||||
markerType="com.minres.rdl.ui.rdl.check.normal">
|
||||
<attribute
|
||||
name="FIXABLE_KEY"
|
||||
value="true">
|
||||
</attribute>
|
||||
</markerResolutionGenerator>
|
||||
<markerResolutionGenerator
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.quickfix.MarkerResolutionGenerator"
|
||||
markerType="com.minres.rdl.ui.rdl.check.expensive">
|
||||
<attribute
|
||||
name="FIXABLE_KEY"
|
||||
value="true">
|
||||
</attribute>
|
||||
</markerResolutionGenerator>
|
||||
</extension>
|
||||
<!-- Rename Refactoring -->
|
||||
<extension point="org.eclipse.ui.handlers">
|
||||
<handler
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.refactoring.ui.DefaultRenameElementHandler"
|
||||
commandId="org.eclipse.xtext.ui.refactoring.RenameElement">
|
||||
<activeWhen>
|
||||
<reference
|
||||
definitionId="com.minres.rdl.RDL.Editor.opened">
|
||||
</reference>
|
||||
</activeWhen>
|
||||
</handler>
|
||||
</extension>
|
||||
<extension point="org.eclipse.ui.menus">
|
||||
<menuContribution
|
||||
locationURI="popup:#TextEditorContext?after=group.edit">
|
||||
<command commandId="org.eclipse.xtext.ui.refactoring.RenameElement"
|
||||
style="push">
|
||||
<visibleWhen checkEnabled="false">
|
||||
<reference
|
||||
definitionId="com.minres.rdl.RDL.Editor.opened">
|
||||
</reference>
|
||||
</visibleWhen>
|
||||
</command>
|
||||
</menuContribution>
|
||||
</extension>
|
||||
<extension point="org.eclipse.ui.preferencePages">
|
||||
<page
|
||||
category="com.minres.rdl.RDL"
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.refactoring.ui.RefactoringPreferencePage"
|
||||
id="com.minres.rdl.RDL.refactoring"
|
||||
name="Refactoring">
|
||||
<keywordReference id="com.minres.rdl.ui.keyword_RDL"/>
|
||||
</page>
|
||||
</extension>
|
||||
<extension point="org.eclipse.compare.contentViewers">
|
||||
<viewer id="com.minres.rdl.RDL.compare.contentViewers"
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.compare.InjectableViewerCreator"
|
||||
extensions="rdl">
|
||||
</viewer>
|
||||
<contentTypeBinding
|
||||
contentTypeId="com.minres.rdl.RDL.contenttype"
|
||||
contentViewerId="com.minres.rdl.RDL.compare.contentViewers" />
|
||||
</extension>
|
||||
<extension point="org.eclipse.compare.contentMergeViewers">
|
||||
<viewer id="com.minres.rdl.RDL.compare.contentMergeViewers"
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.compare.InjectableViewerCreator"
|
||||
extensions="rdl" label="RDL Compare">
|
||||
</viewer>
|
||||
<contentTypeBinding
|
||||
contentTypeId="com.minres.rdl.RDL.contenttype"
|
||||
contentMergeViewerId="com.minres.rdl.RDL.compare.contentMergeViewers" />
|
||||
</extension>
|
||||
<extension point="org.eclipse.ui.editors.documentProviders">
|
||||
<provider id="com.minres.rdl.RDL.editors.documentProviders"
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.model.XtextDocumentProvider"
|
||||
extensions="rdl">
|
||||
</provider>
|
||||
</extension>
|
||||
<extension point="org.eclipse.team.core.fileTypes">
|
||||
<fileTypes
|
||||
extension="rdl"
|
||||
type="text">
|
||||
</fileTypes>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.newWizards">
|
||||
<category id="com.minres.category" name="MINRES">
|
||||
</category>
|
||||
<wizard
|
||||
category="com.minres.category"
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.wizard.template.TemplateNewProjectWizard"
|
||||
id="com.minres.rdl.ui.wizard.RDLNewProjectWizard"
|
||||
name="RDL Project"
|
||||
icon="icons/new_RDL_proj.gif"
|
||||
project="true">
|
||||
</wizard>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.xtext.ui.projectTemplate">
|
||||
<projectTemplateProvider
|
||||
class="com.minres.rdl.ui.wizard.RDLProjectTemplateProvider"
|
||||
grammarName="com.minres.rdl.RDL">
|
||||
</projectTemplateProvider>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.perspectiveExtensions">
|
||||
<perspectiveExtension targetID="org.eclipse.ui.resourcePerspective">
|
||||
<newWizardShortcut id="com.minres.rdl.ui.wizard.RDLNewProjectWizard"/>
|
||||
</perspectiveExtension>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.editors">
|
||||
<editor
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.XtextEditor"
|
||||
contributorClass="org.eclipse.ui.editors.text.TextEditorActionContributor"
|
||||
default="true"
|
||||
extensions="rdl"
|
||||
id="com.minres.rdl.RDL"
|
||||
name="RDL Editor">
|
||||
</editor>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.handlers">
|
||||
<handler
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.hyperlinking.OpenDeclarationHandler"
|
||||
commandId="org.eclipse.xtext.ui.editor.hyperlinking.OpenDeclaration">
|
||||
<activeWhen>
|
||||
<reference
|
||||
definitionId="com.minres.rdl.RDL.Editor.opened">
|
||||
</reference>
|
||||
</activeWhen>
|
||||
</handler>
|
||||
<handler
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.handler.ValidateActionHandler"
|
||||
commandId="com.minres.rdl.RDL.validate">
|
||||
<activeWhen>
|
||||
<reference
|
||||
definitionId="com.minres.rdl.RDL.Editor.opened">
|
||||
</reference>
|
||||
</activeWhen>
|
||||
</handler>
|
||||
<!-- copy qualified name -->
|
||||
<handler
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.copyqualifiedname.EditorCopyQualifiedNameHandler"
|
||||
commandId="org.eclipse.xtext.ui.editor.copyqualifiedname.EditorCopyQualifiedName">
|
||||
<activeWhen>
|
||||
<reference definitionId="com.minres.rdl.RDL.Editor.opened" />
|
||||
</activeWhen>
|
||||
</handler>
|
||||
<handler
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.copyqualifiedname.OutlineCopyQualifiedNameHandler"
|
||||
commandId="org.eclipse.xtext.ui.editor.copyqualifiedname.OutlineCopyQualifiedName">
|
||||
<activeWhen>
|
||||
<and>
|
||||
<reference definitionId="com.minres.rdl.RDL.XtextEditor.opened" />
|
||||
<iterate>
|
||||
<adapt type="org.eclipse.xtext.ui.editor.outline.IOutlineNode" />
|
||||
</iterate>
|
||||
</and>
|
||||
</activeWhen>
|
||||
</handler>
|
||||
</extension>
|
||||
<extension point="org.eclipse.core.expressions.definitions">
|
||||
<definition id="com.minres.rdl.RDL.Editor.opened">
|
||||
<and>
|
||||
<reference definitionId="isActiveEditorAnInstanceOfXtextEditor"/>
|
||||
<with variable="activeEditor">
|
||||
<test property="org.eclipse.xtext.ui.editor.XtextEditor.languageName"
|
||||
value="com.minres.rdl.RDL"
|
||||
forcePluginActivation="true"/>
|
||||
</with>
|
||||
</and>
|
||||
</definition>
|
||||
<definition id="com.minres.rdl.RDL.XtextEditor.opened">
|
||||
<and>
|
||||
<reference definitionId="isXtextEditorActive"/>
|
||||
<with variable="activeEditor">
|
||||
<test property="org.eclipse.xtext.ui.editor.XtextEditor.languageName"
|
||||
value="com.minres.rdl.RDL"
|
||||
forcePluginActivation="true"/>
|
||||
</with>
|
||||
</and>
|
||||
</definition>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.preferencePages">
|
||||
<page
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.preferences.LanguageRootPreferencePage"
|
||||
id="com.minres.rdl.RDL"
|
||||
name="RDL">
|
||||
<keywordReference id="com.minres.rdl.ui.keyword_RDL"/>
|
||||
</page>
|
||||
<page
|
||||
category="com.minres.rdl.RDL"
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.syntaxcoloring.SyntaxColoringPreferencePage"
|
||||
id="com.minres.rdl.RDL.coloring"
|
||||
name="Syntax Coloring">
|
||||
<keywordReference id="com.minres.rdl.ui.keyword_RDL"/>
|
||||
</page>
|
||||
<page
|
||||
category="com.minres.rdl.RDL"
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.templates.XtextTemplatePreferencePage"
|
||||
id="com.minres.rdl.RDL.templates"
|
||||
name="Templates">
|
||||
<keywordReference id="com.minres.rdl.ui.keyword_RDL"/>
|
||||
</page>
|
||||
<page category="com.minres.rdl.RDL"
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:com.minres.rdl.ui.preferences.RdlPreferencePage"
|
||||
id="com.minres.rdl.RDL.preferences"
|
||||
name="Output Configuration">
|
||||
<keywordReference id="com.minres.rdl.ui.keyword_RDL"/>
|
||||
</page>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.propertyPages">
|
||||
<page
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.preferences.LanguageRootPreferencePage"
|
||||
id="com.minres.rdl.RDL"
|
||||
name="RDL">
|
||||
<keywordReference id="com.minres.rdl.ui.keyword_RDL"/>
|
||||
<enabledWhen>
|
||||
<adapt type="org.eclipse.core.resources.IProject"/>
|
||||
</enabledWhen>
|
||||
<filter name="projectNature" value="org.eclipse.xtext.ui.shared.xtextNature"/>
|
||||
</page>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.keywords">
|
||||
<keyword
|
||||
id="com.minres.rdl.ui.keyword_RDL"
|
||||
label="RDL"/>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.commands">
|
||||
<command
|
||||
description="Trigger expensive validation"
|
||||
id="com.minres.rdl.RDL.validate"
|
||||
name="Validate">
|
||||
</command>
|
||||
<!-- copy qualified name -->
|
||||
<command
|
||||
id="org.eclipse.xtext.ui.editor.copyqualifiedname.EditorCopyQualifiedName"
|
||||
categoryId="org.eclipse.ui.category.edit"
|
||||
description="Copy the qualified name for the selected element"
|
||||
name="Copy Qualified Name">
|
||||
</command>
|
||||
<command
|
||||
id="org.eclipse.xtext.ui.editor.copyqualifiedname.OutlineCopyQualifiedName"
|
||||
categoryId="org.eclipse.ui.category.edit"
|
||||
description="Copy the qualified name for the selected element"
|
||||
name="Copy Qualified Name">
|
||||
</command>
|
||||
</extension>
|
||||
<extension point="org.eclipse.ui.menus">
|
||||
<menuContribution
|
||||
locationURI="popup:#TextEditorContext?after=group.edit">
|
||||
<command
|
||||
commandId="com.minres.rdl.RDL.validate"
|
||||
style="push"
|
||||
tooltip="Trigger expensive validation">
|
||||
<visibleWhen checkEnabled="false">
|
||||
<reference
|
||||
definitionId="com.minres.rdl.RDL.Editor.opened">
|
||||
</reference>
|
||||
</visibleWhen>
|
||||
</command>
|
||||
</menuContribution>
|
||||
<!-- copy qualified name -->
|
||||
<menuContribution locationURI="popup:#TextEditorContext?after=copy">
|
||||
<command commandId="org.eclipse.xtext.ui.editor.copyqualifiedname.EditorCopyQualifiedName"
|
||||
style="push" tooltip="Copy Qualified Name">
|
||||
<visibleWhen checkEnabled="false">
|
||||
<reference definitionId="com.minres.rdl.RDL.Editor.opened" />
|
||||
</visibleWhen>
|
||||
</command>
|
||||
</menuContribution>
|
||||
<menuContribution locationURI="menu:edit?after=copy">
|
||||
<command commandId="org.eclipse.xtext.ui.editor.copyqualifiedname.EditorCopyQualifiedName"
|
||||
style="push" tooltip="Copy Qualified Name">
|
||||
<visibleWhen checkEnabled="false">
|
||||
<reference definitionId="com.minres.rdl.RDL.Editor.opened" />
|
||||
</visibleWhen>
|
||||
</command>
|
||||
</menuContribution>
|
||||
<menuContribution locationURI="popup:org.eclipse.xtext.ui.outline?after=additions">
|
||||
<command commandId="org.eclipse.xtext.ui.editor.copyqualifiedname.OutlineCopyQualifiedName"
|
||||
style="push" tooltip="Copy Qualified Name">
|
||||
<visibleWhen checkEnabled="false">
|
||||
<and>
|
||||
<reference definitionId="com.minres.rdl.RDL.XtextEditor.opened" />
|
||||
<iterate>
|
||||
<adapt type="org.eclipse.xtext.ui.editor.outline.IOutlineNode" />
|
||||
</iterate>
|
||||
</and>
|
||||
</visibleWhen>
|
||||
</command>
|
||||
</menuContribution>
|
||||
</extension>
|
||||
<extension point="org.eclipse.ui.menus">
|
||||
<menuContribution locationURI="popup:#TextEditorContext?endof=group.find">
|
||||
<command commandId="org.eclipse.xtext.ui.editor.FindReferences">
|
||||
<visibleWhen checkEnabled="false">
|
||||
<reference definitionId="com.minres.rdl.RDL.Editor.opened">
|
||||
</reference>
|
||||
</visibleWhen>
|
||||
</command>
|
||||
</menuContribution>
|
||||
</extension>
|
||||
<extension point="org.eclipse.ui.handlers">
|
||||
<handler
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.findrefs.FindReferencesHandler"
|
||||
commandId="org.eclipse.xtext.ui.editor.FindReferences">
|
||||
<activeWhen>
|
||||
<reference
|
||||
definitionId="com.minres.rdl.RDL.Editor.opened">
|
||||
</reference>
|
||||
</activeWhen>
|
||||
</handler>
|
||||
</extension>
|
||||
<extension point="org.eclipse.core.contenttype.contentTypes">
|
||||
<content-type
|
||||
base-type="org.eclipse.core.runtime.text"
|
||||
file-extensions="rdl"
|
||||
id="com.minres.rdl.RDL.contenttype"
|
||||
name="RDL File"
|
||||
priority="normal">
|
||||
</content-type>
|
||||
</extension>
|
||||
<!-- adding resource factories -->
|
||||
<extension
|
||||
point="org.eclipse.emf.ecore.extension_parser">
|
||||
<parser
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.resource.IResourceFactory"
|
||||
type="rdl">
|
||||
</parser>
|
||||
</extension>
|
||||
<extension point="org.eclipse.xtext.extension_resourceServiceProvider">
|
||||
<resourceServiceProvider
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.resource.IResourceUIServiceProvider"
|
||||
uriExtension="rdl">
|
||||
</resourceServiceProvider>
|
||||
</extension>
|
||||
<!-- marker definitions for com.minres.rdl.RDL -->
|
||||
<extension
|
||||
id="rdl.check.fast"
|
||||
name="RDL Problem"
|
||||
point="org.eclipse.core.resources.markers">
|
||||
<super type="org.eclipse.xtext.ui.check.fast"/>
|
||||
<persistent value="true"/>
|
||||
</extension>
|
||||
<extension
|
||||
id="rdl.check.normal"
|
||||
name="RDL Problem"
|
||||
point="org.eclipse.core.resources.markers">
|
||||
<super type="org.eclipse.xtext.ui.check.normal"/>
|
||||
<persistent value="true"/>
|
||||
</extension>
|
||||
<extension
|
||||
id="rdl.check.expensive"
|
||||
name="RDL Problem"
|
||||
point="org.eclipse.core.resources.markers">
|
||||
<super type="org.eclipse.xtext.ui.check.expensive"/>
|
||||
<persistent value="true"/>
|
||||
</extension>
|
||||
<extension point="org.eclipse.ui.preferencePages">
|
||||
<page
|
||||
category="com.minres.rdl.RDL"
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.validation.ValidatorPreferencePage"
|
||||
id="com.minres.rdl.RDL.validator.preferencePage"
|
||||
name="Errors/Warnings">
|
||||
<keywordReference id="com.minres.rdl.ui.keyword_RDL"/>
|
||||
</page>
|
||||
</extension>
|
||||
<extension point="org.eclipse.ui.preferencePages">
|
||||
<page
|
||||
category="com.minres.rdl.RDL"
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.builder.preferences.BuilderPreferencePage"
|
||||
id="com.minres.rdl.RDL.compiler.preferencePage"
|
||||
name="Compiler">
|
||||
<keywordReference id="com.minres.rdl.ui.keyword_RDL"/>
|
||||
</page>
|
||||
</extension>
|
||||
<extension point="org.eclipse.ui.propertyPages">
|
||||
<page
|
||||
category="com.minres.rdl.RDL"
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.builder.preferences.BuilderPreferencePage"
|
||||
id="com.minres.rdl.RDL.compiler.propertyPage"
|
||||
name="Compiler">
|
||||
<keywordReference id="com.minres.rdl.ui.keyword_RDL"/>
|
||||
<enabledWhen>
|
||||
<adapt type="org.eclipse.core.resources.IProject"/>
|
||||
</enabledWhen>
|
||||
<filter name="projectNature" value="org.eclipse.xtext.ui.shared.xtextNature"/>
|
||||
</page>
|
||||
</extension>
|
||||
<extension point="org.eclipse.ui.menus">
|
||||
<menuContribution locationURI="popup:#TextEditorContext?after=xtext.ui.openDeclaration">
|
||||
<command
|
||||
commandId="org.eclipse.xtext.ui.OpenGeneratedFileCommand"
|
||||
id="com.minres.rdl.RDL.OpenGeneratedCode"
|
||||
style="push">
|
||||
<visibleWhen checkEnabled="false">
|
||||
<reference definitionId="com.minres.rdl.RDL.Editor.opened" />
|
||||
</visibleWhen>
|
||||
</command>
|
||||
</menuContribution>
|
||||
</extension>
|
||||
<extension point="org.eclipse.ui.handlers">
|
||||
<handler
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.generator.trace.OpenGeneratedFileHandler"
|
||||
commandId="org.eclipse.xtext.ui.OpenGeneratedFileCommand">
|
||||
<activeWhen>
|
||||
<reference definitionId="com.minres.rdl.RDL.Editor.opened" />
|
||||
</activeWhen>
|
||||
</handler>
|
||||
</extension>
|
||||
<!-- Quick Outline -->
|
||||
<extension
|
||||
point="org.eclipse.ui.handlers">
|
||||
<handler
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.outline.quickoutline.ShowQuickOutlineActionHandler"
|
||||
commandId="org.eclipse.xtext.ui.editor.outline.QuickOutline">
|
||||
<activeWhen>
|
||||
<reference
|
||||
definitionId="com.minres.rdl.RDL.Editor.opened">
|
||||
</reference>
|
||||
</activeWhen>
|
||||
</handler>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.commands">
|
||||
<command
|
||||
description="Open the quick outline."
|
||||
id="org.eclipse.xtext.ui.editor.outline.QuickOutline"
|
||||
name="Quick Outline">
|
||||
</command>
|
||||
</extension>
|
||||
<extension point="org.eclipse.ui.menus">
|
||||
<menuContribution
|
||||
locationURI="popup:#TextEditorContext?after=group.open">
|
||||
<command commandId="org.eclipse.xtext.ui.editor.outline.QuickOutline"
|
||||
style="push"
|
||||
tooltip="Open Quick Outline">
|
||||
<visibleWhen checkEnabled="false">
|
||||
<reference definitionId="com.minres.rdl.RDL.Editor.opened"/>
|
||||
</visibleWhen>
|
||||
</command>
|
||||
</menuContribution>
|
||||
</extension>
|
||||
<!-- quickfix marker resolution generator for com.minres.rdl.RDL -->
|
||||
<extension
|
||||
point="org.eclipse.ui.ide.markerResolution">
|
||||
<markerResolutionGenerator
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.quickfix.MarkerResolutionGenerator"
|
||||
markerType="com.minres.rdl.ui.rdl.check.fast">
|
||||
<attribute
|
||||
name="FIXABLE_KEY"
|
||||
value="true">
|
||||
</attribute>
|
||||
</markerResolutionGenerator>
|
||||
<markerResolutionGenerator
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.quickfix.MarkerResolutionGenerator"
|
||||
markerType="com.minres.rdl.ui.rdl.check.normal">
|
||||
<attribute
|
||||
name="FIXABLE_KEY"
|
||||
value="true">
|
||||
</attribute>
|
||||
</markerResolutionGenerator>
|
||||
<markerResolutionGenerator
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.quickfix.MarkerResolutionGenerator"
|
||||
markerType="com.minres.rdl.ui.rdl.check.expensive">
|
||||
<attribute
|
||||
name="FIXABLE_KEY"
|
||||
value="true">
|
||||
</attribute>
|
||||
</markerResolutionGenerator>
|
||||
</extension>
|
||||
<!-- Rename Refactoring -->
|
||||
<extension point="org.eclipse.ui.handlers">
|
||||
<handler
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.refactoring.ui.DefaultRenameElementHandler"
|
||||
commandId="org.eclipse.xtext.ui.refactoring.RenameElement">
|
||||
<activeWhen>
|
||||
<reference
|
||||
definitionId="com.minres.rdl.RDL.Editor.opened">
|
||||
</reference>
|
||||
</activeWhen>
|
||||
</handler>
|
||||
</extension>
|
||||
<extension point="org.eclipse.ui.menus">
|
||||
<menuContribution
|
||||
locationURI="popup:#TextEditorContext?after=group.edit">
|
||||
<command commandId="org.eclipse.xtext.ui.refactoring.RenameElement"
|
||||
style="push">
|
||||
<visibleWhen checkEnabled="false">
|
||||
<reference
|
||||
definitionId="com.minres.rdl.RDL.Editor.opened">
|
||||
</reference>
|
||||
</visibleWhen>
|
||||
</command>
|
||||
</menuContribution>
|
||||
</extension>
|
||||
<extension point="org.eclipse.ui.preferencePages">
|
||||
<page
|
||||
category="com.minres.rdl.RDL"
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.refactoring.ui.RefactoringPreferencePage"
|
||||
id="com.minres.rdl.RDL.refactoring"
|
||||
name="Refactoring">
|
||||
<keywordReference id="com.minres.rdl.ui.keyword_RDL"/>
|
||||
</page>
|
||||
</extension>
|
||||
<extension point="org.eclipse.compare.contentViewers">
|
||||
<viewer id="com.minres.rdl.RDL.compare.contentViewers"
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.compare.InjectableViewerCreator"
|
||||
extensions="rdl">
|
||||
</viewer>
|
||||
<contentTypeBinding
|
||||
contentTypeId="com.minres.rdl.RDL.contenttype"
|
||||
contentViewerId="com.minres.rdl.RDL.compare.contentViewers" />
|
||||
</extension>
|
||||
<extension point="org.eclipse.compare.contentMergeViewers">
|
||||
<viewer id="com.minres.rdl.RDL.compare.contentMergeViewers"
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.compare.InjectableViewerCreator"
|
||||
extensions="rdl" label="RDL Compare">
|
||||
</viewer>
|
||||
<contentTypeBinding
|
||||
contentTypeId="com.minres.rdl.RDL.contenttype"
|
||||
contentMergeViewerId="com.minres.rdl.RDL.compare.contentMergeViewers" />
|
||||
</extension>
|
||||
<extension point="org.eclipse.ui.editors.documentProviders">
|
||||
<provider id="com.minres.rdl.RDL.editors.documentProviders"
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.editor.model.XtextDocumentProvider"
|
||||
extensions="rdl">
|
||||
</provider>
|
||||
</extension>
|
||||
<extension point="org.eclipse.team.core.fileTypes">
|
||||
<fileTypes
|
||||
extension="rdl"
|
||||
type="text">
|
||||
</fileTypes>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.newWizards">
|
||||
<category id="com.minres.category" name="MINRES">
|
||||
</category>
|
||||
<wizard
|
||||
category="com.minres.category"
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.ui.wizard.template.TemplateNewProjectWizard"
|
||||
id="com.minres.rdl.ui.wizard.RDLNewProjectWizard"
|
||||
name="RDL Project"
|
||||
icon="icons/new_RDL_proj.gif"
|
||||
project="true">
|
||||
</wizard>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.xtext.ui.projectTemplate">
|
||||
<projectTemplateProvider
|
||||
class="com.minres.rdl.ui.wizard.RDLProjectTemplateProvider"
|
||||
grammarName="com.minres.rdl.RDL">
|
||||
</projectTemplateProvider>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.perspectiveExtensions">
|
||||
<perspectiveExtension targetID="org.eclipse.ui.resourcePerspective">
|
||||
<newWizardShortcut id="com.minres.rdl.ui.wizard.RDLNewProjectWizard"/>
|
||||
</perspectiveExtension>
|
||||
</extension>
|
||||
<!-- <extension point="org.eclipse.xtext.builder.participant">
|
||||
<participant
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:org.eclipse.xtext.builder.IXtextBuilderParticipant"
|
||||
fileExtensions="rdl"/>
|
||||
</extension>-->
|
||||
<extension
|
||||
point="org.eclipse.ui.handlers">
|
||||
<handler
|
||||
class="com.minres.rdl.ui.RDLExecutableExtensionFactory:com.minres.rdl.ui.builder.GenerationHandler"
|
||||
commandId="com.minres.rdl.ui.handler.GenerationCommand">
|
||||
</handler>
|
||||
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.commands">
|
||||
<command name="Generate Code from RDL"
|
||||
id="com.minres.rdl.ui.handler.GenerationCommand">
|
||||
</command>
|
||||
</extension>
|
||||
<extension point="org.eclipse.ui.menus">
|
||||
<menuContribution locationURI="popup:org.eclipse.ui.navigator.ProjectExplorer#PopupMenu">
|
||||
<command
|
||||
commandId="com.minres.rdl.ui.handler.GenerationCommand"
|
||||
style="push">
|
||||
<visibleWhen
|
||||
checkEnabled="false">
|
||||
<iterate>
|
||||
<adapt type="org.eclipse.core.resources.IResource">
|
||||
<test property="org.eclipse.core.resources.name"
|
||||
value="*.rdl"/>
|
||||
</adapt>
|
||||
</iterate>
|
||||
</visibleWhen>
|
||||
</command>
|
||||
</menuContribution>
|
||||
</extension>
|
||||
<extension point="org.eclipse.ui.menus">
|
||||
<menuContribution locationURI="popup:#TextEditorContext?after=additions">
|
||||
<command
|
||||
commandId="com.minres.rdl.ui.handler.GenerationCommand"
|
||||
style="push">
|
||||
<visibleWhen checkEnabled="false">
|
||||
<reference
|
||||
definitionId="com.minres.rdl.RDL.Editor.opened">
|
||||
</reference>
|
||||
</visibleWhen>
|
||||
</command>
|
||||
</menuContribution>
|
||||
</extension>
|
||||
</plugin>
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
*/
|
||||
package com.minres.rdl.ui
|
||||
|
||||
import com.minres.structural.ui.hyperlink.MyHyperlinkHelper
|
||||
import com.minres.structural.ui.hyperlink.MyXtextHyperlink
|
||||
import com.minres.rdl.ui.hyperlink.RdlHyperlinkHelper
|
||||
import com.minres.rdl.ui.hyperlink.RdlXtextHyperlink
|
||||
import org.eclipse.xtend.lib.annotations.FinalFieldsConstructor
|
||||
import org.eclipse.xtext.documentation.IEObjectDocumentationProvider
|
||||
import org.eclipse.xtext.ui.editor.hover.IEObjectHoverProvider
|
||||
|
@ -36,11 +36,11 @@ class RDLUiModule extends AbstractRDLUiModule {
|
|||
}
|
||||
|
||||
def Class<? extends HyperlinkHelper> bindHyperlinkHelper() {
|
||||
return MyHyperlinkHelper
|
||||
return RdlHyperlinkHelper
|
||||
}
|
||||
|
||||
def Class<? extends XtextHyperlink> bindHyperlink() {
|
||||
return MyXtextHyperlink
|
||||
return RdlXtextHyperlink
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,134 @@
|
|||
package com.minres.rdl.ui.builder;
|
||||
|
||||
|
||||
import org.eclipse.core.commands.AbstractHandler;
|
||||
import org.eclipse.core.commands.ExecutionEvent;
|
||||
import org.eclipse.core.commands.IHandler;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IFolder;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
|
||||
import org.eclipse.core.runtime.preferences.InstanceScope;
|
||||
import org.eclipse.emf.common.util.URI;
|
||||
import org.eclipse.emf.ecore.resource.Resource;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.ui.IEditorPart;
|
||||
import org.eclipse.ui.IWorkbenchPart;
|
||||
import org.eclipse.ui.handlers.HandlerUtil;
|
||||
import org.eclipse.xtext.builder.EclipseResourceFileSystemAccess2;
|
||||
import org.eclipse.xtext.generator.IGenerator2;
|
||||
import org.eclipse.xtext.resource.IResourceDescriptions;
|
||||
import org.eclipse.xtext.resource.XtextResource;
|
||||
import org.eclipse.xtext.ui.editor.XtextEditor;
|
||||
import org.eclipse.xtext.ui.resource.IResourceSetProvider;
|
||||
import org.eclipse.xtext.util.CancelIndicator;
|
||||
import org.eclipse.xtext.util.concurrent.IUnitOfWork;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.Provider;
|
||||
import com.minres.rdl.generator.RdlGeneratorContext;
|
||||
import com.minres.rdl.preferences.PreferenceConstants;
|
||||
|
||||
public class GenerationHandler extends AbstractHandler implements IHandler {
|
||||
|
||||
@Inject
|
||||
private IGenerator2 generator;
|
||||
|
||||
@Inject
|
||||
private Provider<EclipseResourceFileSystemAccess2> fileAccessProvider;
|
||||
|
||||
@Inject
|
||||
IResourceDescriptions resourceDescriptions;
|
||||
|
||||
@Inject
|
||||
IResourceSetProvider resourceSetProvider;
|
||||
|
||||
IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode(PreferenceConstants.SCOPE_NAME);
|
||||
|
||||
@Override
|
||||
public Object execute(ExecutionEvent event) {
|
||||
RdlGeneratorContext context = new RdlGeneratorContext();
|
||||
context.cancelIndicator = CancelIndicator.NullImpl;
|
||||
context.namespace = preferences.get(PreferenceConstants.P_NAMESPACE, "sysc");
|
||||
context.forceOverwrite=preferences.getBoolean(PreferenceConstants.P_OVERWRITE_STUBS, false);
|
||||
String whatToGenerate = preferences.get(PreferenceConstants.P_FILETYPES_TO_GENERATE, "all");
|
||||
if(whatToGenerate=="sc-comp") {
|
||||
context.generateFw=false;
|
||||
} else if(whatToGenerate=="fw") {
|
||||
context.generateSc=false;
|
||||
}
|
||||
context.forceOverwrite=preferences.getBoolean(PreferenceConstants.P_OVERWRITE_STUBS, false);
|
||||
context.fwPathModifier=preferences.get(PreferenceConstants.P_FIRMWARE_PATH, "");
|
||||
context.scPathModifier=preferences.get(PreferenceConstants.P_COMPONENT_PATH, "");
|
||||
|
||||
String outputDir = preferences.get("outlet.DEFAULT_OUTPUT.directory", "src-gen");
|
||||
IEditorPart activeEditor = HandlerUtil.getActiveEditor(event);
|
||||
IWorkbenchPart activePart = HandlerUtil.getActivePart(event);
|
||||
if (activeEditor instanceof XtextEditor && activeEditor == activePart) {
|
||||
IFile file = (IFile) activeEditor.getEditorInput().getAdapter(IFile.class);
|
||||
if (file != null) {
|
||||
final EclipseResourceFileSystemAccess2 fsa = getFsa(outputDir, file, context.fwPathModifier, context.scPathModifier);
|
||||
((XtextEditor)activeEditor).getDocument().readOnly(new IUnitOfWork<Boolean, XtextResource>() {
|
||||
@Override
|
||||
public Boolean exec(XtextResource state) throws Exception {
|
||||
generator.doGenerate(state, fsa, context);
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
ISelection selection = HandlerUtil.getCurrentSelection(event);
|
||||
if (selection instanceof IStructuredSelection) {
|
||||
IStructuredSelection structuredSelection = (IStructuredSelection) selection;
|
||||
for (Object element : structuredSelection) {
|
||||
if (element instanceof IFile) {
|
||||
IFile file = (IFile) element;
|
||||
final EclipseResourceFileSystemAccess2 fsa = getFsa(outputDir, file, context.fwPathModifier, context.scPathModifier);
|
||||
URI uri = URI.createPlatformResourceURI(file.getFullPath().toString(), true);
|
||||
Resource r = resourceSetProvider.get(file.getProject()).getResource(uri, true);
|
||||
try {
|
||||
generator.doGenerate(r, fsa, context);
|
||||
} finally {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private EclipseResourceFileSystemAccess2 getFsa(String outputDir, IFile file, String fwPath, String scPath) {
|
||||
IProject project = file.getProject();
|
||||
IFolder srcGenFolder = project.getFolder(outputDir);
|
||||
createIfNotExists(srcGenFolder);
|
||||
if(fwPath.length()>0) createIfNotExists(srcGenFolder.getFolder(fwPath));
|
||||
if(scPath.length()>0) createIfNotExists(srcGenFolder.getFolder(scPath));
|
||||
final EclipseResourceFileSystemAccess2 fsa = fileAccessProvider.get();
|
||||
fsa.setOutputPath("src-gen");
|
||||
String scGenFolderPath = (fwPath.length()>0? srcGenFolder.getFolder(scPath) : srcGenFolder).getProjectRelativePath().toString();
|
||||
fsa.setOutputPath("sc-incl-out", scGenFolderPath);
|
||||
fsa.setOutputPath("sc-src-out", scGenFolderPath);
|
||||
String fwGenFolderPath = (fwPath.length()>0? srcGenFolder.getFolder(fwPath) : srcGenFolder).getProjectRelativePath().toString();
|
||||
fsa.setOutputPath("fw-incl-out", fwGenFolderPath);
|
||||
fsa.setOutputPath("fw-src-out", fwGenFolderPath);
|
||||
fsa.setProject(project);
|
||||
fsa.setMonitor(new NullProgressMonitor());
|
||||
return fsa;
|
||||
}
|
||||
|
||||
private void createIfNotExists(IFolder srcGenFolder) {
|
||||
if (!srcGenFolder.exists()) {
|
||||
try {
|
||||
srcGenFolder.create(true, true, new NullProgressMonitor());
|
||||
} catch (CoreException e) { }
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabled() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package com.minres.structural.ui.hyperlink
|
||||
package com.minres.rdl.ui.hyperlink
|
||||
|
||||
import com.google.inject.Inject
|
||||
import org.eclipse.emf.common.util.URI
|
||||
|
@ -13,7 +13,7 @@ import org.eclipse.xtext.ui.editor.hyperlinking.IHyperlinkAcceptor
|
|||
import org.eclipse.xtext.util.TextRegion
|
||||
import org.eclipse.jface.text.IRegion
|
||||
|
||||
class MyHyperlinkHelper extends HyperlinkHelper {
|
||||
class RdlHyperlinkHelper extends HyperlinkHelper {
|
||||
|
||||
@Inject ImportUriResolver resolver;
|
||||
|
||||
|
@ -37,7 +37,7 @@ class MyHyperlinkHelper extends HyperlinkHelper {
|
|||
result.setHyperlinkRegion(new Region(textRegion.getOffset(), textRegion.getLength()) as IRegion);
|
||||
result.setURI(if(uri.isPlatformResource()) uri else resource.getResourceSet().getURIConverter().normalize(uri));
|
||||
result.setHyperlinkText(labelProvider.getText(top));
|
||||
if(result instanceof MyXtextHyperlink) result.selectTarget=false
|
||||
if(result instanceof RdlXtextHyperlink) result.selectTarget=false
|
||||
acceptor.accept(result);
|
||||
}
|
||||
}
|
|
@ -1,10 +1,10 @@
|
|||
package com.minres.structural.ui.hyperlink
|
||||
package com.minres.rdl.ui.hyperlink
|
||||
|
||||
import com.google.inject.Inject
|
||||
import org.eclipse.xtext.ui.editor.IURIEditorOpener
|
||||
import org.eclipse.xtext.ui.editor.hyperlinking.XtextHyperlink
|
||||
|
||||
class MyXtextHyperlink extends XtextHyperlink {
|
||||
class RdlXtextHyperlink extends XtextHyperlink {
|
||||
|
||||
var boolean select = true
|
||||
|
|
@ -8,6 +8,7 @@ import com.minres.rdl.preferences.PreferenceConstants
|
|||
import org.eclipse.ui.preferences.ScopedPreferenceStore
|
||||
import org.eclipse.core.runtime.preferences.InstanceScope
|
||||
import org.eclipse.jface.preference.ComboFieldEditor
|
||||
import org.eclipse.jface.preference.StringFieldEditor
|
||||
|
||||
class RdlPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
|
||||
|
||||
|
@ -21,6 +22,12 @@ class RdlPreferencePage extends FieldEditorPreferencePage implements IWorkbenchP
|
|||
override createFieldEditors() {
|
||||
addField(new BooleanFieldEditor(PreferenceConstants.P_GENERATE_CSV, "Generate CSV:", getFieldEditorParent()));
|
||||
addField(new ComboFieldEditor(PreferenceConstants.P_ADDRESSUNIT, "Address unit size", #[#["Byte (8bit)","byte"], #["Word (16bit)","word"], #["DWord (32bit)","dword"]], getFieldEditorParent()))
|
||||
addField(new StringFieldEditor(PreferenceConstants.P_NAMESPACE, "Namespace of generated SystemC", 30, getFieldEditorParent()))
|
||||
addField(new BooleanFieldEditor(PreferenceConstants.P_OVERWRITE_STUBS, "Always overwrite component stubs", getFieldEditorParent()));
|
||||
addField(new ComboFieldEditor(PreferenceConstants.P_FILETYPES_TO_GENERATE, "File types to generate", #[#["All","all"], #["FW only","fw"], #["SC components","sc-comp"]], getFieldEditorParent()))
|
||||
addField(new StringFieldEditor(PreferenceConstants.P_COMPONENT_PATH, "relative path for SystemC files", 30, getFieldEditorParent()))
|
||||
addField(new StringFieldEditor(PreferenceConstants.P_FIRMWARE_PATH, "relative path for FW files", 30, getFieldEditorParent()))
|
||||
addField(new StringFieldEditor(PreferenceConstants.P_COPYRIGHT_HEADER, "Copyright header", 40, 5, StringFieldEditor.VALIDATE_ON_KEY_STROKE, getFieldEditorParent()))
|
||||
}
|
||||
|
||||
override init(IWorkbench workbench) {
|
||||
|
|
|
@ -14,7 +14,7 @@ public class Messages extends NLS {
|
|||
// initialize resource bundle
|
||||
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
|
||||
}
|
||||
|
||||
|
||||
private Messages() {
|
||||
}
|
||||
}
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -26,4 +26,11 @@ class RDLRuntimeModule extends AbstractRDLRuntimeModule {
|
|||
//return typeof(ResourceSetGlobalScopeProvider)
|
||||
return typeof(org.eclipse.xtext.scoping.impl.ImportUriGlobalScopeProvider)
|
||||
}
|
||||
// def Class<? extends IGeneratorConfiguration> bindIGeneratorConfiguration() {
|
||||
// return GeneratorConfiguration;
|
||||
// }
|
||||
// def IGeneratorConfiguration bindIGeneratorConfiguration() {
|
||||
// return new GeneratorConfiguration();
|
||||
// }
|
||||
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.minres.rdl.rdl.ComponentDefinition
|
|||
import com.minres.rdl.rdl.ComponentDefinitionType
|
||||
|
||||
import static extension com.minres.rdl.RdlUtil.*
|
||||
import java.util.Date
|
||||
|
||||
class AddrmapGenerator extends RdlBaseGenerator {
|
||||
|
||||
|
@ -18,8 +19,18 @@ class AddrmapGenerator extends RdlBaseGenerator {
|
|||
}
|
||||
|
||||
override generateHeader(String namespace) {'''
|
||||
#ifndef _«componentDefinition.effectiveName.toUpperCase»_MAP_H_
|
||||
#define _«componentDefinition.effectiveName.toUpperCase»_MAP_H_
|
||||
/*
|
||||
* Copyright (c) 2019 -2022 MINRES Technologies GmbH
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Created on: «new Date»
|
||||
* * «componentDefinition.effectiveName».h Author: <RDL Generator>
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
// need double braces, see https://stackoverflow.com/questions/6893700/how-to-construct-stdarray-object-with-initializer-list#6894191
|
||||
const std::array<scc::target_memory_map_entry<32>, «componentDefinition.instanceCount(ComponentDefinitionType.REGFILE)»> «componentDefinition.effectiveName»_map = {{
|
||||
«FOR instantiation : componentDefinition.instantiationsOfType(ComponentDefinitionType.REGFILE)»
|
||||
|
|
|
@ -21,43 +21,17 @@ class FwAddrmapGenerator extends RdlBaseGenerator {
|
|||
}
|
||||
|
||||
override generateHeader(String namespace) {'''
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2020-2022, MINRES Technologies GmbH
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// and/or other materials provided with the distribution.
|
||||
//
|
||||
// 3. Neither the name of the copyright holder nor the names of its contributors
|
||||
// may be used to endorse or promote products derived from this software
|
||||
// without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// Created on: «new Date»
|
||||
// * «componentDefinition.name».h Author: <RDL Generator>
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/*
|
||||
* Copyright (c) 2019 -2022 MINRES Technologies GmbH
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Created on: «new Date»
|
||||
* * «componentDefinition.effectiveName».h Author: <RDL Generator>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _«componentDefinition.effectiveName.toUpperCase»_MAP_H_
|
||||
#define _«componentDefinition.effectiveName.toUpperCase»_MAP_H_
|
||||
#pragma once
|
||||
|
||||
«FOR instantiation : componentDefinition.instantiationsOfType(ComponentDefinitionType.REGFILE)»
|
||||
«IF instantiation.component !== null && !nameMap.contains(instantiation.component.name)»
|
||||
|
|
|
@ -22,43 +22,17 @@ class FwRegfileGenerator extends RdlBaseGenerator{
|
|||
}
|
||||
|
||||
override String generateHeader(String namespace)'''
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2020-2022, MINRES Technologies GmbH
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// and/or other materials provided with the distribution.
|
||||
//
|
||||
// 3. Neither the name of the copyright holder nor the names of its contributors
|
||||
// may be used to endorse or promote products derived from this software
|
||||
// without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// Created on: «new Date»
|
||||
// * «componentDefinition.name».h Author: <RDL Generator>
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/*
|
||||
* Copyright (c) 2019 -2022 MINRES Technologies GmbH
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Created on: «new Date»
|
||||
* * «componentDefinition.effectiveName».h Author: <RDL Generator>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _«componentDefinition.name.toUpperCase»_H_
|
||||
#define _«componentDefinition.name.toUpperCase»_H_
|
||||
#pragma once
|
||||
|
||||
#include <util/bit_field.h>
|
||||
#include <nonstd/span.hpp>
|
||||
|
|
|
@ -23,7 +23,9 @@ import java.io.File
|
|||
|
||||
class Main {
|
||||
|
||||
val USAGE_STR = "RDL2code [-h] [-v] [-f] [-n <namespace>] [-I <RDL include dir] [-o <output dir>] <input file> <input file>";
|
||||
val USAGE_STR = '''
|
||||
RDL2code [-h] [-v] [-f] [-fw] [-sc [-n <namespace>]] [-I <RDL include dir] [-o <output dir>] <input file> <input file>
|
||||
'''
|
||||
|
||||
def static main(String[] args) {
|
||||
if (args.empty) {
|
||||
|
@ -56,50 +58,53 @@ class Main {
|
|||
@Inject JavaIoFileSystemAccess fileAccess
|
||||
|
||||
def run(String[] args) {
|
||||
|
||||
val opt = new Options(args, 0, Integer.MAX_VALUE);
|
||||
opt.getSet().addOption("h", Multiplicity.ZERO_OR_ONE);
|
||||
opt.getSet().addOption("v", Multiplicity.ZERO_OR_ONE);
|
||||
opt.getSet().addOption("f", Multiplicity.ZERO_OR_ONE);
|
||||
opt.getSet().addOption("n", Separator.BLANK, Multiplicity.ZERO_OR_ONE);
|
||||
opt.getSet().addOption("o", Separator.BLANK, Multiplicity.ZERO_OR_ONE);
|
||||
opt.getSet().addOption("I", Separator.BLANK, Multiplicity.ZERO_OR_ONE);
|
||||
val optionSet = opt.getSet()
|
||||
optionSet.addOption("h", Multiplicity.ZERO_OR_ONE);
|
||||
optionSet.addOption("v", Multiplicity.ZERO_OR_ONE);
|
||||
optionSet.addOption("f", Multiplicity.ZERO_OR_ONE);
|
||||
optionSet.addOption("n", Separator.BLANK, Multiplicity.ZERO_OR_ONE);
|
||||
optionSet.addOption("o", Separator.BLANK, Multiplicity.ZERO_OR_ONE);
|
||||
optionSet.addOption("I", Separator.BLANK, Multiplicity.ZERO_OR_ONE);
|
||||
optionSet.addOption("fw", Multiplicity.ZERO_OR_ONE);
|
||||
optionSet.addOption("sc", Multiplicity.ZERO_OR_ONE);
|
||||
optionSet.addOption("sc-dir", Separator.BLANK, Multiplicity.ZERO_OR_ONE);
|
||||
optionSet.addOption("fw-dir", Separator.BLANK, Multiplicity.ZERO_OR_ONE);
|
||||
if (!opt.check(false, false)) { // Print usage hints
|
||||
System.err.println("Usage is: " + USAGE_STR);
|
||||
throw new MalformedParametersException(opt.getCheckErrors());
|
||||
}
|
||||
// Normal processing
|
||||
if (opt.getSet().isSet("h")) {
|
||||
if (optionSet.isSet("h")) {
|
||||
println("Usage: " + USAGE_STR);
|
||||
return
|
||||
}
|
||||
val verbose = if(opt.getSet().isSet("v")) true else false;
|
||||
val verbose = if(optionSet.isSet("v")) true else false;
|
||||
val setup = new StandaloneSetup()
|
||||
if (opt.getSet().isSet("I")) {
|
||||
if (optionSet.isSet("I")) {
|
||||
val projectMapping = new ProjectMapping
|
||||
projectMapping.projectName = "RDL Repository"
|
||||
projectMapping.path = new File(opt.getSet().getOption("I").getResultValue(0)).canonicalFile.absolutePath
|
||||
projectMapping.path = new File(optionSet.getOption("I").getResultValue(0)).canonicalFile.absolutePath
|
||||
setup.addProjectMapping(projectMapping)
|
||||
}
|
||||
// Configure and start the generator
|
||||
fileAccess.outputPath = 'src-gen/'
|
||||
if(opt.getSet().isSet('o')){
|
||||
fileAccess.outputPath = opt.getSet().getOption('o').getResultValue(0)
|
||||
if(optionSet.isSet('o')){
|
||||
fileAccess.outputPath = optionSet.getOption('o').getResultValue(0)
|
||||
fileAccess.outputConfigurations.get(IFileSystemAccess.DEFAULT_OUTPUT)?.setOverrideExistingResources(true)
|
||||
}
|
||||
// #{'incl-out' -> false, 'src-out' -> false, 'gen-out' -> true}.forEach[p1, p2|
|
||||
// if(opt.getSet().isSet(p1.substring(0, 1)))
|
||||
// fileAccess.setOutputPath(p1, opt.getSet().getOption(p1.substring(0, 1)).getResultValue(0)+'/')
|
||||
// else
|
||||
// fileAccess.setOutputPath(p1, 'src-gen/')
|
||||
// fileAccess.outputConfigurations.get(p1)?.setOverrideExistingResources(p2)
|
||||
// ]
|
||||
opt.getSet().getData().forEach [ String string |
|
||||
if(verbose) println("Processing " + string);
|
||||
val context = new RdlGeneratorContext => [cancelIndicator = CancelIndicator.NullImpl]
|
||||
context.forceOverwrite= optionSet.isSet('f')
|
||||
if(optionSet.isSet('n'))
|
||||
context.namespace=optionSet.getOption('n').getResultValue(0)
|
||||
context.generateFw=optionSet.isSet('fw')
|
||||
context.generateSc=optionSet.isSet('sc')
|
||||
optionSet.getData().forEach [ String fileName |
|
||||
if(verbose) println("Processing " + fileName);
|
||||
// Load the resource
|
||||
val resourceSet = resourceSetProvider.get as XtextResourceSet
|
||||
resourceSet.addLoadOption(XtextResource.OPTION_RESOLVE_ALL, Boolean.TRUE);
|
||||
val resource = resourceSet.getResource(URI.createFileURI(string), true)
|
||||
val resource = resourceSet.getResource(URI.createFileURI(fileName), true)
|
||||
// Validate the resource
|
||||
val issues = validator.validate(resource, CheckMode.ALL, CancelIndicator.NullImpl)
|
||||
if (!issues.empty) {
|
||||
|
@ -107,22 +112,10 @@ class Main {
|
|||
issues.forEach[System.err.println(it)]
|
||||
throw new ParseException("error validating " + resource.URI, issues.size)
|
||||
}
|
||||
|
||||
val context = new RdlGeneratorContext => [cancelIndicator = CancelIndicator.NullImpl]
|
||||
context.forceOverwrite= opt.getSet().isSet('f')
|
||||
if(opt.getSet().isSet('n'))
|
||||
context.namespace=opt.getSet().getOption('n').getResultValue(0)
|
||||
generator.generate(resource, fileAccess, context)
|
||||
|
||||
if(verbose) println('Code generation for ' + string + ' finished')
|
||||
try {
|
||||
if(verbose) println('includes are in ' + fileAccess.getURI('', 'incl-out'))
|
||||
} catch (Exception e) {
|
||||
if(verbose) {
|
||||
println('Code generation for ' + fileName + ' finished')
|
||||
println('includes are in ' + fileAccess.getURI(''))
|
||||
}
|
||||
try {
|
||||
if(verbose) println('sources are in ' + fileAccess.getURI('', 'src-out'))
|
||||
} catch (Exception e) {
|
||||
println('sources are in ' + fileAccess.getURI(''))
|
||||
}
|
||||
]
|
||||
|
|
|
@ -1,58 +0,0 @@
|
|||
/*
|
||||
* generated by Xtext 2.14.0
|
||||
*/
|
||||
package com.minres.rdl.generator
|
||||
|
||||
import com.google.inject.Inject
|
||||
import com.google.inject.Provider
|
||||
import com.minres.rdl.RDLStandaloneSetup
|
||||
import org.eclipse.emf.common.util.URI
|
||||
import org.eclipse.emf.ecore.resource.ResourceSet
|
||||
import org.eclipse.xtext.generator.GeneratorContext
|
||||
import org.eclipse.xtext.generator.GeneratorDelegate
|
||||
import org.eclipse.xtext.generator.JavaIoFileSystemAccess
|
||||
import org.eclipse.xtext.util.CancelIndicator
|
||||
import org.eclipse.xtext.validation.CheckMode
|
||||
import org.eclipse.xtext.validation.IResourceValidator
|
||||
|
||||
class Main {
|
||||
|
||||
def static main(String[] args) {
|
||||
if (args.empty) {
|
||||
System::err.println('Aborting: no path to EMF resource provided!')
|
||||
return
|
||||
}
|
||||
val injector = new RDLStandaloneSetup().createInjectorAndDoEMFRegistration
|
||||
val main = injector.getInstance(Main)
|
||||
main.runGenerator(args.get(0))
|
||||
}
|
||||
|
||||
@Inject Provider<ResourceSet> resourceSetProvider
|
||||
|
||||
@Inject IResourceValidator validator
|
||||
|
||||
@Inject GeneratorDelegate generator
|
||||
|
||||
@Inject JavaIoFileSystemAccess fileAccess
|
||||
|
||||
def protected runGenerator(String string) {
|
||||
// Load the resource
|
||||
val set = resourceSetProvider.get
|
||||
val resource = set.getResource(URI.createFileURI(string), true)
|
||||
|
||||
// Validate the resource
|
||||
val issues = validator.validate(resource, CheckMode.ALL, CancelIndicator.NullImpl)
|
||||
if (!issues.empty) {
|
||||
issues.forEach[System.err.println(it)]
|
||||
return
|
||||
}
|
||||
|
||||
// Configure and start the generator
|
||||
fileAccess.outputPath = 'src-gen/'
|
||||
val context = new GeneratorContext => [
|
||||
cancelIndicator = CancelIndicator.NullImpl
|
||||
]
|
||||
generator.generate(resource, fileAccess, context)
|
||||
System.out.println('Code generation finished.')
|
||||
}
|
||||
}
|
|
@ -6,7 +6,6 @@ import com.minres.rdl.rdl.ComponentDefinitionType
|
|||
import static extension com.minres.rdl.RdlUtil.*
|
||||
import com.minres.rdl.rdl.ExplicitPropertyAssignment
|
||||
import com.minres.rdl.rdl.PropertyEnum
|
||||
import com.minres.rdl.services.RDLGrammarAccess.PropertyRvalueConstantElements
|
||||
import com.minres.rdl.rdl.RValueConstant
|
||||
|
||||
class ModuleGenerator extends RdlBaseGenerator {
|
||||
|
@ -23,12 +22,12 @@ class ModuleGenerator extends RdlBaseGenerator {
|
|||
|
||||
override generateHeader(String namespace){
|
||||
if(componentDefinition.type!=ComponentDefinitionType.REGFILE) return ''
|
||||
val addrMaps = componentDefinition.eResource.resourceSet.allContents
|
||||
.filter[ it instanceof ComponentDefinition]
|
||||
.map[it as ComponentDefinition]
|
||||
.filter[it.type == ComponentDefinitionType.ADDRMAP]
|
||||
.filter[def | def.instantiations.filter[it.componentRef==componentDefinition].size>0]
|
||||
if(addrMaps.size==0) return ''
|
||||
// val addrMaps = componentDefinition.eResource.resourceSet.allContents
|
||||
// .filter[ it instanceof ComponentDefinition]
|
||||
// .map[it as ComponentDefinition]
|
||||
// .filter[it.type == ComponentDefinitionType.ADDRMAP]
|
||||
// .filter[def | def.instantiations.filter[it.componentRef==componentDefinition].size>0]
|
||||
// if(addrMaps.size==0) return ''
|
||||
'''
|
||||
/*
|
||||
* Copyright (c) 2019 -2022 MINRES Technologies GmbH
|
||||
|
@ -36,11 +35,13 @@ class ModuleGenerator extends RdlBaseGenerator {
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef _«namespace.toUpperCase»_«componentDefinition.effectiveName.toUpperCase»_H_
|
||||
#define _«namespace.toUpperCase»_«componentDefinition.effectiveName.toUpperCase»_H_
|
||||
#pragma once
|
||||
|
||||
#include <scc/tlm_target.h>
|
||||
|
||||
namespace «namespace» {
|
||||
«FOR ns : namespace.split('::')»
|
||||
namespace «ns» {
|
||||
«ENDFOR»
|
||||
namespace gen {
|
||||
class «componentDefinition.effectiveName»_regs;
|
||||
}
|
||||
|
@ -59,7 +60,9 @@ class ModuleGenerator extends RdlBaseGenerator {
|
|||
std::unique_ptr<gen::«componentDefinition.effectiveName»_regs> regs;
|
||||
};
|
||||
|
||||
} /* namespace «namespace» */
|
||||
«FOR ns : namespace.split('::').reverse»
|
||||
} // namespace «ns»
|
||||
«ENDFOR»
|
||||
|
||||
#endif /* _«namespace.toUpperCase»_«componentDefinition.effectiveName.toUpperCase»_H_ */
|
||||
'''
|
||||
|
@ -67,12 +70,12 @@ class ModuleGenerator extends RdlBaseGenerator {
|
|||
|
||||
override generateSource(String namespace) {
|
||||
if(componentDefinition.type!=ComponentDefinitionType.REGFILE) return ''
|
||||
val addrMaps = componentDefinition.eResource.resourceSet.allContents
|
||||
.filter[ it instanceof ComponentDefinition]
|
||||
.map[it as ComponentDefinition]
|
||||
.filter[it.type == ComponentDefinitionType.ADDRMAP]
|
||||
.filter[def | def.instantiations.filter[it.componentRef==componentDefinition].size>0]
|
||||
if(addrMaps.size==0) return ''
|
||||
// val addrMaps = componentDefinition.eResource.resourceSet.allContents
|
||||
// .filter[ it instanceof ComponentDefinition]
|
||||
// .map[it as ComponentDefinition]
|
||||
// .filter[it.type == ComponentDefinitionType.ADDRMAP]
|
||||
// .filter[def | def.instantiations.filter[it.componentRef==componentDefinition].size>0]
|
||||
// if(addrMaps.size==0) return ''
|
||||
'''
|
||||
/*
|
||||
* Copyright (c) 2019 -2022 MINRES Technologies GmbH
|
||||
|
@ -85,7 +88,9 @@ class ModuleGenerator extends RdlBaseGenerator {
|
|||
|
||||
#include <scc/utilities.h>
|
||||
|
||||
namespace «namespace» {
|
||||
«FOR ns : namespace.split('::')»
|
||||
namespace «ns» {
|
||||
«ENDFOR»
|
||||
SC_HAS_PROCESS(«componentDefinition.effectiveName»);// NOLINT
|
||||
|
||||
«componentDefinition.effectiveName»::«componentDefinition.effectiveName»(sc_core::sc_module_name nm)
|
||||
|
@ -120,7 +125,9 @@ class ModuleGenerator extends RdlBaseGenerator {
|
|||
}
|
||||
}
|
||||
|
||||
} /* namespace «namespace» */
|
||||
«FOR ns : namespace.split('::').reverse»
|
||||
} // namespace «ns»
|
||||
«ENDFOR»
|
||||
'''
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.minres.rdl.generator;
|
||||
|
||||
/**
|
||||
* see also https://www.infoworld.com/article/2074849/processing-command-line-arguments-in-java--case-closed.html
|
||||
* The central class for option processing. Sets are identified by their name, but there is also
|
||||
* an anonymous default set, which is very convenient if an application requieres only one set.
|
||||
*/
|
||||
|
|
|
@ -12,28 +12,28 @@ import org.eclipse.xtext.generator.IGeneratorContext
|
|||
import static extension com.minres.rdl.RdlUtil.*
|
||||
import java.util.Map
|
||||
|
||||
/**
|
||||
* Generates code from your model files on save.
|
||||
*
|
||||
* See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#code-generation
|
||||
*/
|
||||
class RDLGenerator extends AbstractGenerator {
|
||||
override void doGenerate(Resource resource, IFileSystemAccess2 fsa, IGeneratorContext context) {
|
||||
val force = if(context instanceof RdlGeneratorContext) context.forceOverwrite else false
|
||||
val namespace = if(context instanceof RdlGeneratorContext) context.namespace else "sysc"
|
||||
val genFW = if(context instanceof RdlGeneratorContext) context.generateFw else true
|
||||
val genSC = if(context instanceof RdlGeneratorContext) context.generateSc else true
|
||||
resource.resourceSet.allContents.filter[ it instanceof ComponentDefinition].map[it as ComponentDefinition].forEach[
|
||||
val genMap = it.fileGenerator
|
||||
if(genMap!==null) genMap.forEach[p1, gen |
|
||||
val header = gen.generateHeader(namespace)
|
||||
val inclFileName = p1+'/'+it.effectiveName+'.h'
|
||||
val inclCfg = fsa.outputConfig('incl-out')
|
||||
if((force || !fsa.isFile(inclFileName, inclCfg) || gen.overwrite) && header!==null && header.length>0)
|
||||
fsa.generateFile(inclFileName, inclCfg, header)
|
||||
val source = gen.generateSource(namespace)
|
||||
val srcFileName = p1+'/'+it.effectiveName+'.cpp'
|
||||
val srcCfg = fsa.outputConfig('src-out')
|
||||
if((force || !fsa.isFile(srcFileName, srcCfg) || gen.overwrite) && source!==null && source.length>0)
|
||||
fsa.generateFile(srcFileName, srcCfg, source)
|
||||
if((p1=='fw' && genFW) || (p1!='fw' && genSC)) {
|
||||
val header = gen.generateHeader(namespace)
|
||||
val prefix = if(p1=="fw") 'fw-' else 'sc-'
|
||||
val inclFileName = (if(p1=="gen") p1 else '.') + '/'+it.effectiveName+'.h'
|
||||
val inclCfg = fsa.outputConfig(prefix+'incl-out')
|
||||
if((force || !fsa.isFile(inclFileName, inclCfg) || gen.overwrite) && header!==null && header.length>0)
|
||||
fsa.generateFile(inclFileName, inclCfg, header)
|
||||
val source = gen.generateSource(namespace)
|
||||
val srcFileName = (if(p1=="gen") p1 else '.') + '/'+it.effectiveName+'.cpp'
|
||||
val srcCfg = fsa.outputConfig(prefix+'src-out')
|
||||
if((force || !fsa.isFile(srcFileName, srcCfg) || gen.overwrite) && source!==null && source.length>0)
|
||||
fsa.generateFile(srcFileName, srcCfg, source)
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
|
|
|
@ -1,8 +1,26 @@
|
|||
package com.minres.rdl.generator
|
||||
|
||||
import org.eclipse.xtext.generator.GeneratorContext
|
||||
import org.eclipse.xtext.util.CancelIndicator
|
||||
import org.eclipse.xtext.generator.IGeneratorContext
|
||||
|
||||
class RdlGeneratorContext implements IGeneratorContext {
|
||||
|
||||
class RdlGeneratorContext extends GeneratorContext {
|
||||
public boolean forceOverwrite = false
|
||||
public String namespace ="scc"
|
||||
|
||||
public String namespace ="sysc"
|
||||
|
||||
public CancelIndicator cancelIndicator;
|
||||
|
||||
public boolean generateFw = true;
|
||||
|
||||
public String fwPathModifier = ""
|
||||
|
||||
public boolean generateSc = true;
|
||||
|
||||
public String scPathModifier =""
|
||||
|
||||
override getCancelIndicator() {
|
||||
return cancelIndicator
|
||||
}
|
||||
|
||||
}
|
|
@ -32,8 +32,7 @@ class RegfileGenerator extends RdlBaseGenerator{
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef _«namespace.toUpperCase»_GEN_«componentDefinition.effectiveName.toUpperCase»_H_
|
||||
#define _«namespace.toUpperCase»_GEN_«componentDefinition.effectiveName.toUpperCase»_H_
|
||||
#pragma once
|
||||
|
||||
#include <scc/utilities.h>
|
||||
#include <util/bit_field.h>
|
||||
|
@ -45,7 +44,9 @@ class RegfileGenerator extends RdlBaseGenerator{
|
|||
«ENDIF»
|
||||
«ENDFOR»
|
||||
|
||||
namespace «namespace» {
|
||||
«FOR ns : namespace.split('::')»
|
||||
namespace «ns» {
|
||||
«ENDFOR»
|
||||
namespace gen {
|
||||
|
||||
class «componentDefinition.effectiveName»_regs :
|
||||
|
@ -128,7 +129,9 @@ class RegfileGenerator extends RdlBaseGenerator{
|
|||
void registerResources(scc::tlm_target<BUSWIDTH>& target, uint64_t offset=0);
|
||||
};
|
||||
} // namespace gen
|
||||
} // namespace «namespace»
|
||||
«FOR ns : namespace.split('::').reverse»
|
||||
} // namespace «ns»
|
||||
«ENDFOR»
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// member functions
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -7,10 +7,21 @@ public class PreferenceConstants {
|
|||
|
||||
public static final String SCOPE_NAME = "com.minres.rdl.rdl";
|
||||
|
||||
public static final String ADDRESSUNIT_PROP = "com.minres.rdl.addrunit";
|
||||
|
||||
public static final String P_GENERATE_CSV = "booleanCsvPreference";
|
||||
|
||||
public static final String P_ADDRESSUNIT = "choiceAddrunitPreference";
|
||||
|
||||
public static final String ADDRESSUNIT_PROP = "com.minres.rdl.addrunit";
|
||||
public static final String P_NAMESPACE = "setNamespacePreference";
|
||||
|
||||
public static final String P_OVERWRITE_STUBS = "overwriteStubs";
|
||||
|
||||
public static final String P_FILETYPES_TO_GENERATE = "filetypesToGenerate";
|
||||
|
||||
public static final String P_COMPONENT_PATH = "componentPath";
|
||||
|
||||
public static final String P_FIRMWARE_PATH = "firmwarePath";
|
||||
|
||||
public static final String P_COPYRIGHT_HEADER = "copyrightHeader";
|
||||
}
|
||||
|
|
|
@ -1,13 +1,18 @@
|
|||
package com.minres.rdl.preferences;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
|
||||
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
|
||||
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
|
||||
import org.eclipse.core.runtime.preferences.InstanceScope;
|
||||
|
||||
/**
|
||||
* Class used to initialize default preference values.
|
||||
*/
|
||||
public class PreferenceInitializer extends AbstractPreferenceInitializer {
|
||||
|
||||
private final HashSet<String> valid_addrunit_types = new HashSet<String>(Arrays.asList(new String[]{"byte", "word", "dword"}));
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
@ -15,22 +20,21 @@ public class PreferenceInitializer extends AbstractPreferenceInitializer {
|
|||
* initializeDefaultPreferences()
|
||||
*/
|
||||
public void initializeDefaultPreferences() {
|
||||
IEclipsePreferences store = RdlPreferences.getPreferenceStore();
|
||||
IEclipsePreferences store = InstanceScope.INSTANCE.getNode(PreferenceConstants.SCOPE_NAME);
|
||||
store.putBoolean(PreferenceConstants.P_GENERATE_CSV, true);
|
||||
String value = System.getProperty(PreferenceConstants.ADDRESSUNIT_PROP);
|
||||
if(value!=null){
|
||||
if("byte".equals(value)){
|
||||
store.put(PreferenceConstants.P_ADDRESSUNIT, "byte");
|
||||
} else if("word".equals(value)){
|
||||
store.put(PreferenceConstants.P_ADDRESSUNIT, "word");
|
||||
} else if("dword".equals(value)){
|
||||
store.put(PreferenceConstants.P_ADDRESSUNIT, "dword");
|
||||
} else {
|
||||
System.err.println("Unknown configuration value: '"+value+"', using 'byte'");
|
||||
store.put(PreferenceConstants.P_ADDRESSUNIT, "byte");
|
||||
}
|
||||
} else
|
||||
if(valid_addrunit_types.contains(value)){
|
||||
store.put(PreferenceConstants.P_ADDRESSUNIT, value);
|
||||
} else {
|
||||
System.err.println("Unknown configuration value: '"+value+"', using 'byte'");
|
||||
store.put(PreferenceConstants.P_ADDRESSUNIT, "byte");
|
||||
}
|
||||
store.put(PreferenceConstants.P_NAMESPACE, "sysc");
|
||||
store.putBoolean(PreferenceConstants.P_OVERWRITE_STUBS, false);
|
||||
store.put(PreferenceConstants.P_FILETYPES_TO_GENERATE, "all");
|
||||
store.put(PreferenceConstants.P_COMPONENT_PATH, "");
|
||||
store.put(PreferenceConstants.P_FIRMWARE_PATH, "");
|
||||
store.put(PreferenceConstants.P_COPYRIGHT_HEADER, "Copyright (c) 2019 -2022 MINRES Technologies GmbH\n\nSPDX-License-Identifier: Apache-2.0");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
package com.minres.rdl.preferences;
|
||||
|
||||
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
|
||||
import org.eclipse.core.runtime.preferences.InstanceScope;
|
||||
|
||||
public class RdlPreferences {
|
||||
|
||||
public static boolean getGenerateCsv() {
|
||||
return getPreferenceStore().getBoolean(PreferenceConstants.P_GENERATE_CSV, true);
|
||||
}
|
||||
|
||||
public static String getAddrUnit() {
|
||||
return getPreferenceStore().get(PreferenceConstants.P_ADDRESSUNIT, System.getProperty(PreferenceConstants.ADDRESSUNIT_PROP));
|
||||
}
|
||||
|
||||
public static IEclipsePreferences getPreferenceStore() {
|
||||
return InstanceScope.INSTANCE.getNode(PreferenceConstants.SCOPE_NAME);
|
||||
}
|
||||
}
|
|
@ -33,10 +33,6 @@
|
|||
<module>com.minres.rdl.repository</module>
|
||||
<module>com.minres.rdl.tests</module>
|
||||
<module>com.minres.rdl.ui.tests</module>
|
||||
<module>com.minres.rdl.product</module>
|
||||
<module>com.minres.rdl.product.feature</module>
|
||||
<module>com.minres.rdl.platform.feature</module>
|
||||
<module>com.minres.rdl.product.releng</module>
|
||||
<module>com.minres.rdl.standalone</module>
|
||||
</modules>
|
||||
<dependencyManagement>
|
||||
|
|
Loading…
Reference in New Issue