Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.etrice.core.config/src/org/eclipse/etrice/core/Config.xtext')
-rw-r--r--plugins/org.eclipse.etrice.core.config/src/org/eclipse/etrice/core/Config.xtext330
1 files changed, 165 insertions, 165 deletions
diff --git a/plugins/org.eclipse.etrice.core.config/src/org/eclipse/etrice/core/Config.xtext b/plugins/org.eclipse.etrice.core.config/src/org/eclipse/etrice/core/Config.xtext
index 0bda121fb..bc734be63 100644
--- a/plugins/org.eclipse.etrice.core.config/src/org/eclipse/etrice/core/Config.xtext
+++ b/plugins/org.eclipse.etrice.core.config/src/org/eclipse/etrice/core/Config.xtext
@@ -1,165 +1,165 @@
-/*******************************************************************************
- * Copyright (c) 2012 protos software gmbh (http://www.protos.de).
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * CONTRIBUTORS:
- * Juergen Haug and Thomas Schuetz (initial contribution)
- *
- *******************************************************************************/
-grammar org.eclipse.etrice.core.Config with org.eclipse.xtext.common.Terminals
-
-generate config "http://www.eclipse.org/etrice/core/Config"
-import "http://www.eclipse.org/emf/2002/Ecore" as ecore
-import "http://www.eclipse.org/etrice/Room" as room
-
-ConfigModel:
- 'ConfigModel' name=FQN '{'
- imports+=Import*
- configElements+=ConfigElement*
- '}';
-
-ConfigElement:
- SubSystemConfig | ActorClassConfig | ActorInstanceConfig | ProtocolClassConfig;
-
-SubSystemConfig:
- 'SubSystemConfig' root=[room::LogicalSystem|FQN] '/' subSystem=[room::SubSystemRef|ID] '{'
- dynConfig=DynamicConfig
- '}';
-
-DynamicConfig:
- 'dynamic configuration' '{'
- ((('file path' filePath=STRING) |
- (('user import' userCode1=STRING)
- ('user constructor' userCode2=STRING))) &
- ('polling timer [ms]' polling=INT)?)
- '}';
-
-ActorClassConfig:
- 'ActorClassConfig' actor=[room::ActorClass|FQN] '{'
- (attributes+=AttrClassConfig)*
- '}';
-
-ActorInstanceConfig:
- 'ActorInstanceConfig' root=[room::LogicalSystem|FQN] '/' subSystem=[room::SubSystemRef|ID] '/' path=RefPath '{'
- ((attributes+=AttrInstanceConfig)* &
- (ports+=PortInstanceConfig)*)
- '}';
-
-ProtocolClassConfig:
- 'ProtocolClassConfig' protocol=[room::ProtocolClass|FQN] '{'
- (('regular' regular=PortClassConfig)? &
- ('conjugate' conjugated=PortClassConfig)?)
- '}';
-
-PortClassConfig:
- {PortClassConfig} 'Port' '{'
- (attributes+=AttrClassConfig)*
- '}';
-
-PortInstanceConfig:
- 'InterfaceItem' item=[room::InterfaceItem|ID] '{'
- (attributes+=AttrInstanceConfig)*
- '}';
-
-AttrConfig:
- AttrClassConfig | AttrInstanceConfig;
-
-AttrClassConfig:
- 'Attr' attribute=[room::Attribute] ('=' value=LiteralArray)? ('{'
- (('min' '=' min=NumberLiteral)?
- ('max' '=' max=NumberLiteral)?
- (attributes+=AttrClassConfig)*)
- '}')?;
-
-AttrInstanceConfig:
- 'Attr' attribute=[room::Attribute] ('=' value=LiteralArray)? ('{'
- ((dynConfig?='dynamic configuration' (readOnly?='read' | 'write'))?
- (attributes+=AttrInstanceConfig*))
- '}')?;
-
-RefPath:
- refs+=ID ('/' refs+=ID)*;
-
- // -------------------- from org.eclipse.etrice.core.Room.xtext ---------------
-Import:
- 'import' (importedNamespace=ImportedFQN 'from' | 'model') importURI=STRING;
-
-ImportedFQN:
- FQN ('.*')?;
-
-FQN:
- ID ('.' ID)*;
-
- // -----------------------------------------------------------------------------
-
-//enum Unit:
-// N|
-// W|
-// S = 's'|
-// KG = 'kg'|
-// M = 'm'|
-// C|
-// NM|
-// RPM|
-// V|
-// A|
-// HZ = 'Hz'|
-// KW
-//;
-
-LiteralArray:
- literals+=Literal (',' literals+=Literal)*;
-
- // Value Types for Attributes
-Literal:
- BooleanLiteral |
- NumberLiteral |
- StringLiteral;
-
-BooleanLiteral:
- {BooleanLiteral} ('false' | isTrue?='true');
-
-NumberLiteral:
- IntLiteral | RealLiteral;
-
-RealLiteral:
- {RealLiteral} value=Real;
-
-IntLiteral:
- {IntLiteral} value=Integer;
-
-StringLiteral:
- {StringLiteral} value=STRING;
-
-Integer returns ecore::ELong:
- SignedInteger | Hexadecimal;
-
-SignedInteger hidden():
- ('+' | '-')? INT;
-
-Hexadecimal hidden():
- HEX;
-
-Real returns ecore::EDouble:
- Decimal | DotDecimal | DecimalDot | DecimalExp;
-
-Decimal hidden():
- ('+' | '-')? INT '.' INT;
-
-DotDecimal hidden():
- ('+' | '-')? '.' INT;
-
-DecimalDot hidden():
- ('+' | '-')? INT '.';
-
-DecimalExp hidden():
- ('+' | '-')? INT '.' INT EXP;
-
-terminal EXP:
- ('e' | 'E') ('+' | '-')? ('0'..'9')+;
-
-terminal HEX:
- ('0x' | '0X') ('0'..'9' | 'a'..'f' | 'A'..'F')+;
+/*******************************************************************************
+ * Copyright (c) 2012 protos software gmbh (http://www.protos.de).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * CONTRIBUTORS:
+ * Juergen Haug and Thomas Schuetz (initial contribution)
+ *
+ *******************************************************************************/
+grammar org.eclipse.etrice.core.Config with org.eclipse.xtext.common.Terminals
+
+generate config "http://www.eclipse.org/etrice/core/Config"
+import "http://www.eclipse.org/emf/2002/Ecore" as ecore
+import "http://www.eclipse.org/etrice/Room" as room
+
+ConfigModel:
+ 'ConfigModel' name=FQN '{'
+ imports+=Import*
+ configElements+=ConfigElement*
+ '}';
+
+ConfigElement:
+ SubSystemConfig | ActorClassConfig | ActorInstanceConfig | ProtocolClassConfig;
+
+SubSystemConfig:
+ 'SubSystemConfig' root=[room::LogicalSystem|FQN] '/' subSystem=[room::SubSystemRef|ID] '{'
+ dynConfig=DynamicConfig
+ '}';
+
+DynamicConfig:
+ 'dynamic configuration' '{'
+ ((('file path' filePath=STRING) |
+ (('user import' userCode1=STRING)
+ ('user constructor' userCode2=STRING))) &
+ ('polling timer [ms]' polling=INT)?)
+ '}';
+
+ActorClassConfig:
+ 'ActorClassConfig' actor=[room::ActorClass|FQN] '{'
+ (attributes+=AttrClassConfig)*
+ '}';
+
+ActorInstanceConfig:
+ 'ActorInstanceConfig' root=[room::LogicalSystem|FQN] '/' subSystem=[room::SubSystemRef|ID] '/' path=RefPath '{'
+ ((attributes+=AttrInstanceConfig)* &
+ (ports+=PortInstanceConfig)*)
+ '}';
+
+ProtocolClassConfig:
+ 'ProtocolClassConfig' protocol=[room::ProtocolClass|FQN] '{'
+ (('regular' regular=PortClassConfig)? &
+ ('conjugate' conjugated=PortClassConfig)?)
+ '}';
+
+PortClassConfig:
+ {PortClassConfig} 'Port' '{'
+ (attributes+=AttrClassConfig)*
+ '}';
+
+PortInstanceConfig:
+ 'InterfaceItem' item=[room::InterfaceItem|ID] '{'
+ (attributes+=AttrInstanceConfig)*
+ '}';
+
+AttrConfig:
+ AttrClassConfig | AttrInstanceConfig;
+
+AttrClassConfig:
+ 'Attr' attribute=[room::Attribute] ('=' value=LiteralArray)? ('{'
+ (('min' '=' min=NumberLiteral)?
+ ('max' '=' max=NumberLiteral)?
+ (attributes+=AttrClassConfig)*)
+ '}')?;
+
+AttrInstanceConfig:
+ 'Attr' attribute=[room::Attribute] ('=' value=LiteralArray)? ('{'
+ ((dynConfig?='dynamic configuration' (readOnly?='read' | 'write'))?
+ (attributes+=AttrInstanceConfig*))
+ '}')?;
+
+RefPath:
+ refs+=ID ('/' refs+=ID)*;
+
+ // -------------------- from org.eclipse.etrice.core.Room.xtext ---------------
+Import:
+ 'import' (importedNamespace=ImportedFQN 'from' | 'model') importURI=STRING;
+
+ImportedFQN:
+ FQN ('.*')?;
+
+FQN:
+ ID ('.' ID)*;
+
+ // -----------------------------------------------------------------------------
+
+//enum Unit:
+// N|
+// W|
+// S = 's'|
+// KG = 'kg'|
+// M = 'm'|
+// C|
+// NM|
+// RPM|
+// V|
+// A|
+// HZ = 'Hz'|
+// KW
+//;
+
+LiteralArray:
+ literals+=Literal (',' literals+=Literal)*;
+
+ // Value Types for Attributes
+Literal:
+ BooleanLiteral |
+ NumberLiteral |
+ StringLiteral;
+
+BooleanLiteral:
+ {BooleanLiteral} ('false' | isTrue?='true');
+
+NumberLiteral:
+ IntLiteral | RealLiteral;
+
+RealLiteral:
+ {RealLiteral} value=Real;
+
+IntLiteral:
+ {IntLiteral} value=Integer;
+
+StringLiteral:
+ {StringLiteral} value=STRING;
+
+Integer returns ecore::ELong:
+ SignedInteger | Hexadecimal;
+
+SignedInteger hidden():
+ ('+' | '-')? INT;
+
+Hexadecimal hidden():
+ HEX;
+
+Real returns ecore::EDouble:
+ Decimal | DotDecimal | DecimalDot | DecimalExp;
+
+Decimal hidden():
+ ('+' | '-')? INT '.' INT;
+
+DotDecimal hidden():
+ ('+' | '-')? '.' INT;
+
+DecimalDot hidden():
+ ('+' | '-')? INT '.';
+
+DecimalExp hidden():
+ ('+' | '-')? INT '.' INT EXP;
+
+terminal EXP:
+ ('e' | 'E') ('+' | '-')? ('0'..'9')+;
+
+terminal HEX:
+ ('0x' | '0X') ('0'..'9' | 'a'..'f' | 'A'..'F')+;

Back to the top