public class TurtleParser extends Object implements AnonymousNodeChecker, TurtleParserConstants
| Modifier and Type | Field and Description |
|---|---|
Token |
jj_nt
Next token.
|
Token |
token
Current token.
|
TurtleParserTokenManager |
token_source
Generated Token Manager.
|
A, ANY_CHAR, ANY_ESCAPED_CHAR, AT, BASE, CLOSE_SQUARE_BRACKET, CLOSEPAR, COMMA, COMMENT, DECIMAL, DEFAULT, DIGIT, DOT, DOUBLE, DOUBLE_CARET, EMPTY_BLANK_NODE, EOF, ERROR, EXPONENT, FALSE, FILTER, FULLIRI, IN_LONG_STRING, IN_STRING, INTEGER, LETTER, LONG_STRING, NODE_ID_START, NODEID, OPEN_SQUARE_BRACKET, OPENPAR, PN_CHARS, PN_CHARS_BASE, PN_CHARS_U, PN_LOCAL, PN_PREFIX, PNAME_LN, PNAME_NS, PREFIX, SELECT, SEMICOLON, STRING, STRING_START, tokenImage, TRUE, WHERE| Constructor and Description |
|---|
TurtleParser(InputStream stream)
Constructor with InputStream.
|
TurtleParser(InputStream stream,
String encoding)
Constructor with InputStream and supplied encoding.
|
TurtleParser(InputStream is,
TripleHandler handler,
String base)
Instantiates a new turtle parser.
|
TurtleParser(Reader stream)
Constructor.
|
TurtleParser(Reader reader,
TripleHandler handler,
String base)
Instantiates a new turtle parser.
|
TurtleParser(TurtleParserTokenManager tm)
Constructor with generated Token Manager.
|
| Modifier and Type | Method and Description |
|---|---|
void |
disable_tracing()
Disable tracing.
|
void |
enable_tracing()
Enable tracing.
|
ParseException |
generateParseException()
Generate ParseException.
|
IRI |
getIRI(String _s)
Gets the iri.
|
protected IRI |
getIRIFromQName(String qname)
Gets the iRI from q name.
|
protected IRI |
getNextBlankNode(String id)
Gets the next blank node.
|
Token |
getNextToken()
Get the next Token.
|
DefaultPrefixManager |
getPrefixManager()
Gets the prefix manager.
|
Token |
getToken(int index)
Get the specific Token.
|
boolean |
isAnonymousNode(IRI iri) |
boolean |
isAnonymousNode(String iri) |
boolean |
isAnonymousSharedNode(String iri) |
IRI |
parseAbbreviatedIRI()
Parses the abbreviated iri.
|
void |
parseBaseDirective()
Parses the base directive.
|
IRI |
parseBlankNode()
Parses the blank node.
|
String |
parseBoolean()
Parses the boolean.
|
IRI |
parseCollection()
Parses the collection.
|
String |
parseDecimal()
Parses the decimal.
|
void |
parseDirective()
Parses the directive.
|
void |
parseDocument()
Parses the document.
|
String |
parseDouble()
Parses the double.
|
String |
parseInteger()
Parses the integer.
|
IRI |
parseIRI()
Parses the iri.
|
IRI |
parseItemList()
Parses the item list.
|
void |
parseLiteral(IRI subject,
IRI predicate)
Parses the literal.
|
IRI |
parseLoneNS()
Parses the lone ns.
|
IRI |
parseNodeID()
Parses the node id.
|
void |
parseObject(IRI subject,
IRI predicate)
Parses the object.
|
void |
parseObjectList(IRI subject,
IRI predicate)
Parses the object list.
|
IRI |
parsePredicate()
Parses the predicate.
|
void |
parsePredicateObjectList(IRI subject)
Parses the predicate object list.
|
void |
parsePrefixDirective()
Parses the prefix directive.
|
String |
parseQuotedString()
Parses the quoted string.
|
IRI |
parseResource()
Parses the resource.
|
void |
parseStatement()
Parses the statement.
|
String |
parseString()
Parses the string.
|
IRI |
parseSubject()
Parses the subject.
|
void |
parseTriples()
Parses the triples.
|
IRI |
parseVerb()
Parses the verb.
|
void |
ReInit(InputStream stream)
Reinitialise.
|
void |
ReInit(InputStream stream,
String encoding)
Reinitialise.
|
void |
ReInit(Reader stream)
Reinitialise.
|
void |
ReInit(TurtleParserTokenManager tm)
Reinitialise.
|
void |
setTripleHandler(TripleHandler handler)
Sets the triple handler.
|
public TurtleParserTokenManager token_source
public Token token
public Token jj_nt
public TurtleParser(Reader reader, TripleHandler handler, String base)
reader - the readerhandler - the handlerbase - the basepublic TurtleParser(InputStream is, TripleHandler handler, String base)
is - the ishandler - the handlerbase - the basepublic TurtleParser(InputStream stream)
stream - the streampublic TurtleParser(InputStream stream, String encoding)
stream - the streamencoding - the encodingpublic TurtleParser(Reader stream)
stream - the streampublic TurtleParser(TurtleParserTokenManager tm)
tm - the tmpublic DefaultPrefixManager getPrefixManager()
public void setTripleHandler(TripleHandler handler)
handler - the new triple handlerpublic boolean isAnonymousNode(String iri)
isAnonymousNode in interface AnonymousNodeCheckeriri - iripublic boolean isAnonymousNode(IRI iri)
isAnonymousNode in interface AnonymousNodeCheckeriri - iripublic boolean isAnonymousSharedNode(String iri)
isAnonymousSharedNode in interface AnonymousNodeCheckeriri - iriprotected IRI getNextBlankNode(String id)
id - the idprotected IRI getIRIFromQName(String qname) throws ParseException
qname - the qnameParseException - the parse exceptionpublic final void parseDocument()
throws ParseException
ParseException - the parse exceptionpublic final void parseDirective()
throws ParseException
ParseException - the parse exceptionpublic final void parsePrefixDirective()
throws ParseException
ParseException - the parse exceptionpublic final void parseBaseDirective()
throws ParseException
ParseException - the parse exceptionpublic final void parseStatement()
throws ParseException
ParseException - the parse exceptionpublic final void parseTriples()
throws ParseException
ParseException - the parse exceptionpublic final IRI parseSubject() throws ParseException
ParseException - the parse exceptionpublic final IRI parseLoneNS() throws ParseException
ParseException - the parse exceptionpublic final IRI parseAbbreviatedIRI() throws ParseException
ParseException - the parse exceptionpublic final IRI parseIRI() throws ParseException
ParseException - the parse exceptionpublic final IRI parseBlankNode() throws ParseException
ParseException - the parse exceptionpublic final IRI parseNodeID() throws ParseException
ParseException - the parse exceptionpublic final void parsePredicateObjectList(IRI subject) throws ParseException
subject - the subjectParseException - the parse exceptionpublic final IRI parseVerb() throws ParseException
ParseException - the parse exceptionpublic final IRI parsePredicate() throws ParseException
ParseException - the parse exceptionpublic final IRI parseResource() throws ParseException
ParseException - the parse exceptionpublic final void parseObjectList(IRI subject, IRI predicate) throws ParseException
subject - the subjectpredicate - the predicateParseException - the parse exceptionpublic final void parseObject(IRI subject, IRI predicate) throws ParseException
subject - the subjectpredicate - the predicateParseException - the parse exceptionpublic final IRI parseCollection() throws ParseException
ParseException - the parse exceptionpublic final IRI parseItemList() throws ParseException
ParseException - the parse exceptionpublic final void parseLiteral(IRI subject, IRI predicate) throws ParseException
subject - the subjectpredicate - the predicateParseException - the parse exceptionpublic final String parseInteger() throws ParseException
ParseException - the parse exceptionpublic final String parseDouble() throws ParseException
ParseException - the parse exceptionpublic final String parseDecimal() throws ParseException
ParseException - the parse exceptionpublic final String parseBoolean() throws ParseException
ParseException - the parse exceptionpublic final String parseQuotedString() throws ParseException
ParseException - the parse exceptionpublic final String parseString() throws ParseException
ParseException - the parse exceptionpublic void ReInit(InputStream stream)
stream - the streampublic void ReInit(InputStream stream, String encoding)
stream - the streamencoding - the encodingpublic void ReInit(Reader stream)
stream - the streampublic void ReInit(TurtleParserTokenManager tm)
tm - the tmpublic final Token getNextToken()
public final Token getToken(int index)
index - the indexpublic ParseException generateParseException()
public final void enable_tracing()
public final void disable_tracing()
Copyright © 2014 The University of Manchester. All Rights Reserved.