edu.jas.application
Class RingFactoryTokenizer

java.lang.Object
  extended by edu.jas.application.RingFactoryTokenizer

public class RingFactoryTokenizer
extends java.lang.Object

RingFactory Tokenizer. Used to read ring factories from input streams. It can read also QuotientRing factory.

Author:
Heinz Kredel

Constructor Summary
RingFactoryTokenizer()
          No-args constructor reads from System.in.
RingFactoryTokenizer(GenPolynomialRing rf, java.io.Reader r)
          Constructor with Ring and Reader.
RingFactoryTokenizer(java.io.Reader r)
          Constructor with Reader.
 
Method Summary
 void initFactory(RingFactory rf, edu.jas.application.RingFactoryTokenizer.coeffType ct)
          Initialize coefficient and polynomial factories.
 void initSolvableFactory(RingFactory rf, edu.jas.application.RingFactoryTokenizer.coeffType ct)
          Initialize coefficient and solvable polynomial factories.
 RingFactory nextCoefficientRing()
          Parsing method for coefficient ring. syntax: Rat | Q | Int | Z | Mod modul | Complex | C | D | Quat | AN[ (var) ( poly ) | AN[ modul (var) ( poly ) ] | RatFunc (var_list) | ModFunc modul (var_list) | IntFunc (var_list)
 void nextComma()
           
 java.lang.String nextComment()
          Parsing method for comments. syntax: (* comment *) | /_* comment *_/ without _ Does not work with this pushBack(), unused.
 GenPolynomialRing nextPolynomialRing()
          Parsing method for polynomial set. syntax: coeffRing varList termOrderName polyList.
 void nextRelationTable()
          Parsing method for solvable polynomial relation table. syntax: ( p_1, p_2, p_3, ..., p_{n+3} ) semantics: p_{n+1} * p_{n+2} = p_{n+3} The next relation table is stored into the solvable polynomial factory.
 GenSolvablePolynomialRing nextSolvablePolynomialRing()
          Parsing method for solvable polynomial set. syntax: varList termOrderName relationTable polyList.
 int nextSplitIndex()
          Parsing method for split index. syntax: |i|
 TermOrder nextTermOrder()
          Parsing method for term order name. syntax: termOrderName = L, IL, LEX, G, IG, GRLEX, W(weights) |split index|
 java.lang.String[] nextVariableList()
          Parsing method for variable list. syntax: (a, b c, de) gives [ "a", "b", "c", "de" ]
 long[][] nextWeightArray()
          Parsing method for weight array. syntax: ( (w11, ...
 long[] nextWeightList()
          Parsing method for weight list. syntax: (w1, w2, w3, ..., wn)
static java.lang.String[] variableList(java.lang.String s)
          Parse variable list from String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RingFactoryTokenizer

public RingFactoryTokenizer()
No-args constructor reads from System.in.


RingFactoryTokenizer

public RingFactoryTokenizer(GenPolynomialRing rf,
                            java.io.Reader r)
Constructor with Ring and Reader.

Parameters:
rf - ring factory.
r - reader stream.

RingFactoryTokenizer

public RingFactoryTokenizer(java.io.Reader r)
Constructor with Reader.

Parameters:
r - reader stream.
Method Detail

initFactory

public void initFactory(RingFactory rf,
                        edu.jas.application.RingFactoryTokenizer.coeffType ct)
Initialize coefficient and polynomial factories.

Parameters:
rf - ring factory.
ct - coefficient type.

initSolvableFactory

public void initSolvableFactory(RingFactory rf,
                                edu.jas.application.RingFactoryTokenizer.coeffType ct)
Initialize coefficient and solvable polynomial factories.

Parameters:
rf - ring factory.
ct - coefficient type.

nextComment

public java.lang.String nextComment()
                             throws java.io.IOException
Parsing method for comments. syntax: (* comment *) | /_* comment *_/ without _ Does not work with this pushBack(), unused.

Throws:
java.io.IOException

nextVariableList

public java.lang.String[] nextVariableList()
                                    throws java.io.IOException
Parsing method for variable list. syntax: (a, b c, de) gives [ "a", "b", "c", "de" ]

Returns:
the next variable list.
Throws:
java.io.IOException

nextCoefficientRing

public RingFactory nextCoefficientRing()
                                throws java.io.IOException
Parsing method for coefficient ring. syntax: Rat | Q | Int | Z | Mod modul | Complex | C | D | Quat | AN[ (var) ( poly ) | AN[ modul (var) ( poly ) ] | RatFunc (var_list) | ModFunc modul (var_list) | IntFunc (var_list)

Returns:
the next coefficient factory.
Throws:
java.io.IOException

nextWeightList

public long[] nextWeightList()
                      throws java.io.IOException
Parsing method for weight list. syntax: (w1, w2, w3, ..., wn)

Returns:
the next weight list.
Throws:
java.io.IOException

nextWeightArray

public long[][] nextWeightArray()
                         throws java.io.IOException
Parsing method for weight array. syntax: ( (w11, ...,w1n), ..., (wm1, ..., wmn) )

Returns:
the next weight array.
Throws:
java.io.IOException

nextSplitIndex

public int nextSplitIndex()
                   throws java.io.IOException
Parsing method for split index. syntax: |i|

Returns:
the next split index.
Throws:
java.io.IOException

nextTermOrder

public TermOrder nextTermOrder()
                        throws java.io.IOException
Parsing method for term order name. syntax: termOrderName = L, IL, LEX, G, IG, GRLEX, W(weights) |split index|

Returns:
the next term order.
Throws:
java.io.IOException

nextRelationTable

public void nextRelationTable()
                       throws java.io.IOException
Parsing method for solvable polynomial relation table. syntax: ( p_1, p_2, p_3, ..., p_{n+3} ) semantics: p_{n+1} * p_{n+2} = p_{n+3} The next relation table is stored into the solvable polynomial factory.

Throws:
java.io.IOException

nextPolynomialRing

public GenPolynomialRing nextPolynomialRing()
                                     throws java.io.IOException
Parsing method for polynomial set. syntax: coeffRing varList termOrderName polyList.

Returns:
the next polynomial set.
Throws:
java.io.IOException

nextSolvablePolynomialRing

public GenSolvablePolynomialRing nextSolvablePolynomialRing()
                                                     throws java.io.IOException
Parsing method for solvable polynomial set. syntax: varList termOrderName relationTable polyList.

Returns:
the next solvable polynomial set.
Throws:
java.io.IOException

nextComma

public void nextComma()
               throws java.io.IOException
Throws:
java.io.IOException

variableList

public static java.lang.String[] variableList(java.lang.String s)
Parse variable list from String.

Parameters:
s - String. Syntax: (n1,...,nk) or (n1 ... nk), brackest are also optional.
Returns:
array of variable names found in s.