public class Parser extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
static String |
callSignature |
static String |
catchSignature |
static String |
commaSignature |
static String |
cutSignature |
static String |
doubleClauseSignature |
static String |
failSignature |
static String |
floatSignature |
static String |
ifSignature |
static String |
listSignature |
static String |
semiColonSignature |
static String |
singleClauseSignature |
static String |
throwSignature |
static String |
trueSignature |
Constructor and Description |
---|
Parser(InputStream theoryText)
creating a parser with default operator interpretation
|
Parser(InputStream theoryText,
Prolog p)
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,
Prolog engine)
creating a Parser specifing how to handle operators and what text to
parse
|
Modifier and Type | Method and Description |
---|---|
static Struct |
createListContainingAnyVars(int lengthInt) |
static Struct |
createStructList(LinkedList complete) |
int |
getCurrentLine() |
static Struct |
intsToStructList(int[] numbers) |
static boolean |
isAtom(String s) |
static boolean |
isSemiAndNotIf(Struct struct) |
Iterator |
iterator() |
Term |
nextTerm(boolean endNeeded)
Parses next term from the stream built on string.
|
static Number |
parseNumber(String s) |
static String |
removeApices(String st) |
static Struct |
stringToStructList(String charList) |
static String |
wrapAtom(String atom) |
public static final String floatSignature
public static final String listSignature
public static final String commaSignature
public static final String cutSignature
public static final String singleClauseSignature
public static final String doubleClauseSignature
public static final String semiColonSignature
public static final String ifSignature
public static final String callSignature
public static final String throwSignature
public static final String catchSignature
public static final String trueSignature
public static final String failSignature
public Parser(InputStream theoryText, Prolog p)
public Parser(String theoryText, Prolog engine)
public Parser(String theoryText)
public Parser(InputStream theoryText)
public Iterator iterator() throws InvalidTermException
InvalidTermException
public Term nextTerm(boolean endNeeded) throws InvalidTermException
endNeeded
- true if it is required to parse the end token (a
period), false otherwise.InvalidTermException
- if a syntax error is found.public int getCurrentLine()
public static Struct createListContainingAnyVars(int lengthInt)
public static Struct createStructList(LinkedList complete)
public static Struct intsToStructList(int[] numbers)
public static boolean isSemiAndNotIf(Struct struct)
public static String wrapAtom(String atom)
atom
- public static boolean isAtom(String s)
public static Number parseNumber(String s) throws InvalidTermException
InvalidTermException
Copyright © 2020–2024 Prolobjectlink Project. All rights reserved.