56 for (
int i = start;
i < end; ++
i)
66 using Comments = std::vector<std::pair<int, int>>;
68 const std::string &s = expr.
getExpr();
72 if (
i.first >=
node.endPos() &&
isWS(s.c_str(),
node.endPos(),
i.first))
73 return s.substr(
i.first,
i.second -
i.first + 1);
86 if (
comment.find(
'.') != std::string::npos ||
comment.find(
'e') != std::string::npos) {
109 std::stringstream
ss;
132 if (
comment.find(
'.') != std::string::npos ||
comment.find(
'e') != std::string::npos) {
147 std::stringstream
ss;
164 for (
int i = 1;
i <
num - 2;
i += 3) {
185 std::stringstream
ss;
188 <<
"curve(" << _lookupText;
189 int num = _vec.size();
190 for (
int i = 0;
i <
num; ++
i)
191 ss << _vec[
i]._pos << _vec[
i]._val << (
int)_vec[
i]._interp;
207ExprCcurveAssignSpec::
216 for(
int i = 1;
i <
num - 2;
i += 3)
225ExprCcurveAssignSpec::toString()
const
227 std::stringstream
ss;
233 int num = _vec.size();
234 for(
int i = 0;
i <
num; ++
i)
240 << (
int)_vec[
i]._interp;
246const ExprCcurveAssignSpec*
247ExprCcurveAssignSpec::match(
const ExprNode* node)
260 std::stringstream
ss;
288 if (type ==
"string")
290 else if (type ==
"file")
292 else if (type ==
"directory")
Generic Expression control specification.
std::string _name
Name of control.
InterpType
Supported interpolation types.
Node that compute a local variable assignment.
Curve assignment expression. Assignment of curve to a variable.
std::string toString() const override
Generates a replacement string based on changes to the spec.
static const ExprCurveAssignSpec * match(const ExprNode *node)
std::string _lookupText
Lookup subexpression text.
std::vector< typename Curve< T >::CV > _vec
Control points of curve spline.
ExprCurveAssignSpec(const ExprAssignNode &node)
Node that calls a function.
Node that stores a numeric constant.
Variable equals scalar control specification.
static const ExprScalarAssignSpec * match(const ExprNode *node)
ExprScalarAssignSpec(const ExprAssignNode &node)
double _min
Range of values.
std::string toString() const override
Generates a replacement string based on changes to the spec.
Node that stores a string.
static const ExprStrSpec * match(const ExprNode *node)
std::string toString() const override
Generates a replacement string based on changes to the spec.
Variable equals vector control specification.
std::string toString() const override
Generates a replacement string based on changes to the spec.
static const ExprVectorAssignSpec * match(const ExprNode *node)
double _min
Range of values.
const Vec3d & value() const
ExprVectorAssignSpec(const ExprAssignNode &node)
const std::string & getExpr() const
Get the string that this expression is currently set to evaluate.
const std::vector< std::pair< int, int > > & getComments() const
std::vector< constControlSpec * >::const_iterator begin() const
bool examine(const ExprNode *examinee) override
std::vector< constControlSpec * >::const_iterator end() const
std::vector< const ControlSpec * > _specList
Vec()
Empty constructor (this is invalid for a reference type)
bool parseRangeComment(const std::string &comment, double &from, double &to)
bool parseTypeNameComment(const std::string &comment, std::string &type, std::string &name)
const ExprAssignNode * isVectorAssign(const ExprNode *testee)
bool isWS(const char *source, int start, int end)
Returns true if no newline separates comment and node.
const ExprStrNode * isString(const ExprNode *testee)
const ExprAssignNode * isScalarAssign(const ExprNode *testee)
const ExprAssignNode * isCcurveAssign(const ExprNode *testee)
const ExprAssignNode * isCurveAssign(const ExprNode *testee)
std::string findComment(const ExprNode &node)
Checks if there is whitespace in the range specified in the string.