public class ParserDomainTheory
extends java.lang.Object
DomainTheoryGrammar
.
NOTE: All exception text in this class is intended for the developer in debugging,so it is not translated.
When constructed with a Tokenizer
, a Parser will construct a Kinship
domain theory from the tokens found in the Tokenizer's
input
file.
Modifier and Type | Field and Description |
---|---|
static java.util.ArrayList<java.lang.Object> |
cachedStdMacros |
static java.lang.String |
errorFound |
Constructor and Description |
---|
ParserDomainTheory(Tokenizer tok)
Construct a Parser from a DomainTheory file.
|
ParserDomainTheory(Tokenizer dtTokens,
Tokenizer macroTokens)
Construct a Parser from a DomainTheory file and a Standard_Macros file.
|
Modifier and Type | Method and Description |
---|---|
static PredCategory |
determinePrimitive(java.lang.String symbol,
DomainTheory dt)
Return the category of the predicate
symbol . |
void |
error(java.lang.String msgOut)
Assemble information about a parsing error encountered, then throw a
KSParsingErrorException . |
ClauseBody |
parseCBfromString(DomainTheory dt) |
DomainTheory |
parseDomainTheory()
Begin the parse of a Domain Theory.
|
DomainTheory |
parseDomainTheory(java.lang.String[] macros) |
KinTermDef |
parseKinTerm(java.lang.String kinTerm,
boolean domThyAlso) |
DomainTheory |
parseMacrosOnly() |
ClauseBody |
parseSingleClause(java.lang.String kinTerm,
int cbSeqNmbr,
DomainTheory dt,
KinTermDef ktd) |
ClauseBody |
parseSingleClause(java.lang.String kinTerm,
int cbSeqNmbr,
DomainTheory dt,
KinTermDef ktd,
java.lang.String typ) |
void |
parseStandardMacros(DomainTheory dt) |
public static java.lang.String errorFound
public static java.util.ArrayList<java.lang.Object> cachedStdMacros
public ParserDomainTheory(Tokenizer tok)
tok
- a Tokenizer
which parses tokens from an input file on demand.public ParserDomainTheory(Tokenizer dtTokens, Tokenizer macroTokens)
dtTokens
- a Tokenizer
which parses tokens from a DomainTheory file on demand.macroTokens
- a Tokenizer
which parses tokens from a Macro file on demand.public static PredCategory determinePrimitive(java.lang.String symbol, DomainTheory dt)
symbol
.symbol
- a String which has been identified as a predicate symbol in a Horn Clause.PrimitiveCategory
(a built-in predicate the Kinship system understands)
or CulturalCategory
(a kinship term in the language of the target culture).public void error(java.lang.String msgOut) throws KSParsingErrorException
KSParsingErrorException
.msgOut
- a String describing the exact error found.a
- KSParsingErrorException
.KSParsingErrorException
public DomainTheory parseDomainTheory(java.lang.String[] macros) throws KSParsingErrorException, KSConstraintInconsistency
public DomainTheory parseDomainTheory() throws KSParsingErrorException, KSConstraintInconsistency
KSParsingErrorException
KSConstraintInconsistency
KSParsingErrorException
KSConstraintInconsistency
public DomainTheory parseMacrosOnly() throws KSParsingErrorException
KSParsingErrorException
public void parseStandardMacros(DomainTheory dt) throws KSParsingErrorException
KSParsingErrorException
public ClauseBody parseSingleClause(java.lang.String kinTerm, int cbSeqNmbr, DomainTheory dt, KinTermDef ktd) throws KSParsingErrorException, KSInternalErrorException, KSConstraintInconsistency
public ClauseBody parseSingleClause(java.lang.String kinTerm, int cbSeqNmbr, DomainTheory dt, KinTermDef ktd, java.lang.String typ) throws KSParsingErrorException, KSInternalErrorException, KSConstraintInconsistency
public ClauseBody parseCBfromString(DomainTheory dt) throws KSParsingErrorException
KSParsingErrorException
public KinTermDef parseKinTerm(java.lang.String kinTerm, boolean domThyAlso) throws KSParsingErrorException, KSConstraintInconsistency, KSInternalErrorException