Beispiel #1
0
void PrettyPrinter::VisitSwitchStatement(SwitchStatement* node) {
  PrintLabels(node->labels());
  Print("switch (");
  Visit(node->tag());
  Print(") { ");
  ZoneList<CaseClause*>* cases = node->cases();
  for (int i = 0; i < cases->length(); i++)
    Visit(cases->at(i));
  Print("}");
}
void UsageComputer::VisitSwitchStatement(SwitchStatement* node) {
  Read(node->tag());
  ZoneList<CaseClause*>* cases = node->cases();
  for (int i = cases->length(); i-- > 0;) {
    WeightScaler ws(this, static_cast<float>(1.0 / cases->length()));
    CaseClause* clause = cases->at(i);
    if (!clause->is_default())
      Read(clause->label());
    VisitStatements(clause->statements());
  }
}
Beispiel #3
0
bool LeptonicaBackend::doAnalyze(QImage &img, ZoneList &result)
{
    mErrorStrings.clear();

    Zone zone;
    zone.setX(50);
    zone.setY(50);
    zone.setWidth(img.width() - 100);
    zone.setHeight(img.height() - 100);
    zone.setZoneType( ZT_Text );
    result.append(zone);

    return true;
}
Beispiel #4
0
void LocationParser_ns::parseZone(ZoneList &list, char *name) {
	debugC(5, kDebugParser, "parseZone(name: %s)", name);

	if (_vm->_location.findZone(name)) {
		_zoneProg++;
		_script->skip("endzone");
		return;
	}

	ZonePtr z(new Zone);
	_zoneProg++;

	strncpy(z->_name, name, ZONENAME_LENGTH);

	ctxt.z = z;

	list.push_front(z);

	_parser->pushTables(&_locationZoneParsers, _locationZoneStmt);

	return;
}
void UsageComputer::VisitFunctionLiteral(FunctionLiteral* node) {
  ZoneList<Declaration*>* decls = node->scope()->declarations();
  for (int i = 0; i < decls->length(); i++) VisitDeclaration(decls->at(i));
  VisitStatements(node->body());
}