144 |
printf(")\n"); |
printf(")\n"); |
145 |
} |
} |
146 |
|
|
147 |
|
bool Args::isPolyphonic() const { |
148 |
|
for (int i = 0; i < args.size(); ++i) |
149 |
|
if (args[i]->isPolyphonic()) |
150 |
|
return true; |
151 |
|
return false; |
152 |
|
} |
153 |
|
|
154 |
EventHandlers::EventHandlers() { |
EventHandlers::EventHandlers() { |
155 |
//printf("EventHandlers::Constructor 0x%lx\n", (long long)this); |
//printf("EventHandlers::Constructor 0x%lx\n", (long long)this); |
156 |
} |
} |
184 |
return const_cast<EventHandler*>(&*args.at(index)); |
return const_cast<EventHandler*>(&*args.at(index)); |
185 |
} |
} |
186 |
|
|
187 |
|
bool EventHandlers::isPolyphonic() const { |
188 |
|
for (int i = 0; i < args.size(); ++i) |
189 |
|
if (args[i]->isPolyphonic()) |
190 |
|
return true; |
191 |
|
return false; |
192 |
|
} |
193 |
|
|
194 |
Assignment::Assignment(VariableRef variable, ExpressionRef value) |
Assignment::Assignment(VariableRef variable, ExpressionRef value) |
195 |
: variable(variable), value(value) |
: variable(variable), value(value) |
196 |
{ |
{ |
208 |
return STMT_SUCCESS; |
return STMT_SUCCESS; |
209 |
} |
} |
210 |
|
|
211 |
|
EventHandler::EventHandler(StatementsRef statements) { |
212 |
|
this->statements = statements; |
213 |
|
usingPolyphonics = statements->isPolyphonic(); |
214 |
|
} |
215 |
|
|
216 |
void EventHandler::dump(int level) { |
void EventHandler::dump(int level) { |
217 |
printIndents(level); |
printIndents(level); |
218 |
printf("EventHandler {\n"); |
printf("EventHandler {\n"); |
236 |
return &*args.at(i); |
return &*args.at(i); |
237 |
} |
} |
238 |
|
|
239 |
|
bool Statements::isPolyphonic() const { |
240 |
|
for (int i = 0; i < args.size(); ++i) |
241 |
|
if (args[i]->isPolyphonic()) |
242 |
|
return true; |
243 |
|
return false; |
244 |
|
} |
245 |
|
|
246 |
void FunctionCall::dump(int level) { |
void FunctionCall::dump(int level) { |
247 |
printIndents(level); |
printIndents(level); |
248 |
printf("FunctionCall '%s' args={\n", functionName.c_str()); |
printf("FunctionCall '%s' args={\n", functionName.c_str()); |
563 |
return NULL; |
return NULL; |
564 |
} |
} |
565 |
|
|
566 |
|
bool If::isPolyphonic() const { |
567 |
|
if (condition->isPolyphonic() || ifStatements->isPolyphonic()) |
568 |
|
return true; |
569 |
|
return elseStatements ? elseStatements->isPolyphonic() : false; |
570 |
|
} |
571 |
|
|
572 |
void SelectCase::dump(int level) { |
void SelectCase::dump(int level) { |
573 |
printIndents(level); |
printIndents(level); |
574 |
if (select) |
if (select) |
619 |
return NULL; |
return NULL; |
620 |
} |
} |
621 |
|
|
622 |
|
bool SelectCase::isPolyphonic() const { |
623 |
|
if (select->isPolyphonic()) return true; |
624 |
|
for (int i = 0; i < branches.size(); ++i) |
625 |
|
if (branches[i].statements->isPolyphonic()) |
626 |
|
return true; |
627 |
|
return false; |
628 |
|
} |
629 |
|
|
630 |
// void Case::addBranch(IntExprRef condition, StatementsRef statements) { |
// void Case::addBranch(IntExprRef condition, StatementsRef statements) { |
631 |
// CaseBranchRef b = new CaseBranchRef; |
// CaseBranchRef b = new CaseBranchRef; |
632 |
// b->from = condition; |
// b->from = condition; |