From 7f7f934fe6ad11df96906d009eec68583fd46660 Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Tue, 5 Feb 2019 23:54:03 +0100 Subject: [Stochastic] Fault tree transformation langauge --- .../parser/antlr/internal/InternalCftLanguage.g | 1332 ++++++++++++++++++++ 1 file changed, 1332 insertions(+) create mode 100644 Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/src-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/parser/antlr/internal/InternalCftLanguage.g (limited to 'Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/src-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/parser/antlr/internal/InternalCftLanguage.g') diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/src-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/parser/antlr/internal/InternalCftLanguage.g b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/src-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/parser/antlr/internal/InternalCftLanguage.g new file mode 100644 index 00000000..ff509b0a --- /dev/null +++ b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components/src-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/parser/antlr/internal/InternalCftLanguage.g @@ -0,0 +1,1332 @@ +/* + * generated by Xtext 2.16.0 + */ +grammar InternalCftLanguage; + +options { + superClass=AbstractInternalAntlrParser; +} + +@lexer::header { +package hu.bme.mit.inf.dslreasoner.faulttree.components.parser.antlr.internal; + +// Hack: Use our own Lexer superclass by means of import. +// Currently there is no other way to specify the superclass for the lexer. +import org.eclipse.xtext.parser.antlr.Lexer; +} + +@parser::header { +package hu.bme.mit.inf.dslreasoner.faulttree.components.parser.antlr.internal; + +import org.eclipse.xtext.*; +import org.eclipse.xtext.parser.*; +import org.eclipse.xtext.parser.impl.*; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.xtext.parser.antlr.AbstractInternalAntlrParser; +import org.eclipse.xtext.parser.antlr.XtextTokenStream; +import org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens; +import org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken; +import hu.bme.mit.inf.dslreasoner.faulttree.components.services.CftLanguageGrammarAccess; + +} + +@parser::members { + + private CftLanguageGrammarAccess grammarAccess; + + public InternalCftLanguageParser(TokenStream input, CftLanguageGrammarAccess grammarAccess) { + this(input); + this.grammarAccess = grammarAccess; + registerRules(grammarAccess.getGrammar()); + } + + @Override + protected String getFirstRuleName() { + return "CftModel"; + } + + @Override + protected CftLanguageGrammarAccess getGrammarAccess() { + return grammarAccess; + } + +} + +@rulecatch { + catch (RecognitionException re) { + recover(input,re); + appendSkippedTokens(); + } +} + +// Entry rule entryRuleCftModel +entryRuleCftModel returns [EObject current=null]: + { newCompositeNode(grammarAccess.getCftModelRule()); } + iv_ruleCftModel=ruleCftModel + { $current=$iv_ruleCftModel.current; } + EOF; + +// Rule CftModel +ruleCftModel returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + otherlv_0='package' + { + newLeafNode(otherlv_0, grammarAccess.getCftModelAccess().getPackageKeyword_0()); + } + ( + ( + { + newCompositeNode(grammarAccess.getCftModelAccess().getPackageNameQualifiedNameParserRuleCall_1_0()); + } + lv_packageName_1_0=ruleQualifiedName + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getCftModelRule()); + } + set( + $current, + "packageName", + lv_packageName_1_0, + "hu.bme.mit.inf.dslreasoner.faulttree.components.CftLanguage.QualifiedName"); + afterParserOrEnumRuleCall(); + } + ) + ) + ( + otherlv_2=';' + { + newLeafNode(otherlv_2, grammarAccess.getCftModelAccess().getSemicolonKeyword_2()); + } + )? + ( + ( + { + newCompositeNode(grammarAccess.getCftModelAccess().getImportsImportDeclarationParserRuleCall_3_0()); + } + lv_imports_3_0=ruleImportDeclaration + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getCftModelRule()); + } + add( + $current, + "imports", + lv_imports_3_0, + "hu.bme.mit.inf.dslreasoner.faulttree.components.CftLanguage.ImportDeclaration"); + afterParserOrEnumRuleCall(); + } + ) + )* + ( + ( + ( + { + newCompositeNode(grammarAccess.getCftModelAccess().getComponentDefinitionsComponentDefinitionParserRuleCall_4_0_0()); + } + lv_componentDefinitions_4_0=ruleComponentDefinition + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getCftModelRule()); + } + add( + $current, + "componentDefinitions", + lv_componentDefinitions_4_0, + "hu.bme.mit.inf.dslreasoner.faulttree.components.CftLanguage.ComponentDefinition"); + afterParserOrEnumRuleCall(); + } + ) + ) + | + ( + ( + { + newCompositeNode(grammarAccess.getCftModelAccess().getTransformationDefinitionsTransformationDefinitionParserRuleCall_4_1_0()); + } + lv_transformationDefinitions_5_0=ruleTransformationDefinition + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getCftModelRule()); + } + add( + $current, + "transformationDefinitions", + lv_transformationDefinitions_5_0, + "hu.bme.mit.inf.dslreasoner.faulttree.components.CftLanguage.TransformationDefinition"); + afterParserOrEnumRuleCall(); + } + ) + ) + )* + ) +; + +// Entry rule entryRuleImportDeclaration +entryRuleImportDeclaration returns [EObject current=null]: + { newCompositeNode(grammarAccess.getImportDeclarationRule()); } + iv_ruleImportDeclaration=ruleImportDeclaration + { $current=$iv_ruleImportDeclaration.current; } + EOF; + +// Rule ImportDeclaration +ruleImportDeclaration returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + otherlv_0='import' + { + newLeafNode(otherlv_0, grammarAccess.getImportDeclarationAccess().getImportKeyword_0()); + } + ( + ( + { + newCompositeNode(grammarAccess.getImportDeclarationAccess().getImportedNamespaceQualifiedNameWithWildcardParserRuleCall_1_0()); + } + lv_importedNamespace_1_0=ruleQualifiedNameWithWildcard + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getImportDeclarationRule()); + } + set( + $current, + "importedNamespace", + lv_importedNamespace_1_0, + "hu.bme.mit.inf.dslreasoner.faulttree.components.CftLanguage.QualifiedNameWithWildcard"); + afterParserOrEnumRuleCall(); + } + ) + ) + ( + otherlv_2=';' + { + newLeafNode(otherlv_2, grammarAccess.getImportDeclarationAccess().getSemicolonKeyword_2()); + } + )? + ) +; + +// Entry rule entryRuleComponentDefinition +entryRuleComponentDefinition returns [EObject current=null]: + { newCompositeNode(grammarAccess.getComponentDefinitionRule()); } + iv_ruleComponentDefinition=ruleComponentDefinition + { $current=$iv_ruleComponentDefinition.current; } + EOF; + +// Rule ComponentDefinition +ruleComponentDefinition returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + otherlv_0='cft' + { + newLeafNode(otherlv_0, grammarAccess.getComponentDefinitionAccess().getCftKeyword_0()); + } + ( + ( + lv_name_1_0=RULE_ID + { + newLeafNode(lv_name_1_0, grammarAccess.getComponentDefinitionAccess().getNameIDTerminalRuleCall_1_0()); + } + { + if ($current==null) { + $current = createModelElement(grammarAccess.getComponentDefinitionRule()); + } + setWithLastConsumed( + $current, + "name", + lv_name_1_0, + "org.eclipse.xtext.common.Terminals.ID"); + } + ) + ) + otherlv_2='{' + { + newLeafNode(otherlv_2, grammarAccess.getComponentDefinitionAccess().getLeftCurlyBracketKeyword_2()); + } + ( + ( + { + getUnorderedGroupHelper().enter(grammarAccess.getComponentDefinitionAccess().getUnorderedGroup_3()); + } + ( + ( + ( + {getUnorderedGroupHelper().canSelect(grammarAccess.getComponentDefinitionAccess().getUnorderedGroup_3(), 0)}?=>( + { + getUnorderedGroupHelper().select(grammarAccess.getComponentDefinitionAccess().getUnorderedGroup_3(), 0); + } + ({true}?=>(otherlv_4='in' + { + newLeafNode(otherlv_4, grammarAccess.getComponentDefinitionAccess().getInKeyword_3_0_0()); + } + ( + ( + { + newCompositeNode(grammarAccess.getComponentDefinitionAccess().getInputEventsInputEventParserRuleCall_3_0_1_0()); + } + lv_inputEvents_5_0=ruleInputEvent + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getComponentDefinitionRule()); + } + add( + $current, + "inputEvents", + lv_inputEvents_5_0, + "hu.bme.mit.inf.dslreasoner.faulttree.components.CftLanguage.InputEvent"); + afterParserOrEnumRuleCall(); + } + ) + )* + otherlv_6=';' + { + newLeafNode(otherlv_6, grammarAccess.getComponentDefinitionAccess().getSemicolonKeyword_3_0_2()); + } + )) + { + getUnorderedGroupHelper().returnFromSelection(grammarAccess.getComponentDefinitionAccess().getUnorderedGroup_3()); + } + ) + )| + ( + {getUnorderedGroupHelper().canSelect(grammarAccess.getComponentDefinitionAccess().getUnorderedGroup_3(), 1)}?=>( + { + getUnorderedGroupHelper().select(grammarAccess.getComponentDefinitionAccess().getUnorderedGroup_3(), 1); + } + ({true}?=>(otherlv_7='out' + { + newLeafNode(otherlv_7, grammarAccess.getComponentDefinitionAccess().getOutKeyword_3_1_0()); + } + ( + ( + { + if ($current==null) { + $current = createModelElement(grammarAccess.getComponentDefinitionRule()); + } + } + otherlv_8=RULE_ID + { + newLeafNode(otherlv_8, grammarAccess.getComponentDefinitionAccess().getOutputEventsEventDeclarationCrossReference_3_1_1_0()); + } + ) + )* + otherlv_9=';' + { + newLeafNode(otherlv_9, grammarAccess.getComponentDefinitionAccess().getSemicolonKeyword_3_1_2()); + } + )) + { + getUnorderedGroupHelper().returnFromSelection(grammarAccess.getComponentDefinitionAccess().getUnorderedGroup_3()); + } + ) + ) + )* + ) + ) + { + getUnorderedGroupHelper().leave(grammarAccess.getComponentDefinitionAccess().getUnorderedGroup_3()); + } + ) + ( + ( + ( + { + newCompositeNode(grammarAccess.getComponentDefinitionAccess().getEventDefinitionsEventDefinitionParserRuleCall_4_0_0()); + } + lv_eventDefinitions_10_0=ruleEventDefinition + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getComponentDefinitionRule()); + } + add( + $current, + "eventDefinitions", + lv_eventDefinitions_10_0, + "hu.bme.mit.inf.dslreasoner.faulttree.components.CftLanguage.EventDefinition"); + afterParserOrEnumRuleCall(); + } + ) + ) + otherlv_11=';' + { + newLeafNode(otherlv_11, grammarAccess.getComponentDefinitionAccess().getSemicolonKeyword_4_1()); + } + )* + otherlv_12='}' + { + newLeafNode(otherlv_12, grammarAccess.getComponentDefinitionAccess().getRightCurlyBracketKeyword_5()); + } + ) +; + +// Entry rule entryRuleInputEvent +entryRuleInputEvent returns [EObject current=null]: + { newCompositeNode(grammarAccess.getInputEventRule()); } + iv_ruleInputEvent=ruleInputEvent + { $current=$iv_ruleInputEvent.current; } + EOF; + +// Rule InputEvent +ruleInputEvent returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + ( + ( + lv_name_0_0=RULE_ID + { + newLeafNode(lv_name_0_0, grammarAccess.getInputEventAccess().getNameIDTerminalRuleCall_0_0()); + } + { + if ($current==null) { + $current = createModelElement(grammarAccess.getInputEventRule()); + } + setWithLastConsumed( + $current, + "name", + lv_name_0_0, + "org.eclipse.xtext.common.Terminals.ID"); + } + ) + ) + ( + ( + lv_multiple_1_0='[]' + { + newLeafNode(lv_multiple_1_0, grammarAccess.getInputEventAccess().getMultipleLeftSquareBracketRightSquareBracketKeyword_1_0()); + } + { + if ($current==null) { + $current = createModelElement(grammarAccess.getInputEventRule()); + } + setWithLastConsumed($current, "multiple", true, "[]"); + } + ) + )? + ) +; + +// Entry rule entryRuleEventDefinition +entryRuleEventDefinition returns [EObject current=null]: + { newCompositeNode(grammarAccess.getEventDefinitionRule()); } + iv_ruleEventDefinition=ruleEventDefinition + { $current=$iv_ruleEventDefinition.current; } + EOF; + +// Rule EventDefinition +ruleEventDefinition returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + { + newCompositeNode(grammarAccess.getEventDefinitionAccess().getBasicEventDefinitionParserRuleCall_0()); + } + this_BasicEventDefinition_0=ruleBasicEventDefinition + { + $current = $this_BasicEventDefinition_0.current; + afterParserOrEnumRuleCall(); + } + | + { + newCompositeNode(grammarAccess.getEventDefinitionAccess().getGateDefinitionParserRuleCall_1()); + } + this_GateDefinition_1=ruleGateDefinition + { + $current = $this_GateDefinition_1.current; + afterParserOrEnumRuleCall(); + } + ) +; + +// Entry rule entryRuleBasicEventDefinition +entryRuleBasicEventDefinition returns [EObject current=null]: + { newCompositeNode(grammarAccess.getBasicEventDefinitionRule()); } + iv_ruleBasicEventDefinition=ruleBasicEventDefinition + { $current=$iv_ruleBasicEventDefinition.current; } + EOF; + +// Rule BasicEventDefinition +ruleBasicEventDefinition returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + ( + ( + lv_name_0_0=RULE_ID + { + newLeafNode(lv_name_0_0, grammarAccess.getBasicEventDefinitionAccess().getNameIDTerminalRuleCall_0_0()); + } + { + if ($current==null) { + $current = createModelElement(grammarAccess.getBasicEventDefinitionRule()); + } + setWithLastConsumed( + $current, + "name", + lv_name_0_0, + "org.eclipse.xtext.common.Terminals.ID"); + } + ) + ) + otherlv_1='lambda' + { + newLeafNode(otherlv_1, grammarAccess.getBasicEventDefinitionAccess().getLambdaKeyword_1()); + } + otherlv_2='=' + { + newLeafNode(otherlv_2, grammarAccess.getBasicEventDefinitionAccess().getEqualsSignKeyword_2()); + } + ( + ( + lv_rate_3_0=RULE_DOULBE + { + newLeafNode(lv_rate_3_0, grammarAccess.getBasicEventDefinitionAccess().getRateDOULBETerminalRuleCall_3_0()); + } + { + if ($current==null) { + $current = createModelElement(grammarAccess.getBasicEventDefinitionRule()); + } + setWithLastConsumed( + $current, + "rate", + lv_rate_3_0, + "hu.bme.mit.inf.dslreasoner.faulttree.components.CftLanguage.DOULBE"); + } + ) + ) + ) +; + +// Entry rule entryRuleGateDefinition +entryRuleGateDefinition returns [EObject current=null]: + { newCompositeNode(grammarAccess.getGateDefinitionRule()); } + iv_ruleGateDefinition=ruleGateDefinition + { $current=$iv_ruleGateDefinition.current; } + EOF; + +// Rule GateDefinition +ruleGateDefinition returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + { + newCompositeNode(grammarAccess.getGateDefinitionAccess().getAndGateParserRuleCall_0()); + } + this_AndGate_0=ruleAndGate + { + $current = $this_AndGate_0.current; + afterParserOrEnumRuleCall(); + } + | + { + newCompositeNode(grammarAccess.getGateDefinitionAccess().getOrGateParserRuleCall_1()); + } + this_OrGate_1=ruleOrGate + { + $current = $this_OrGate_1.current; + afterParserOrEnumRuleCall(); + } + ) +; + +// Entry rule entryRuleAndGate +entryRuleAndGate returns [EObject current=null]: + { newCompositeNode(grammarAccess.getAndGateRule()); } + iv_ruleAndGate=ruleAndGate + { $current=$iv_ruleAndGate.current; } + EOF; + +// Rule AndGate +ruleAndGate returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + ( + ( + lv_name_0_0=RULE_ID + { + newLeafNode(lv_name_0_0, grammarAccess.getAndGateAccess().getNameIDTerminalRuleCall_0_0()); + } + { + if ($current==null) { + $current = createModelElement(grammarAccess.getAndGateRule()); + } + setWithLastConsumed( + $current, + "name", + lv_name_0_0, + "org.eclipse.xtext.common.Terminals.ID"); + } + ) + ) + otherlv_1='and' + { + newLeafNode(otherlv_1, grammarAccess.getAndGateAccess().getAndKeyword_1()); + } + ( + ( + { + if ($current==null) { + $current = createModelElement(grammarAccess.getAndGateRule()); + } + } + otherlv_2=RULE_ID + { + newLeafNode(otherlv_2, grammarAccess.getAndGateAccess().getInputEventsEventDeclarationCrossReference_2_0()); + } + ) + )* + ) +; + +// Entry rule entryRuleOrGate +entryRuleOrGate returns [EObject current=null]: + { newCompositeNode(grammarAccess.getOrGateRule()); } + iv_ruleOrGate=ruleOrGate + { $current=$iv_ruleOrGate.current; } + EOF; + +// Rule OrGate +ruleOrGate returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + ( + ( + lv_name_0_0=RULE_ID + { + newLeafNode(lv_name_0_0, grammarAccess.getOrGateAccess().getNameIDTerminalRuleCall_0_0()); + } + { + if ($current==null) { + $current = createModelElement(grammarAccess.getOrGateRule()); + } + setWithLastConsumed( + $current, + "name", + lv_name_0_0, + "org.eclipse.xtext.common.Terminals.ID"); + } + ) + ) + otherlv_1='or' + { + newLeafNode(otherlv_1, grammarAccess.getOrGateAccess().getOrKeyword_1()); + } + ( + ( + { + if ($current==null) { + $current = createModelElement(grammarAccess.getOrGateRule()); + } + } + otherlv_2=RULE_ID + { + newLeafNode(otherlv_2, grammarAccess.getOrGateAccess().getInputEventsEventDeclarationCrossReference_2_0()); + } + ) + )* + ) +; + +// Entry rule entryRuleTransformationDefinition +entryRuleTransformationDefinition returns [EObject current=null]: + { newCompositeNode(grammarAccess.getTransformationDefinitionRule()); } + iv_ruleTransformationDefinition=ruleTransformationDefinition + { $current=$iv_ruleTransformationDefinition.current; } + EOF; + +// Rule TransformationDefinition +ruleTransformationDefinition returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + otherlv_0='transformation' + { + newLeafNode(otherlv_0, grammarAccess.getTransformationDefinitionAccess().getTransformationKeyword_0()); + } + ( + ( + lv_name_1_0=RULE_ID + { + newLeafNode(lv_name_1_0, grammarAccess.getTransformationDefinitionAccess().getNameIDTerminalRuleCall_1_0()); + } + { + if ($current==null) { + $current = createModelElement(grammarAccess.getTransformationDefinitionRule()); + } + setWithLastConsumed( + $current, + "name", + lv_name_1_0, + "org.eclipse.xtext.common.Terminals.ID"); + } + ) + ) + otherlv_2='{' + { + newLeafNode(otherlv_2, grammarAccess.getTransformationDefinitionAccess().getLeftCurlyBracketKeyword_2()); + } + ( + ( + { + newCompositeNode(grammarAccess.getTransformationDefinitionAccess().getMappingDefinitionsMappingDefinitionParserRuleCall_3_0()); + } + lv_mappingDefinitions_3_0=ruleMappingDefinition + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getTransformationDefinitionRule()); + } + add( + $current, + "mappingDefinitions", + lv_mappingDefinitions_3_0, + "hu.bme.mit.inf.dslreasoner.faulttree.components.CftLanguage.MappingDefinition"); + afterParserOrEnumRuleCall(); + } + ) + )* + otherlv_4='}' + { + newLeafNode(otherlv_4, grammarAccess.getTransformationDefinitionAccess().getRightCurlyBracketKeyword_4()); + } + ) +; + +// Entry rule entryRuleMappingDefinition +entryRuleMappingDefinition returns [EObject current=null]: + { newCompositeNode(grammarAccess.getMappingDefinitionRule()); } + iv_ruleMappingDefinition=ruleMappingDefinition + { $current=$iv_ruleMappingDefinition.current; } + EOF; + +// Rule MappingDefinition +ruleMappingDefinition returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + ( + ( + lv_topLevel_0_0='toplevel' + { + newLeafNode(lv_topLevel_0_0, grammarAccess.getMappingDefinitionAccess().getTopLevelToplevelKeyword_0_0()); + } + { + if ($current==null) { + $current = createModelElement(grammarAccess.getMappingDefinitionRule()); + } + setWithLastConsumed($current, "topLevel", true, "toplevel"); + } + ) + )? + otherlv_1='mapping' + { + newLeafNode(otherlv_1, grammarAccess.getMappingDefinitionAccess().getMappingKeyword_1()); + } + ( + ( + { + if ($current==null) { + $current = createModelElement(grammarAccess.getMappingDefinitionRule()); + } + } + { + newCompositeNode(grammarAccess.getMappingDefinitionAccess().getPatternPatternCrossReference_2_0()); + } + ruleQualifiedName + { + afterParserOrEnumRuleCall(); + } + ) + ) + otherlv_3='(' + { + newLeafNode(otherlv_3, grammarAccess.getMappingDefinitionAccess().getLeftParenthesisKeyword_3()); + } + ( + ( + { + newCompositeNode(grammarAccess.getMappingDefinitionAccess().getParametersMappingParameterParserRuleCall_4_0()); + } + lv_parameters_4_0=ruleMappingParameter + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getMappingDefinitionRule()); + } + add( + $current, + "parameters", + lv_parameters_4_0, + "hu.bme.mit.inf.dslreasoner.faulttree.components.CftLanguage.MappingParameter"); + afterParserOrEnumRuleCall(); + } + ) + ) + ( + otherlv_5=',' + { + newLeafNode(otherlv_5, grammarAccess.getMappingDefinitionAccess().getCommaKeyword_5_0()); + } + ( + ( + { + newCompositeNode(grammarAccess.getMappingDefinitionAccess().getParametersMappingParameterParserRuleCall_5_1_0()); + } + lv_parameters_6_0=ruleMappingParameter + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getMappingDefinitionRule()); + } + add( + $current, + "parameters", + lv_parameters_6_0, + "hu.bme.mit.inf.dslreasoner.faulttree.components.CftLanguage.MappingParameter"); + afterParserOrEnumRuleCall(); + } + ) + ) + )* + otherlv_7=')' + { + newLeafNode(otherlv_7, grammarAccess.getMappingDefinitionAccess().getRightParenthesisKeyword_6()); + } + ( + ( + { + newCompositeNode(grammarAccess.getMappingDefinitionAccess().getComponentInstanceComponentInstanceParserRuleCall_7_0()); + } + lv_componentInstance_8_0=ruleComponentInstance + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getMappingDefinitionRule()); + } + set( + $current, + "componentInstance", + lv_componentInstance_8_0, + "hu.bme.mit.inf.dslreasoner.faulttree.components.CftLanguage.ComponentInstance"); + afterParserOrEnumRuleCall(); + } + ) + )? + ( + otherlv_9='{' + { + newLeafNode(otherlv_9, grammarAccess.getMappingDefinitionAccess().getLeftCurlyBracketKeyword_8_0()); + } + ( + ( + ( + ( + { + newCompositeNode(grammarAccess.getMappingDefinitionAccess().getLookupDefinitionsLookupDefinitionParserRuleCall_8_1_0_0_0()); + } + lv_lookupDefinitions_10_0=ruleLookupDefinition + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getMappingDefinitionRule()); + } + add( + $current, + "lookupDefinitions", + lv_lookupDefinitions_10_0, + "hu.bme.mit.inf.dslreasoner.faulttree.components.CftLanguage.LookupDefinition"); + afterParserOrEnumRuleCall(); + } + ) + ) + | + ( + ( + { + newCompositeNode(grammarAccess.getMappingDefinitionAccess().getAssignmentsAssignmentParserRuleCall_8_1_0_1_0()); + } + lv_assignments_11_0=ruleAssignment + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getMappingDefinitionRule()); + } + add( + $current, + "assignments", + lv_assignments_11_0, + "hu.bme.mit.inf.dslreasoner.faulttree.components.CftLanguage.Assignment"); + afterParserOrEnumRuleCall(); + } + ) + ) + ) + otherlv_12=';' + { + newLeafNode(otherlv_12, grammarAccess.getMappingDefinitionAccess().getSemicolonKeyword_8_1_1()); + } + )* + otherlv_13='}' + { + newLeafNode(otherlv_13, grammarAccess.getMappingDefinitionAccess().getRightCurlyBracketKeyword_8_2()); + } + )? + ) +; + +// Entry rule entryRuleMappingParameter +entryRuleMappingParameter returns [EObject current=null]: + { newCompositeNode(grammarAccess.getMappingParameterRule()); } + iv_ruleMappingParameter=ruleMappingParameter + { $current=$iv_ruleMappingParameter.current; } + EOF; + +// Rule MappingParameter +ruleMappingParameter returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + ( + lv_name_0_0=RULE_ID + { + newLeafNode(lv_name_0_0, grammarAccess.getMappingParameterAccess().getNameIDTerminalRuleCall_0()); + } + { + if ($current==null) { + $current = createModelElement(grammarAccess.getMappingParameterRule()); + } + setWithLastConsumed( + $current, + "name", + lv_name_0_0, + "org.eclipse.xtext.common.Terminals.ID"); + } + ) + ) +; + +// Entry rule entryRuleLookupDefinition +entryRuleLookupDefinition returns [EObject current=null]: + { newCompositeNode(grammarAccess.getLookupDefinitionRule()); } + iv_ruleLookupDefinition=ruleLookupDefinition + { $current=$iv_ruleLookupDefinition.current; } + EOF; + +// Rule LookupDefinition +ruleLookupDefinition returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + otherlv_0='lookup' + { + newLeafNode(otherlv_0, grammarAccess.getLookupDefinitionAccess().getLookupKeyword_0()); + } + ( + ( + { + if ($current==null) { + $current = createModelElement(grammarAccess.getLookupDefinitionRule()); + } + } + otherlv_1=RULE_ID + { + newLeafNode(otherlv_1, grammarAccess.getLookupDefinitionAccess().getMappingMappingDefinitionCrossReference_1_0()); + } + ) + ) + otherlv_2='(' + { + newLeafNode(otherlv_2, grammarAccess.getLookupDefinitionAccess().getLeftParenthesisKeyword_2()); + } + ( + ( + { + if ($current==null) { + $current = createModelElement(grammarAccess.getLookupDefinitionRule()); + } + } + otherlv_3=RULE_ID + { + newLeafNode(otherlv_3, grammarAccess.getLookupDefinitionAccess().getArgumentsMappingParameterCrossReference_3_0()); + } + ) + ) + ( + otherlv_4=',' + { + newLeafNode(otherlv_4, grammarAccess.getLookupDefinitionAccess().getCommaKeyword_4_0()); + } + ( + ( + { + if ($current==null) { + $current = createModelElement(grammarAccess.getLookupDefinitionRule()); + } + } + otherlv_5=RULE_ID + { + newLeafNode(otherlv_5, grammarAccess.getLookupDefinitionAccess().getArgumentsMappingParameterCrossReference_4_1_0()); + } + ) + ) + )* + otherlv_6=')' + { + newLeafNode(otherlv_6, grammarAccess.getLookupDefinitionAccess().getRightParenthesisKeyword_5()); + } + otherlv_7='as' + { + newLeafNode(otherlv_7, grammarAccess.getLookupDefinitionAccess().getAsKeyword_6()); + } + ( + ( + lv_name_8_0=RULE_ID + { + newLeafNode(lv_name_8_0, grammarAccess.getLookupDefinitionAccess().getNameIDTerminalRuleCall_7_0()); + } + { + if ($current==null) { + $current = createModelElement(grammarAccess.getLookupDefinitionRule()); + } + setWithLastConsumed( + $current, + "name", + lv_name_8_0, + "org.eclipse.xtext.common.Terminals.ID"); + } + ) + ) + ) +; + +// Entry rule entryRuleAssignment +entryRuleAssignment returns [EObject current=null]: + { newCompositeNode(grammarAccess.getAssignmentRule()); } + iv_ruleAssignment=ruleAssignment + { $current=$iv_ruleAssignment.current; } + EOF; + +// Rule Assignment +ruleAssignment returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + ( + ( + { + newCompositeNode(grammarAccess.getAssignmentAccess().getInputEventReferenceParserRuleCall_0_0()); + } + lv_input_0_0=ruleEventReference + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getAssignmentRule()); + } + set( + $current, + "input", + lv_input_0_0, + "hu.bme.mit.inf.dslreasoner.faulttree.components.CftLanguage.EventReference"); + afterParserOrEnumRuleCall(); + } + ) + ) + ( + ( + ( + lv_multiple_1_0='+=' + { + newLeafNode(lv_multiple_1_0, grammarAccess.getAssignmentAccess().getMultiplePlusSignEqualsSignKeyword_1_0_0()); + } + { + if ($current==null) { + $current = createModelElement(grammarAccess.getAssignmentRule()); + } + setWithLastConsumed($current, "multiple", true, "+="); + } + ) + ) + | + otherlv_2=':=' + { + newLeafNode(otherlv_2, grammarAccess.getAssignmentAccess().getColonEqualsSignKeyword_1_1()); + } + ) + ( + ( + { + newCompositeNode(grammarAccess.getAssignmentAccess().getOutputEventReferenceParserRuleCall_2_0()); + } + lv_output_3_0=ruleEventReference + { + if ($current==null) { + $current = createModelElementForParent(grammarAccess.getAssignmentRule()); + } + set( + $current, + "output", + lv_output_3_0, + "hu.bme.mit.inf.dslreasoner.faulttree.components.CftLanguage.EventReference"); + afterParserOrEnumRuleCall(); + } + ) + ) + ) +; + +// Entry rule entryRuleEventReference +entryRuleEventReference returns [EObject current=null]: + { newCompositeNode(grammarAccess.getEventReferenceRule()); } + iv_ruleEventReference=ruleEventReference + { $current=$iv_ruleEventReference.current; } + EOF; + +// Rule EventReference +ruleEventReference returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + ( + ( + { + if ($current==null) { + $current = createModelElement(grammarAccess.getEventReferenceRule()); + } + } + otherlv_0=RULE_ID + { + newLeafNode(otherlv_0, grammarAccess.getEventReferenceAccess().getComponentVariableCrossReference_0_0()); + } + ) + ) + otherlv_1='.' + { + newLeafNode(otherlv_1, grammarAccess.getEventReferenceAccess().getFullStopKeyword_1()); + } + ( + ( + { + if ($current==null) { + $current = createModelElement(grammarAccess.getEventReferenceRule()); + } + } + otherlv_2=RULE_ID + { + newLeafNode(otherlv_2, grammarAccess.getEventReferenceAccess().getEventEventDeclarationCrossReference_2_0()); + } + ) + ) + ) +; + +// Entry rule entryRuleComponentInstance +entryRuleComponentInstance returns [EObject current=null]: + { newCompositeNode(grammarAccess.getComponentInstanceRule()); } + iv_ruleComponentInstance=ruleComponentInstance + { $current=$iv_ruleComponentInstance.current; } + EOF; + +// Rule ComponentInstance +ruleComponentInstance returns [EObject current=null] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + otherlv_0='=>' + { + newLeafNode(otherlv_0, grammarAccess.getComponentInstanceAccess().getEqualsSignGreaterThanSignKeyword_0()); + } + ( + ( + { + if ($current==null) { + $current = createModelElement(grammarAccess.getComponentInstanceRule()); + } + } + { + newCompositeNode(grammarAccess.getComponentInstanceAccess().getComponentTypeComponentDefinitionCrossReference_1_0()); + } + ruleQualifiedName + { + afterParserOrEnumRuleCall(); + } + ) + ) + ( + ( + lv_name_2_0=RULE_ID + { + newLeafNode(lv_name_2_0, grammarAccess.getComponentInstanceAccess().getNameIDTerminalRuleCall_2_0()); + } + { + if ($current==null) { + $current = createModelElement(grammarAccess.getComponentInstanceRule()); + } + setWithLastConsumed( + $current, + "name", + lv_name_2_0, + "org.eclipse.xtext.common.Terminals.ID"); + } + ) + )? + ) +; + +// Entry rule entryRuleQualifiedName +entryRuleQualifiedName returns [String current=null]: + { newCompositeNode(grammarAccess.getQualifiedNameRule()); } + iv_ruleQualifiedName=ruleQualifiedName + { $current=$iv_ruleQualifiedName.current.getText(); } + EOF; + +// Rule QualifiedName +ruleQualifiedName returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + this_ID_0=RULE_ID + { + $current.merge(this_ID_0); + } + { + newLeafNode(this_ID_0, grammarAccess.getQualifiedNameAccess().getIDTerminalRuleCall_0()); + } + ( + kw='.' + { + $current.merge(kw); + newLeafNode(kw, grammarAccess.getQualifiedNameAccess().getFullStopKeyword_1_0()); + } + this_ID_2=RULE_ID + { + $current.merge(this_ID_2); + } + { + newLeafNode(this_ID_2, grammarAccess.getQualifiedNameAccess().getIDTerminalRuleCall_1_1()); + } + )* + ) +; + +// Entry rule entryRuleQualifiedNameWithWildcard +entryRuleQualifiedNameWithWildcard returns [String current=null]: + { newCompositeNode(grammarAccess.getQualifiedNameWithWildcardRule()); } + iv_ruleQualifiedNameWithWildcard=ruleQualifiedNameWithWildcard + { $current=$iv_ruleQualifiedNameWithWildcard.current.getText(); } + EOF; + +// Rule QualifiedNameWithWildcard +ruleQualifiedNameWithWildcard returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] +@init { + enterRule(); +} +@after { + leaveRule(); +}: + ( + { + newCompositeNode(grammarAccess.getQualifiedNameWithWildcardAccess().getQualifiedNameParserRuleCall_0()); + } + this_QualifiedName_0=ruleQualifiedName + { + $current.merge(this_QualifiedName_0); + } + { + afterParserOrEnumRuleCall(); + } + ( + kw='.' + { + $current.merge(kw); + newLeafNode(kw, grammarAccess.getQualifiedNameWithWildcardAccess().getFullStopKeyword_1_0()); + } + kw='*' + { + $current.merge(kw); + newLeafNode(kw, grammarAccess.getQualifiedNameWithWildcardAccess().getAsteriskKeyword_1_1()); + } + )? + ) +; + +RULE_DOULBE : ('0'..'9')+ ('.' ('0'..'9')+|('.' ('0'..'9')+)? ('e'|'E') ('+'|'-')? ('0'..'9')+); + +RULE_ID : '^'? ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*; + +RULE_INT : ('0'..'9')+; + +RULE_STRING : ('"' ('\\' .|~(('\\'|'"')))* '"'|'\'' ('\\' .|~(('\\'|'\'')))* '\''); + +RULE_ML_COMMENT : '/*' ( options {greedy=false;} : . )*'*/'; + +RULE_SL_COMMENT : '//' ~(('\n'|'\r'))* ('\r'? '\n')?; + +RULE_WS : (' '|'\t'|'\r'|'\n')+; + +RULE_ANY_OTHER : .; -- cgit v1.2.3-54-g00ecf