Exemplo n.º 1
0
		//-----------------------------------------------------------------//
		bool analize(const char* text) {

			error_.clear();

			if(text == nullptr) {
				error_.set(error::fatal);
				return false;
			}
			tx_ = text;

			ch_ = *tx_++;
			if(ch_ != 0) {
				value_ = expression_();
			} else {
				error_.set(error::fatal);
			}

			if(error_() != 0) {
				return false;
			} else if(ch_ != 0) {
				error_.set(error::fatal);
				return false;
			}
			return true;
		}
Exemplo n.º 2
0
		VTYPE factor_() {
			VTYPE v = 0;
			if(ch_ == '(') {
				ch_ = *tx_++;
				v = expression_();
				if(ch_ == ')') {
					ch_ = *tx_++;
				} else {
					error_.set(error::fatal);
				}
			} else {
				v = number_();
			}
			return v;
		}
Exemplo n.º 3
0
	Processor::Result SimpleExperiment1D::operator () (Composite& composite)
	{
		Atom* atom_ptr = dynamic_cast<Atom*>(&composite);
		if ((atom_ptr != 0) && expression_(*atom_ptr))
		{
			// create a new peak at the end of the list
			peak_list_.push_back(default_peak_);

			// set the peak's position
			peak_list_.back().setPosition(atom_ptr->getProperty(ShiftModule::PROPERTY__SHIFT).getFloat());

			// copy the atom's properties to the peak
			static_cast<PropertyManager&>(peak_list_.back()).set(*atom_ptr);
		}
			
		return Processor::CONTINUE;
	}