12 #ifndef FAUDES_EMBEDDEDC_H
13 #define FAUDES_EMBEDDEDC_H
15 #include "libfaudes.h"
18 using namespace faudes;
97 virtual void Clear(
void);
105 void DoCompile(
void);
108 void DoGenerate(
void);
111 virtual void DecrementTimers(
void);
112 void InsertExecHooks(
void);
115 virtual std::string TargetAddress(
const AA& address);
118 virtual AX TargetExpression(
const AA& address);
127 virtual void Comment(
const std::string& text);
130 virtual void IntegerDeclare(
const AA& address);
131 virtual void IntegerDeclare(
const AA& address,
int val);
132 virtual void IntegerAssign(
const AA& address,
int val);
133 virtual void IntegerAssign(
const AA& address,
const AX& expression);
134 virtual void IntegerIncrement(
const AA& address,
int val=1);
135 virtual AX IntegerQuotient(
const AX& expression,
int val);
136 virtual AX IntegerRemainder(
const AX& expression,
int val);
137 virtual AX IntegerBitmask(
const AX& expression);
138 virtual AX IntegerIsEq(
const AA& address,
int val);
139 virtual AX IntegerIsEq(
const AA& address,
const AX& expression);
140 virtual AX IntegerIsNotEq(
const AA& address,
int val);
141 virtual AX IntegerIsNotEq(
const AA& address,
const AX& expression);
142 virtual AX IntegerIsGreater(
const AA& address,
int val);
143 virtual AX IntegerIsLess(
const AA& address,
int val);
144 virtual AX IntegerConstant(
int val);
147 virtual bool HasIntmaths(
void);
148 virtual void WordDeclare(
const AA& address);
149 virtual void WordDeclare(
const AA& address,
word_t val);
150 virtual void WordAssign(
const AA& address,
word_t val);
151 virtual void WordAssign(
const AA& address,
const AX& expression);
152 virtual void WordOr(
const AA& address,
word_t val);
153 virtual void WordOr(
const AA& address,
const AX& expression);
154 virtual void WordOr(
const AA& address,
const AA& op1,
const AA& op2);
155 virtual void WordOr(
const AA& address,
const AA& op1,
word_t op2);
156 virtual void WordAnd(
const AA& address,
word_t val);
157 virtual void WordAnd(
const AA& address,
const AX& expression);
158 virtual void WordAnd(
const AA& address,
const AA& op1,
const AA& op2);
159 virtual void WordAnd(
const AA& address,
const AA& op1,
word_t op2);
160 virtual void WordNand(
const AA& address,
const AX& expression);
161 virtual AX WordIsBitSet(
const AA& address,
int idx);
162 virtual AX WordIsBitClr(
const AA& address,
int idx);
163 virtual AX WordIsMaskSet(
const AA& address,
word_t mask);
164 virtual AX WordIsEq(
const AA& address,
word_t val);
165 virtual AX WordIsNotEq(
const AA& address,
word_t val);
166 virtual AX WordConstant(
word_t val);
169 virtual AX StringConstant(
const std::string& val);
172 virtual void CintarrayDeclare(
const AA& address,
int offset,
const std::vector<int>& val);
173 virtual AA CintarrayAccess(
const AA& address,
int index);
174 virtual AA CintarrayAccess(
const AA& address,
const AA& indexaddr);
175 virtual bool HasCintarray(
void);
176 virtual void CwordarrayDeclare(
const AA& address,
int offset,
const std::vector<word_t>& val);
177 virtual AA CwordarrayAccess(
const AA& address,
int index);
178 virtual AA CwordarrayAccess(
const AA& address,
const AA& indexaddr);
179 virtual bool HasCwordarray(
void);
180 virtual void CstrarrayDeclare(
const AA& address,
int offset,
const std::vector<std::string>& val);
181 virtual AA CstrarrayAccess(
const AA& address,
int index);
182 virtual AA CstrarrayAccess(
const AA& address,
const AA& indexaddr);
183 virtual bool HasCstrarray(
void);
184 virtual void IntarrayDeclare(
const AA& address,
int offset,
int len);
185 virtual void IntarrayDeclare(
const AA& address,
int offset,
const std::vector<int>& val);
186 virtual AA IntarrayAccess(
const AA& address,
int index);
187 virtual AA IntarrayAccess(
const AA& address,
const AA& indexaddr);
188 virtual bool HasIntarray(
void);
189 virtual void WordarrayDeclare(
const AA& address,
int offset,
int len);
190 virtual void WordarrayDeclare(
const AA& address,
int offset,
const std::vector<word_t>& val);
191 virtual AA WordarrayAccess(
const AA& address,
int index);
192 virtual AA WordarrayAccess(
const AA& address,
const AA& indexaddr);
193 virtual bool HasWordarray(
void);
197 virtual void IfTrue(
const AX& expression);
198 virtual void IfFalse(
const AX& expression);
199 virtual void IfWord(
const AX& expression);
200 virtual void IfElse(
void);
201 virtual void IfElseIfTrue(
const AX& expression);
202 virtual void IfEnd(
void);
205 virtual void SwitchBegin(
const AA& address);
206 virtual void SwitchCase(
const AA& address,
int val);
207 virtual void SwitchCases(
const AA& address,
int from,
int to);
208 virtual void SwitchCases(
const AA& address,
const std::set< int>& vals);
209 virtual void SwitchBreak(
void);
210 virtual void SwitchEnd(
void);
211 virtual bool HasMultiCase(
void);
214 virtual void LoopBegin(
void);
215 virtual void LoopBreak(
const AX& expression);
216 virtual void LoopEnd(
void);
217 virtual void FunctionReturn(
void);
220 virtual void RunActionSet(
const std::string& address);
221 virtual void RunActionClr(
const std::string& address);
222 virtual void RunActionExe(
const AX& expression);
225 virtual void TimerDeclare(
const AA& address,
const std::string& litval);
226 virtual void TimerStart(
const AA& address);
227 virtual void TimerStop(
const AA& address);
228 virtual void TimerReset(
const AA& address,
const std::string& litval);
229 virtual AX TimerIsElapsed(
const AA& address);
234 AX IntarrayConstant(
int offset,
const std::vector<int>& val);
235 AX WordarrayConstant(
int offset,
const std::vector<word_t>& val);
236 AX StrarrayConstant(
int offset,
const std::vector<std::string>& val);
252 virtual void DoReadTargetConfiguration(TokenReader& rTr);
265 virtual void DoWriteTargetConfiguration(TokenWriter& rTw)
const;
Code-generator with abstract types and operations.
unsigned long word_t
Code-generator internal data type of target words.
Abstract address; see also Absstract_Addresses.
Abstract expression; see also Absstract_Addresses.
Execution semantics in terms of code primitives.
Implementation of code primitives by generic C-code.