|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlp.parse.LpParser
lp.trans.DlpGrounder.DlpDetagger
private static class DlpGrounder.DlpDetagger
A special parser for parsing the grounded and tagged program. It filters out all tagging literals, both in rule bodies and in facts. It also eliminates the "p_" and "n_" prefixes from predicate names.
Field Summary | |
---|---|
private static LpLiteral |
TAG
An internally used literal that indicates that a tag has been parsed. |
private int |
tagNumber
The tag number of the last rule. |
Constructor Summary | |
---|---|
DlpGrounder.DlpDetagger()
Creates a new instance of TaggedDlpParser . |
Method Summary | |
---|---|
int |
getTagNumber()
Returns the tag number of the last rule. |
LpLiteral |
parseLiteral()
Parses and returns the next literal on input. |
LpRule |
parseRule()
Parses and returns the next rule on input. |
void |
setInput(CharSequence input)
Sets the character input of this LpParser to the given
CharSequence . |
Methods inherited from class lp.parse.LpParser |
---|
close, expect, getLexer, hasMoreTokens, match, nextToken, parseAllRules, parseAllRules, parseArguments, parseAtom, parseOnlyRule, parseRuleBody, parseTerm, setInput, setInput |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final LpLiteral TAG
parseLiteral()
and processed by
parseRule()
.
private int tagNumber
Constructor Detail |
---|
public DlpGrounder.DlpDetagger()
TaggedDlpParser
.
Method Detail |
---|
public void setInput(CharSequence input)
LpParser
to the given
CharSequence
.
setInput
in class LpParser
input
- the character sequence to be parsedLpLexer.setInput(CharSequence)
public int getTagNumber()
public LpRule parseRule()
parseRule
in class LpParser
null
if no more rules follow
IOException
- (wrapped in an ExceptionAdapter
)
in case an I/O error occurs while tokenizing the input
LpParserException
- if the input is not parseablepublic LpLiteral parseLiteral()
parseLiteral
in class LpParser
null
if it was a tagging
literal
IOException
- (wrapped in an ExceptionAdapter
)
in case an I/O error occurs while tokenizing the input
LpParserException
- if the input is not parseable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |