Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 495cd01eef25bf40112994a61825b307bac87bbf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*******************************************************************************
 * 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:
 * 		Henrik Rentz-Reichert (initial contribution)
 * 
 *******************************************************************************/

grammar org.eclipse.etrice.core.etphys.ETPhys with org.eclipse.etrice.core.common.Base

generate eTPhys "http://www.eclipse.org/etrice/core/etphys/ETPhys"
import "http://www.eclipse.org/etrice/core/common/Base"

import "http://www.eclipse.org/emf/2002/Ecore" as ecore

PhysicalModel:
	'PhysicalModel' name=FQN '{'
		(imports+=Import)*
		(
			systems+=PhysicalSystem |
			nodeClasses+=NodeClass |
			runtimeClasses+=RuntimeClass
		)*
	'}'
;

PhysicalSystem:
	'PhysicalSystem' name=ID (docu=Documentation)? '{'
		nodeRefs+=NodeRef*
	'}'
;

NodeRef:
	'NodeRef' name=ID ':' type=[NodeClass|FQN] (docu=Documentation)?
;

NodeClass:
	'NodeClass'name=ID (docu=Documentation)? '{'
		('runtime' '=' runtime=[RuntimeClass|FQN] &
		'priomin' '=' priomin=Integer &
		'priomax' '=' priomax=Integer)
		threads+=PhysicalThread*
	'}'
;

PhysicalThread:
	(default?='DefaultThread' | 'Thread') name=ID '{'
		('execmode' '=' execmode=ExecMode &
		('interval' '=' time=TIME)? &
		'prio' '=' prio=Integer &
		'stacksize' '=' stacksize=INT &
		'msgblocksize' '=' msgblocksize=INT &
		'msgpoolsize' '=' msgpoolsize=INT)
	'}'
;

enum ExecMode:
	POLLED='polled' |
	BLOCKED='blocked' |
	MIXED='mixed'
;

RuntimeClass:
	'RuntimeClass' name=ID (docu=Documentation)? '{'
		'model' '=' threadModel=ThreadModel
	'}'
;

enum ThreadModel:
	SINGLE_THREADED='singleThreaded' |
	MULTI_THREADED='multiThreaded'
;

Back to the top