Package wprover
Class Parser
- java.lang.Object
-
- wprover.Parser
-
public class Parser extends java.lang.ObjectParser is a class that parses a mathematical expression represented as a string and converts it into a TMono object.
-
-
Constructor Summary
Constructors Constructor Description Parser(java.lang.String n, java.lang.String f, int x)Constructs a new Parser with the specified name, function, and parameter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TMonogetAterm(byte[] bf, byte[] nm)Parses a term from the function string and returns it as a TMono object.booleanisAlpha(byte b)Checks if the given byte represents an alphabetic character.booleanisNum(byte b)Checks if the given byte represents a numeric character.TMonoparse()Parses the function string and converts it into a TMono object.voidparseBlank(byte[] bf, byte[] nm)Skips blank spaces in the function string.voidparseterm(boolean first, byte[] bf, byte[] nm)Parses a term from the function string and updates the TMono object.
-
-
-
Method Detail
-
parse
public TMono parse()
Parses the function string and converts it into a TMono object.- Returns:
- the TMono object representing the parsed function
-
isNum
public boolean isNum(byte b)
Checks if the given byte represents a numeric character.- Parameters:
b- the byte to check- Returns:
- true if the byte is a numeric character, false otherwise
-
isAlpha
public boolean isAlpha(byte b)
Checks if the given byte represents an alphabetic character.- Parameters:
b- the byte to check- Returns:
- true if the byte is an alphabetic character, false otherwise
-
parseterm
public void parseterm(boolean first, byte[] bf, byte[] nm)Parses a term from the function string and updates the TMono object.- Parameters:
first- indicates if this is the first term being parsedbf- the byte array representing the function stringnm- the byte array representing the name string
-
parseBlank
public void parseBlank(byte[] bf, byte[] nm)Skips blank spaces in the function string.- Parameters:
bf- the byte array representing the function stringnm- the byte array representing the name string
-
getAterm
public TMono getAterm(byte[] bf, byte[] nm)
Parses a term from the function string and returns it as a TMono object.- Parameters:
bf- the byte array representing the function stringnm- the byte array representing the name string- Returns:
- the TMono object representing the parsed term
-
-