Math::SymbolicX::Calculator::Interface - Miscallaneous routines for interfaces


Math-SymbolicX-Calculator documentation  | view source Contained in the Math-SymbolicX-Calculator distribution.

Index


NAME

Top

Math::SymbolicX::Calculator::Interface - Miscallaneous routines for interfaces

SYNOPSIS

Top

Do not use this in your scripts. Use one of the ::Interface::Foo classes.

DESCRIPTION

Top

This is very much an internal class.

This module is a base class for interfaces to Math::SymbolicX::Calculator. It is not an interface by itself. It doesn't even define stubs for all methods of an interface and as such isn't an interface definition for Calculator::Interfaces. Instead, it contains various miscellaneous methods which may be of use to classes which actually implement interfaces.

METHODS RELATED TO PARSING

Top

_parse_assignment

Parses an expression of one of the forms

  $SYMBOL = $FORMULA
  $SYMBOL = $TRANSFORMATION
  $SYMBOL = $GROUP

Returns an instance of Math::SymbolicX::Calculator::Command::Assignment which assigns either a formula or a transformation(-group) when executed.

Uses $self-calc()> and expects it to return the Calculator object. Uses the _parse_trafo_group method.

_parse_transformation

This method parses expressions of the form

  $SYMBOL =~ $SYMBOL2
  $SYMBOL =~ $TRANSFORMATION
  $SYMBOL =~ $GROUP

or

  $SYMBOL =~~ $SYMBOL2 (*)
  ... and so on ...

(*) The =~ operator stands for recursive application of the transformation whereas the =~~ operator stands for shallow application.

These expressions generally stand for the application of the transformation given on the right to the function $SYMBOL stands for. This method returns a Math::SymbolicX::Calculator::Command::Transformation object on success or calls the error() method and returns an empty list on failure.

This methods expects $self-calc()> to return the Calculator object. It also uses the _parse_trafo_group method.

_parse_trafo_group

Parses a string of the form:

    $SYMBOL
    $GROUP
    $TRANSFORMATION

In case of $SYMBOL, it accesses the Calculator symbol table to fetch the referenced Transformation. (And throws an error if it's not one.)

Returns a Math::Symbolic::Custom::Transformation object or calls the error() method and returns the empty list on failure.

This method uses Parse::RecDescent. Expects the calc() method to return the Calculator object. Uses the method _parse_simple_transformation.

_parse_simple_transformation

Parses a string of the form "pattern -> replacement", i.e. a simple $TRANSFORMATION.

Returns a Math::Symbolic::Custom::Transformation object or the empty list on failure.

SEE ALSO

Top

Math::SymbolicX::Calculator, Math::SymbolicX::Calculator::Interface::Shell

AUTHOR

Top

Steffen Müller, <smueller@cpan.org>

COPYRIGHT AND LICENSE

Top


Math-SymbolicX-Calculator documentation  | view source Contained in the Math-SymbolicX-Calculator distribution.