public class Parser extends Object implements IParser, Serializable
Constructor and Description |
---|
Parser(InputStream theoryText)
creating a parser with default operator interpretation
|
Parser(OperatorManager op,
InputStream theoryText)
creating a Parser specifing how to handle operators
and what text to parse
|
Parser(OperatorManager op,
String theoryText)
creating a Parser specifing how to handle operators
and what text to parse
|
Parser(OperatorManager op,
String theoryText,
HashMap<Term,Integer> mapping)
creating a Parser specifing how to handle operators
and what text to parse
|
Parser(String theoryText)
creating a parser with default operator interpretation
|
Parser(String theoryText,
HashMap<Term,Integer> mapping)
creating a parser with default operator interpretation
|
Modifier and Type | Method and Description |
---|---|
int |
getCurrentLine() |
int |
getCurrentOffset() |
HashMap<Term,Integer> |
getTextMapping() |
static boolean |
isAtom(String s) |
Iterator<Term> |
iterator() |
Term |
nextTerm(boolean endNeeded)
Parses next term from the stream built on string.
|
int[] |
offsetToRowColumn(int offset) |
static Term |
parseSingleTerm(String st)
Static service to get a term from its string representation
|
static Term |
parseSingleTerm(String st,
OperatorManager op)
Static service to get a term from its string representation,
providing a specific operator manager
|
public Parser(OperatorManager op, InputStream theoryText)
public Parser(OperatorManager op, String theoryText, HashMap<Term,Integer> mapping)
public Parser(OperatorManager op, String theoryText)
public Parser(String theoryText, HashMap<Term,Integer> mapping)
public Parser(String theoryText)
public Parser(InputStream theoryText)
public Term nextTerm(boolean endNeeded) throws InvalidTermException
nextTerm
in interface IParser
endNeeded
- true if it is required to parse the end token
(a period), false otherwise.InvalidTermException
- if a syntax error is found.public static Term parseSingleTerm(String st) throws InvalidTermException
InvalidTermException
public static Term parseSingleTerm(String st, OperatorManager op) throws InvalidTermException
InvalidTermException
public int getCurrentLine()
getCurrentLine
in interface IParser
public int getCurrentOffset()
getCurrentOffset
in interface IParser
public int[] offsetToRowColumn(int offset)
offsetToRowColumn
in interface IParser
public static boolean isAtom(String s)