diff options
author | 2019-02-06 18:28:18 +0100 | |
---|---|---|
committer | 2019-02-19 19:18:25 +0100 | |
commit | 615b602f0a9b4ce9eca8c38b9aa780b81d03d8e7 (patch) | |
tree | 1c9fe0f4ae152d84152c8ff1cfb6366ec8b277e9 /Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui | |
parent | [Stochastic] Fault tree transformation langauge (diff) | |
download | VIATRA-Generator-615b602f0a9b4ce9eca8c38b9aa780b81d03d8e7.tar.gz VIATRA-Generator-615b602f0a9b4ce9eca8c38b9aa780b81d03d8e7.tar.zst VIATRA-Generator-615b602f0a9b4ce9eca8c38b9aa780b81d03d8e7.zip |
Extract component fault tree model
Diffstat (limited to 'Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui')
20 files changed, 207 insertions, 21 deletions
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/src-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/contentassist/AbstractCftLanguageProposalProvider.java b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/src-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/contentassist/AbstractCftLanguageProposalProvider.java index 89cd0833..7d5c8f8e 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/src-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/contentassist/AbstractCftLanguageProposalProvider.java +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/src-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/contentassist/AbstractCftLanguageProposalProvider.java | |||
@@ -54,19 +54,37 @@ public abstract class AbstractCftLanguageProposalProvider extends TerminalsPropo | |||
54 | public void completeBasicEventDefinition_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { | 54 | public void completeBasicEventDefinition_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { |
55 | completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); | 55 | completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); |
56 | } | 56 | } |
57 | public void completeBasicEventDefinition_Rate(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { | 57 | public void completeBasicEventDefinition_Distribution(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { |
58 | completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); | 58 | completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); |
59 | } | 59 | } |
60 | public void completeAndGate_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { | 60 | public void completeConstantDistribution_P(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { |
61 | completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); | 61 | completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); |
62 | } | 62 | } |
63 | public void completeAndGate_InputEvents(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { | 63 | public void completeExponentialDistribution_Lambda(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { |
64 | completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); | ||
65 | } | ||
66 | public void completeAndGateDefinition_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { | ||
67 | completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); | ||
68 | } | ||
69 | public void completeAndGateDefinition_InputEvents(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { | ||
70 | lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor); | ||
71 | } | ||
72 | public void completeOrGateDefinition_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { | ||
73 | completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); | ||
74 | } | ||
75 | public void completeOrGateDefinition_InputEvents(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { | ||
64 | lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor); | 76 | lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor); |
65 | } | 77 | } |
66 | public void completeOrGate_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { | 78 | public void completeKOfMGateDefinition_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { |
79 | completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); | ||
80 | } | ||
81 | public void completeKOfMGateDefinition_K(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { | ||
67 | completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); | 82 | completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); |
68 | } | 83 | } |
69 | public void completeOrGate_InputEvents(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { | 84 | public void completeKOfMGateDefinition_M(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { |
85 | completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); | ||
86 | } | ||
87 | public void completeKOfMGateDefinition_InputEvents(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { | ||
70 | lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor); | 88 | lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor); |
71 | } | 89 | } |
72 | public void completeTransformationDefinition_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { | 90 | public void completeTransformationDefinition_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { |
@@ -136,9 +154,6 @@ public abstract class AbstractCftLanguageProposalProvider extends TerminalsPropo | |||
136 | public void complete_ComponentDefinition(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { | 154 | public void complete_ComponentDefinition(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { |
137 | // subclasses may override | 155 | // subclasses may override |
138 | } | 156 | } |
139 | public void complete_EventDeclaration(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { | ||
140 | // subclasses may override | ||
141 | } | ||
142 | public void complete_InputEvent(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { | 157 | public void complete_InputEvent(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { |
143 | // subclasses may override | 158 | // subclasses may override |
144 | } | 159 | } |
@@ -148,13 +163,25 @@ public abstract class AbstractCftLanguageProposalProvider extends TerminalsPropo | |||
148 | public void complete_BasicEventDefinition(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { | 163 | public void complete_BasicEventDefinition(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { |
149 | // subclasses may override | 164 | // subclasses may override |
150 | } | 165 | } |
166 | public void complete_Distribution(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { | ||
167 | // subclasses may override | ||
168 | } | ||
169 | public void complete_ConstantDistribution(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { | ||
170 | // subclasses may override | ||
171 | } | ||
172 | public void complete_ExponentialDistribution(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { | ||
173 | // subclasses may override | ||
174 | } | ||
151 | public void complete_GateDefinition(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { | 175 | public void complete_GateDefinition(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { |
152 | // subclasses may override | 176 | // subclasses may override |
153 | } | 177 | } |
154 | public void complete_AndGate(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { | 178 | public void complete_AndGateDefinition(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { |
179 | // subclasses may override | ||
180 | } | ||
181 | public void complete_OrGateDefinition(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { | ||
155 | // subclasses may override | 182 | // subclasses may override |
156 | } | 183 | } |
157 | public void complete_OrGate(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { | 184 | public void complete_KOfMGateDefinition(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { |
158 | // subclasses may override | 185 | // subclasses may override |
159 | } | 186 | } |
160 | public void complete_TransformationDefinition(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { | 187 | public void complete_TransformationDefinition(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { |
@@ -187,7 +214,16 @@ public abstract class AbstractCftLanguageProposalProvider extends TerminalsPropo | |||
187 | public void complete_QualifiedNameWithWildcard(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { | 214 | public void complete_QualifiedNameWithWildcard(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { |
188 | // subclasses may override | 215 | // subclasses may override |
189 | } | 216 | } |
190 | public void complete_DOULBE(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { | 217 | public void complete_ValidId(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { |
218 | // subclasses may override | ||
219 | } | ||
220 | public void complete_Double(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { | ||
221 | // subclasses may override | ||
222 | } | ||
223 | public void complete_OF_INT(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { | ||
224 | // subclasses may override | ||
225 | } | ||
226 | public void complete_T_DOUBLE(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { | ||
191 | // subclasses may override | 227 | // subclasses may override |
192 | } | 228 | } |
193 | } | 229 | } |
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/src/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/CftLanguageUiModule.xtend b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/src/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/CftLanguageUiModule.xtend index 9aa9ba9c..6558d759 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/src/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/CftLanguageUiModule.xtend +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/src/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/CftLanguageUiModule.xtend | |||
@@ -3,11 +3,22 @@ | |||
3 | */ | 3 | */ |
4 | package hu.bme.mit.inf.dslreasoner.faulttree.components.ui | 4 | package hu.bme.mit.inf.dslreasoner.faulttree.components.ui |
5 | 5 | ||
6 | import hu.bme.mit.inf.dslreasoner.faulttree.components.ui.syntaxcoloring.CftLanguageSemanticHighlightingCalculator | ||
7 | import hu.bme.mit.inf.dslreasoner.faulttree.components.ui.syntaxcoloring.CftLanguageTokenToAttributeIdMapper | ||
6 | import org.eclipse.xtend.lib.annotations.FinalFieldsConstructor | 8 | import org.eclipse.xtend.lib.annotations.FinalFieldsConstructor |
9 | import org.eclipse.xtext.ide.editor.syntaxcoloring.AbstractAntlrTokenToAttributeIdMapper | ||
10 | import org.eclipse.xtext.ide.editor.syntaxcoloring.ISemanticHighlightingCalculator | ||
7 | 11 | ||
8 | /** | 12 | /** |
9 | * Use this class to register components to be used within the Eclipse IDE. | 13 | * Use this class to register components to be used within the Eclipse IDE. |
10 | */ | 14 | */ |
11 | @FinalFieldsConstructor | 15 | @FinalFieldsConstructor |
12 | class CftLanguageUiModule extends AbstractCftLanguageUiModule { | 16 | class CftLanguageUiModule extends AbstractCftLanguageUiModule { |
17 | def Class<? extends AbstractAntlrTokenToAttributeIdMapper> bindAbstractAntlrTokenToAttributeIdMapper() { | ||
18 | CftLanguageTokenToAttributeIdMapper | ||
19 | } | ||
20 | |||
21 | def Class<? extends ISemanticHighlightingCalculator> bindISemanticHighlightingCalculator() { | ||
22 | CftLanguageSemanticHighlightingCalculator | ||
23 | } | ||
13 | } | 24 | } |
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/src/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/labeling/CftLanguageLabelProvider.xtend b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/src/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/labeling/CftLanguageLabelProvider.xtend index a6ea8f90..f111c553 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/src/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/labeling/CftLanguageLabelProvider.xtend +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/src/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/labeling/CftLanguageLabelProvider.xtend | |||
@@ -4,6 +4,7 @@ | |||
4 | package hu.bme.mit.inf.dslreasoner.faulttree.components.ui.labeling | 4 | package hu.bme.mit.inf.dslreasoner.faulttree.components.ui.labeling |
5 | 5 | ||
6 | import com.google.inject.Inject | 6 | import com.google.inject.Inject |
7 | import hu.bme.mit.inf.dslreasoner.faulttree.components.cftLanguage.MappingDefinition | ||
7 | import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider | 8 | import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider |
8 | import org.eclipse.xtext.ui.label.DefaultEObjectLabelProvider | 9 | import org.eclipse.xtext.ui.label.DefaultEObjectLabelProvider |
9 | 10 | ||
@@ -19,13 +20,7 @@ class CftLanguageLabelProvider extends DefaultEObjectLabelProvider { | |||
19 | super(delegate); | 20 | super(delegate); |
20 | } | 21 | } |
21 | 22 | ||
22 | // Labels and icons can be computed like this: | 23 | def text(MappingDefinition mappingDefinition) { |
23 | 24 | mappingDefinition.pattern?.name | |
24 | // def text(Greeting ele) { | 25 | } |
25 | // 'A greeting to ' + ele.name | ||
26 | // } | ||
27 | // | ||
28 | // def image(Greeting ele) { | ||
29 | // 'Greeting.gif' | ||
30 | // } | ||
31 | } | 26 | } |
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/src/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/outline/CftLanguageOutlineTreeProvider.xtend b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/src/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/outline/CftLanguageOutlineTreeProvider.xtend index 5ffa82ad..3a75a639 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/src/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/outline/CftLanguageOutlineTreeProvider.xtend +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/src/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/outline/CftLanguageOutlineTreeProvider.xtend | |||
@@ -3,6 +3,8 @@ | |||
3 | */ | 3 | */ |
4 | package hu.bme.mit.inf.dslreasoner.faulttree.components.ui.outline | 4 | package hu.bme.mit.inf.dslreasoner.faulttree.components.ui.outline |
5 | 5 | ||
6 | import hu.bme.mit.inf.dslreasoner.faulttree.components.cftLanguage.MappingDefinition | ||
7 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.EventDefinition | ||
6 | import org.eclipse.xtext.ui.editor.outline.impl.DefaultOutlineTreeProvider | 8 | import org.eclipse.xtext.ui.editor.outline.impl.DefaultOutlineTreeProvider |
7 | 9 | ||
8 | /** | 10 | /** |
@@ -11,5 +13,11 @@ import org.eclipse.xtext.ui.editor.outline.impl.DefaultOutlineTreeProvider | |||
11 | * See https://www.eclipse.org/Xtext/documentation/310_eclipse_support.html#outline | 13 | * See https://www.eclipse.org/Xtext/documentation/310_eclipse_support.html#outline |
12 | */ | 14 | */ |
13 | class CftLanguageOutlineTreeProvider extends DefaultOutlineTreeProvider { | 15 | class CftLanguageOutlineTreeProvider extends DefaultOutlineTreeProvider { |
14 | 16 | def _isLeaf(EventDefinition eventDefinition) { | |
17 | true | ||
18 | } | ||
19 | |||
20 | def _isLeaf(MappingDefinition mappingDefinition) { | ||
21 | true | ||
22 | } | ||
15 | } | 23 | } |
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/src/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/syntaxcoloring/CftLanguageSemanticHighlightingCalculator.xtend b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/src/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/syntaxcoloring/CftLanguageSemanticHighlightingCalculator.xtend new file mode 100644 index 00000000..47c9ebdf --- /dev/null +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/src/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/syntaxcoloring/CftLanguageSemanticHighlightingCalculator.xtend | |||
@@ -0,0 +1,24 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.faulttree.components.ui.syntaxcoloring | ||
2 | |||
3 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.KOfMGateDefinition | ||
4 | import org.eclipse.emf.ecore.EObject | ||
5 | import org.eclipse.xtext.ide.editor.syntaxcoloring.DefaultSemanticHighlightingCalculator | ||
6 | import org.eclipse.xtext.ide.editor.syntaxcoloring.IHighlightedPositionAcceptor | ||
7 | import org.eclipse.xtext.util.CancelIndicator | ||
8 | |||
9 | import static hu.bme.mit.inf.dslreasoner.faulttree.model.cft.CftPackage.Literals.* | ||
10 | import static org.eclipse.xtext.ui.editor.syntaxcoloring.DefaultHighlightingConfiguration.* | ||
11 | |||
12 | class CftLanguageSemanticHighlightingCalculator extends DefaultSemanticHighlightingCalculator { | ||
13 | protected dispatch def highlightElement(KOfMGateDefinition gate, IHighlightedPositionAcceptor acceptor, | ||
14 | CancelIndicator cancelIndicator) { | ||
15 | acceptor.highlightFeature(gate, KOF_MGATE_DEFINITION__K, KEYWORD_ID) | ||
16 | acceptor.highlightFeature(gate, KOF_MGATE_DEFINITION__M, KEYWORD_ID) | ||
17 | false | ||
18 | } | ||
19 | |||
20 | protected dispatch def highlightElement(EObject eObject, IHighlightedPositionAcceptor acceptor, | ||
21 | CancelIndicator cancelIndicator) { | ||
22 | super.highlightElement(eObject, acceptor, cancelIndicator) | ||
23 | } | ||
24 | } | ||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/src/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/syntaxcoloring/CftLanguageTokenToAttributeIdMapper.xtend b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/src/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/syntaxcoloring/CftLanguageTokenToAttributeIdMapper.xtend new file mode 100644 index 00000000..4656d0a0 --- /dev/null +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/src/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/syntaxcoloring/CftLanguageTokenToAttributeIdMapper.xtend | |||
@@ -0,0 +1,15 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.faulttree.components.ui.syntaxcoloring | ||
2 | |||
3 | import org.eclipse.xtext.ide.editor.syntaxcoloring.DefaultAntlrTokenToAttributeIdMapper | ||
4 | import org.eclipse.xtext.ide.editor.syntaxcoloring.HighlightingStyles | ||
5 | |||
6 | class CftLanguageTokenToAttributeIdMapper extends DefaultAntlrTokenToAttributeIdMapper { | ||
7 | override protected calculateId(String tokenName, int tokenType) { | ||
8 | switch (tokenName) { | ||
9 | case "RULE_T_DOUBLE": | ||
10 | HighlightingStyles.NUMBER_ID | ||
11 | default: | ||
12 | super.calculateId(tokenName, tokenType) | ||
13 | } | ||
14 | } | ||
15 | } \ No newline at end of file | ||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/.CftLanguageUiModule.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/.CftLanguageUiModule.xtendbin index 7eb6190d..ff2238f7 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/.CftLanguageUiModule.xtendbin +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/.CftLanguageUiModule.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/CftLanguageUiModule.java b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/CftLanguageUiModule.java index 4f1409d9..be796ba2 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/CftLanguageUiModule.java +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/CftLanguageUiModule.java | |||
@@ -4,8 +4,12 @@ | |||
4 | package hu.bme.mit.inf.dslreasoner.faulttree.components.ui; | 4 | package hu.bme.mit.inf.dslreasoner.faulttree.components.ui; |
5 | 5 | ||
6 | import hu.bme.mit.inf.dslreasoner.faulttree.components.ui.AbstractCftLanguageUiModule; | 6 | import hu.bme.mit.inf.dslreasoner.faulttree.components.ui.AbstractCftLanguageUiModule; |
7 | import hu.bme.mit.inf.dslreasoner.faulttree.components.ui.syntaxcoloring.CftLanguageSemanticHighlightingCalculator; | ||
8 | import hu.bme.mit.inf.dslreasoner.faulttree.components.ui.syntaxcoloring.CftLanguageTokenToAttributeIdMapper; | ||
7 | import org.eclipse.ui.plugin.AbstractUIPlugin; | 9 | import org.eclipse.ui.plugin.AbstractUIPlugin; |
8 | import org.eclipse.xtend.lib.annotations.FinalFieldsConstructor; | 10 | import org.eclipse.xtend.lib.annotations.FinalFieldsConstructor; |
11 | import org.eclipse.xtext.ide.editor.syntaxcoloring.AbstractAntlrTokenToAttributeIdMapper; | ||
12 | import org.eclipse.xtext.ide.editor.syntaxcoloring.ISemanticHighlightingCalculator; | ||
9 | 13 | ||
10 | /** | 14 | /** |
11 | * Use this class to register components to be used within the Eclipse IDE. | 15 | * Use this class to register components to be used within the Eclipse IDE. |
@@ -13,6 +17,14 @@ import org.eclipse.xtend.lib.annotations.FinalFieldsConstructor; | |||
13 | @FinalFieldsConstructor | 17 | @FinalFieldsConstructor |
14 | @SuppressWarnings("all") | 18 | @SuppressWarnings("all") |
15 | public class CftLanguageUiModule extends AbstractCftLanguageUiModule { | 19 | public class CftLanguageUiModule extends AbstractCftLanguageUiModule { |
20 | public Class<? extends AbstractAntlrTokenToAttributeIdMapper> bindAbstractAntlrTokenToAttributeIdMapper() { | ||
21 | return CftLanguageTokenToAttributeIdMapper.class; | ||
22 | } | ||
23 | |||
24 | public Class<? extends ISemanticHighlightingCalculator> bindISemanticHighlightingCalculator() { | ||
25 | return CftLanguageSemanticHighlightingCalculator.class; | ||
26 | } | ||
27 | |||
16 | public CftLanguageUiModule(final AbstractUIPlugin plugin) { | 28 | public CftLanguageUiModule(final AbstractUIPlugin plugin) { |
17 | super(plugin); | 29 | super(plugin); |
18 | } | 30 | } |
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/contentassist/.CftLanguageProposalProvider.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/contentassist/.CftLanguageProposalProvider.xtendbin index a6a68b91..c62e6652 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/contentassist/.CftLanguageProposalProvider.xtendbin +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/contentassist/.CftLanguageProposalProvider.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/labeling/.CftLanguageDescriptionLabelProvider.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/labeling/.CftLanguageDescriptionLabelProvider.xtendbin index e2a540db..21bd15b6 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/labeling/.CftLanguageDescriptionLabelProvider.xtendbin +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/labeling/.CftLanguageDescriptionLabelProvider.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/labeling/.CftLanguageLabelProvider.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/labeling/.CftLanguageLabelProvider.xtendbin index 58dd1f71..ae92f324 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/labeling/.CftLanguageLabelProvider.xtendbin +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/labeling/.CftLanguageLabelProvider.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/labeling/CftLanguageLabelProvider.java b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/labeling/CftLanguageLabelProvider.java index 3a03868d..103bb114 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/labeling/CftLanguageLabelProvider.java +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/labeling/CftLanguageLabelProvider.java | |||
@@ -4,7 +4,9 @@ | |||
4 | package hu.bme.mit.inf.dslreasoner.faulttree.components.ui.labeling; | 4 | package hu.bme.mit.inf.dslreasoner.faulttree.components.ui.labeling; |
5 | 5 | ||
6 | import com.google.inject.Inject; | 6 | import com.google.inject.Inject; |
7 | import hu.bme.mit.inf.dslreasoner.faulttree.components.cftLanguage.MappingDefinition; | ||
7 | import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; | 8 | import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; |
9 | import org.eclipse.viatra.query.patternlanguage.emf.vql.Pattern; | ||
8 | import org.eclipse.xtext.ui.label.DefaultEObjectLabelProvider; | 10 | import org.eclipse.xtext.ui.label.DefaultEObjectLabelProvider; |
9 | 11 | ||
10 | /** | 12 | /** |
@@ -18,4 +20,13 @@ public class CftLanguageLabelProvider extends DefaultEObjectLabelProvider { | |||
18 | public CftLanguageLabelProvider(final AdapterFactoryLabelProvider delegate) { | 20 | public CftLanguageLabelProvider(final AdapterFactoryLabelProvider delegate) { |
19 | super(delegate); | 21 | super(delegate); |
20 | } | 22 | } |
23 | |||
24 | public String text(final MappingDefinition mappingDefinition) { | ||
25 | Pattern _pattern = mappingDefinition.getPattern(); | ||
26 | String _name = null; | ||
27 | if (_pattern!=null) { | ||
28 | _name=_pattern.getName(); | ||
29 | } | ||
30 | return _name; | ||
31 | } | ||
21 | } | 32 | } |
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/outline/.CftLanguageOutlineTreeProvider.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/outline/.CftLanguageOutlineTreeProvider.xtendbin index b785c6e2..91137ae1 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/outline/.CftLanguageOutlineTreeProvider.xtendbin +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/outline/.CftLanguageOutlineTreeProvider.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/outline/CftLanguageOutlineTreeProvider.java b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/outline/CftLanguageOutlineTreeProvider.java index 76ea64c4..b8da3d93 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/outline/CftLanguageOutlineTreeProvider.java +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/outline/CftLanguageOutlineTreeProvider.java | |||
@@ -3,6 +3,8 @@ | |||
3 | */ | 3 | */ |
4 | package hu.bme.mit.inf.dslreasoner.faulttree.components.ui.outline; | 4 | package hu.bme.mit.inf.dslreasoner.faulttree.components.ui.outline; |
5 | 5 | ||
6 | import hu.bme.mit.inf.dslreasoner.faulttree.components.cftLanguage.MappingDefinition; | ||
7 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.EventDefinition; | ||
6 | import org.eclipse.xtext.ui.editor.outline.impl.DefaultOutlineTreeProvider; | 8 | import org.eclipse.xtext.ui.editor.outline.impl.DefaultOutlineTreeProvider; |
7 | 9 | ||
8 | /** | 10 | /** |
@@ -12,4 +14,11 @@ import org.eclipse.xtext.ui.editor.outline.impl.DefaultOutlineTreeProvider; | |||
12 | */ | 14 | */ |
13 | @SuppressWarnings("all") | 15 | @SuppressWarnings("all") |
14 | public class CftLanguageOutlineTreeProvider extends DefaultOutlineTreeProvider { | 16 | public class CftLanguageOutlineTreeProvider extends DefaultOutlineTreeProvider { |
17 | public boolean _isLeaf(final EventDefinition eventDefinition) { | ||
18 | return true; | ||
19 | } | ||
20 | |||
21 | public boolean _isLeaf(final MappingDefinition mappingDefinition) { | ||
22 | return true; | ||
23 | } | ||
15 | } | 24 | } |
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/quickfix/.CftLanguageQuickfixProvider.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/quickfix/.CftLanguageQuickfixProvider.xtendbin index d199f277..637b4e7e 100644 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/quickfix/.CftLanguageQuickfixProvider.xtendbin +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/quickfix/.CftLanguageQuickfixProvider.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/syntaxcoloring/.CftLanguageSemanticHighlightingCalculator.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/syntaxcoloring/.CftLanguageSemanticHighlightingCalculator.xtendbin new file mode 100644 index 00000000..81585f8b --- /dev/null +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/syntaxcoloring/.CftLanguageSemanticHighlightingCalculator.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/syntaxcoloring/.CftLanguageTokenToAttributeIdMapper.xtendbin b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/syntaxcoloring/.CftLanguageTokenToAttributeIdMapper.xtendbin new file mode 100644 index 00000000..d8af5320 --- /dev/null +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/syntaxcoloring/.CftLanguageTokenToAttributeIdMapper.xtendbin | |||
Binary files differ | |||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/syntaxcoloring/.gitignore b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/syntaxcoloring/.gitignore new file mode 100644 index 00000000..3fdf4894 --- /dev/null +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/syntaxcoloring/.gitignore | |||
@@ -0,0 +1,2 @@ | |||
1 | /.CftLanguageSemanticHighlightingCalculator.java._trace | ||
2 | /.CftLanguageTokenToAttributeIdMapper.java._trace | ||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/syntaxcoloring/CftLanguageSemanticHighlightingCalculator.java b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/syntaxcoloring/CftLanguageSemanticHighlightingCalculator.java new file mode 100644 index 00000000..268faba3 --- /dev/null +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/syntaxcoloring/CftLanguageSemanticHighlightingCalculator.java | |||
@@ -0,0 +1,38 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.faulttree.components.ui.syntaxcoloring; | ||
2 | |||
3 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.CftPackage; | ||
4 | import hu.bme.mit.inf.dslreasoner.faulttree.model.cft.KOfMGateDefinition; | ||
5 | import java.util.Arrays; | ||
6 | import org.eclipse.emf.ecore.EObject; | ||
7 | import org.eclipse.xtext.ide.editor.syntaxcoloring.DefaultSemanticHighlightingCalculator; | ||
8 | import org.eclipse.xtext.ide.editor.syntaxcoloring.IHighlightedPositionAcceptor; | ||
9 | import org.eclipse.xtext.ui.editor.syntaxcoloring.DefaultHighlightingConfiguration; | ||
10 | import org.eclipse.xtext.util.CancelIndicator; | ||
11 | |||
12 | @SuppressWarnings("all") | ||
13 | public class CftLanguageSemanticHighlightingCalculator extends DefaultSemanticHighlightingCalculator { | ||
14 | protected boolean _highlightElement(final KOfMGateDefinition gate, final IHighlightedPositionAcceptor acceptor, final CancelIndicator cancelIndicator) { | ||
15 | boolean _xblockexpression = false; | ||
16 | { | ||
17 | this.highlightFeature(acceptor, gate, CftPackage.Literals.KOF_MGATE_DEFINITION__K, DefaultHighlightingConfiguration.KEYWORD_ID); | ||
18 | this.highlightFeature(acceptor, gate, CftPackage.Literals.KOF_MGATE_DEFINITION__M, DefaultHighlightingConfiguration.KEYWORD_ID); | ||
19 | _xblockexpression = false; | ||
20 | } | ||
21 | return _xblockexpression; | ||
22 | } | ||
23 | |||
24 | protected boolean _highlightElement(final EObject eObject, final IHighlightedPositionAcceptor acceptor, final CancelIndicator cancelIndicator) { | ||
25 | return super.highlightElement(eObject, acceptor, cancelIndicator); | ||
26 | } | ||
27 | |||
28 | protected boolean highlightElement(final EObject gate, final IHighlightedPositionAcceptor acceptor, final CancelIndicator cancelIndicator) { | ||
29 | if (gate instanceof KOfMGateDefinition) { | ||
30 | return _highlightElement((KOfMGateDefinition)gate, acceptor, cancelIndicator); | ||
31 | } else if (gate != null) { | ||
32 | return _highlightElement(gate, acceptor, cancelIndicator); | ||
33 | } else { | ||
34 | throw new IllegalArgumentException("Unhandled parameter types: " + | ||
35 | Arrays.<Object>asList(gate, acceptor, cancelIndicator).toString()); | ||
36 | } | ||
37 | } | ||
38 | } | ||
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/syntaxcoloring/CftLanguageTokenToAttributeIdMapper.java b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/syntaxcoloring/CftLanguageTokenToAttributeIdMapper.java new file mode 100644 index 00000000..9ad4afda --- /dev/null +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/xtend-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/syntaxcoloring/CftLanguageTokenToAttributeIdMapper.java | |||
@@ -0,0 +1,25 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.faulttree.components.ui.syntaxcoloring; | ||
2 | |||
3 | import org.eclipse.xtext.ide.editor.syntaxcoloring.DefaultAntlrTokenToAttributeIdMapper; | ||
4 | import org.eclipse.xtext.ide.editor.syntaxcoloring.HighlightingStyles; | ||
5 | |||
6 | @SuppressWarnings("all") | ||
7 | public class CftLanguageTokenToAttributeIdMapper extends DefaultAntlrTokenToAttributeIdMapper { | ||
8 | @Override | ||
9 | protected String calculateId(final String tokenName, final int tokenType) { | ||
10 | String _switchResult = null; | ||
11 | if (tokenName != null) { | ||
12 | switch (tokenName) { | ||
13 | case "RULE_T_DOUBLE": | ||
14 | _switchResult = HighlightingStyles.NUMBER_ID; | ||
15 | break; | ||
16 | default: | ||
17 | _switchResult = super.calculateId(tokenName, tokenType); | ||
18 | break; | ||
19 | } | ||
20 | } else { | ||
21 | _switchResult = super.calculateId(tokenName, tokenType); | ||
22 | } | ||
23 | return _switchResult; | ||
24 | } | ||
25 | } | ||