Quick Navigator

 Search Site Miscellaneous Server Agreement Year 2038 Credits

Manual Reference Pages  -  MATH::EXPR::OPP (3)

.ds Aq ’

NAME

```

Math::Expr::Opp - Represents one operation in the parsed expression
tree

```

SYNOPSIS

```

require Math::Expr::Opp;
require Math::Expr::Var;
require Math::Expr::Num;

# To represent the expression "x+7":
\$n=new Math::Expr::Opp("+");
\$n->SetOpp(0,new Math::Expr::Var("x"));
\$n->SetOpp(1,new Math::Expr::Num(7));
print \$n->tostr . "\n";

```

DESCRIPTION

```

Used by the Math::Expr to represent algebraic expressions. This class
represents one operation or function with a set of operands, which
in turn can be other Math::Expr::Opp objects. And in that way we are
able to represent entire expression.

Operations like a+b and functions like sin(a) or f(a,b) are all
represented by this kind of objects with "+", "sin" and "f" as the
operation- or function names and Math::Expr::Var(a) and
Math::Expr::Var(b) as operands (only a in the sin example).

```

METHODS

CW\$e=new Math::Expr::Opp(\$name,\$db)

```

Creates a new operation object with the operation- or function-name
\$name. Using the operations defined in \$db. See

```

CW\$e->SetOpp(\$i, CW\$v)

```

Sets operand number \$i to \$v.

```

CW\$e->Opp(\$i)

```

Returns operand to number \$i.

```

CW\$e->tostr

```

Returns a string representation of the entire expression to be
used for debugging.

```

CW\$e->strtype

```

Returns a string representation of this expressions entire type,
without simplifying it. In the same notation as the tostr method.

```

CW\$n->Simplify

```

Simplifys the expression to some normal from.

```

CW\$n->BaseType

```

Returns a string type of this expression simplifyed as much as
possible.

```

CW\$n->SubMatch(\$rules,\$match)

```

Tries to match \$rules to this expretions and adds the substitutions
needed to \$match.Returns 1 if the match excists and the substitutions
needed can coexcist with those already in \$match otherwise 0.

```

CW\$n->Match(\$rules)

```

Tries to match \$rules to this expretions and to all its subexpretions.
Returns a MatchSet object specifying where the matches ocored and what
substitutions they represent.

```

CW\$n->Subs(\$vars)

```

Substitues all variables in the expretion with there vaules in \$vars.

```

CW\$n->Copy

Returns a copy of this object.

CW\$n->Breakable

```

Used by the parser to indikate if this object was created using
parantesis or if he should break it up to preserve the rules of order
between the diffrent opperations.

```

CW\$n->Find(\$pos)

```

Returns an object pointer to the subexpression represented by the
string \$pos.

```

CW\$n->Set(\$pos, CW\$val)

```

Replaces the subexpression at position \$pos with \$val.

```

AUTHOR

```

Hakan Ardo <hakan@debian.org>

```

```

L<Math::Expr>

```
Search for    or go to Top of page |  Section 3 |  Main Index

 perl v5.20.3 EXPR::OPP (3) 1998-09-01

Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.