Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 5e7cea27dc7952367e8e9f9b743ba079b29f502f (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
77
78
79
80
81
82
83
84
85
/*******************************************************************************
 * Copyright (c) 2010 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:
 * 		Thomas Schuetz and Henrik Rentz-Reichert (initial contribution)
 * 
 *******************************************************************************/

package org.eclipse.etrice.core.genmodel.etricegen;

import org.eclipse.etrice.core.room.CPBranchTransition;
import org.eclipse.etrice.core.room.ContinuationTransition;
import org.eclipse.etrice.core.room.State;
import org.eclipse.etrice.core.room.Transition;

/**
 * This interface describes the transition chain visitor.
 * The visitor is used by the code generator to generate the code associated with a transition chain.
 * It is passed in a call to
 * {@link org.eclipse.etrice.core.genmodel.etricegen.TransitionChain#genExecuteChain(ITransitionChainVisitor)
 * TransitionChain.genExecuteChain(ITransitionChainVisitor)}.
 * 
 * <p>
 * The visitor has to be implemented by the concrete target language generator.
 * </p>
 * 
 * @author Henrik Rentz-Reichert
 *
 */
public interface ITransitionChainVisitor {
	
	/**
	 * @param tc the transition chain
	 * @return a typed declaration of the data associated with this message 
	 */
	String genTypedData(TransitionChain tc);
	
	/**
	 * @param tr a transition
	 * @return a call of the action operation (as generated by the generator)
	 */
	String genActionOperationCall(Transition tr);
	
	/**
	 * @param state a state
	 * @return a call of the entry operation (as generated by the generator)
	 */
	String genEntryOperationCall(State state);
	
	/**
	 * @param state a state
	 * @return a call of the exit operation (as generated by the generator)
	 */
	String genExitOperationCall(State state);
	
	/**
	 * @param tr a choice point branch transition (not the default branch)
	 * @param isFirst <code>true</code> if this is the first of a series of if statements
	 * @return code for the [else] if statement with condition (guard) and block opening
	 */
	String genElseIfBranch(CPBranchTransition tr, boolean isFirst);
	
	/**
	 * @param tr the choice point default branch transition
	 * @return code for the final else with block opening
	 */
	String genElseBranch(ContinuationTransition tr);
	
	/**
	 * @return the final closing of the block
	 */
	String genEndIf();
	
	/**
	 * @param state a state
	 * @param executeEntryCode <code>true</code> if entry code of state should be executed
	 * @return a return statement with the ID of the state
	 */
	String genReturnState(State state, boolean executeEntryCode);

}

Back to the top