sims.mdt
Class TmParser

java.lang.Object
  extended by sims.mdt.TmParser
All Implemented Interfaces:
Errors

public class TmParser
extends java.lang.Object
implements Errors


Field Summary
 
Fields inherited from interface sims.mdt.Errors
error1, error10, error11, error12, error13, error2, error3, error4, error5, error6, error7, error8, error9
 
Constructor Summary
TmParser(java.lang.String inFile, MachineRead m)
          Initialize the parser.
 
Method Summary
 java.util.HashMap getAlphabet()
           
 java.lang.String getEndVert(int i)
           
 int getInstCard(int i)
           
 java.lang.String getInstComp(int i, int j)
           
 java.lang.String getInstructions(int i)
           
 java.lang.String getLabel(int i)
           
 int getLine(int nbinst)
           
 int getNbInstructions()
           
 int getNbStates()
           
 java.lang.String getStartVert(int i)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TmParser

public TmParser(java.lang.String inFile,
                MachineRead m)
         throws java.io.IOException,
                ExceptionCompilation
Initialize the parser.

Parameters:
inFile - a string of the file to parse name.
m - the MachineRead instance associated to the parser.
Throws:
java.io.IOException
ExceptionCompilation
Method Detail

getInstructions

public java.lang.String getInstructions(int i)
Returns:
the instruction at line i

getNbInstructions

public int getNbInstructions()
Returns:
the number of instructions read.

getStartVert

public java.lang.String getStartVert(int i)
Returns:
the (String) start state/vertex for the i-th instruction

getEndVert

public java.lang.String getEndVert(int i)
Parameters:
i - an index of an instruction.
Returns:
the ending state (end vertex in the graph) of the instruction i.

getLabel

public java.lang.String getLabel(int i)
Returns:
the graph-label of the i-th transition

getNbStates

public int getNbStates()
Returns:
the number of states

getInstComp

public java.lang.String getInstComp(int i,
                                    int j)
Parameters:
i - indice of instruction line
j - indice of component in the line
Returns:
the jth component of instruction i

getInstCard

public int getInstCard(int i)
Returns:
the size (nb of elements) of instruction i

getAlphabet

public java.util.HashMap getAlphabet()
Returns:
the HashMap of the alphabets read.

getLine

public int getLine(int nbinst)
Returns:
the number of the line from its index.