Package eu.bandm.tools.tpath.parser2
Class Parser<D>
java.lang.Object
eu.bandm.tools.tpath.parser2.Parser<D>
- Type Parameters:
D
- Document type identifier
Parser for tpath expressions, based on
bandm Lexic
and Ramus
.
The syntax implemented here does differ slightly from the proposal
in [XPath 1.0] and is as follows:
abbreviatedStep ::= selfStep | parentStep separator ::= slash | doubleSlash abbreviatedAxisSpecifier ::= @ |explicitAxisSpecifier ::= ("ancestor" | "ancestorOrSelf" | ...), "::" axisSpecifier ::= explicitAxisSpecifier | abbreviatedAxisSpecifier nodeTest ::= nameTest | testComment| testText | testNode | testPI | testNodeUri | testElement explicitStep ::= axisSpecifier, nodetest, predicate* step ::= explicitStep | abbreviatedStep relativeStep ::= separator, step f_relativeLocationPath ::= step, relativeStep* relativeLocationPath ::= f_relativeLocationPath absoluteLocationPath ::= separator, f_relativeLocationPath locationPath ::= absoluteLocationPath | relativeLocationPath ( abbreviatedRelativeLocationPath and abbreviatedAbsoluteLocationPath are already realized by allowing everywhere the separator "//".)
-
Field Summary
Modifier and TypeFieldDescription(package private) final CheckedList<TPath.Expr>
protected final Function<Location<D>,
Location<XMLDocumentIdentifier>> final Expression<D,
TokenType, TPath.Expr> final Expression<D,
TokenType, TPath.Literal> Longest sequence of characters up to the first single opening brace. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionattributeValueTemplate
(LookaheadTokenMultiplexer<Boolean, D, TokenType, int[]> mux) bracedExpr
(LookaheadTokenMultiplexer<Boolean, D, TokenType, int[]> mux) protected Location<XMLDocumentIdentifier>
encodeLocation
(Location<D> loc) protected String
Remove the leading and trailing quotes from a »literal«.protected Location<XMLDocumentIdentifier>
getLocation
(Reducer.Context<D> context) multiplexedTokenSource
(Reader reader, D sourceIndication) parse
(Reader reader, MessageReceiver<SimpleMessage<D>> msg, D sourceIndication) Service Access Point for converting a complete text (ended with EOF) into a tpath expression.parse_AVT
(Reader reader, MessageReceiver<SimpleMessage<D>> msg, D sourceIndication) parse_embed
(LookaheadTokenMultiplexer<Boolean, D, TokenType, int[]> mux) <R> R
parse_nonterminal
(Expression<D, TokenType, R> nonterminal, LookaheadTokenSource<D, TokenType, int[]> tokenSource, MessageReceiver<SimpleMessage<D>> msg) <R> R
parse_nonterminal
(Expression<D, TokenType, R> nonterminal, Reader reader, MessageReceiver<SimpleMessage<D>> msg, D sourceIndication) Service Access Point for parsing a particular non-terminal.LookaheadTokenSource<D,
TokenType, int[]> tokenSource
(Reader reader, D sourceIndication) protected Expression<D,
TokenType, String> unparsedLiteralText
(TokenType... types)
-
Field Details
-
encodeLocation
-
emptyTests
-
expr
-
non_braced
Longest sequence of characters up to the first single opening brace. -
AVT_prefix
-
-
Constructor Details
-
Parser
Instances are only needed to set the type parameter <D> = document identifier.- Parameters:
encodeLocation
- is used for generating the umod model elements.
-
-
Method Details
-
parse_nonterminal
@Opt public <R> R parse_nonterminal(Expression<D, TokenType, R> nonterminal, Reader reader, MessageReceiver<SimpleMessage<D>> msg, D sourceIndication) Service Access Point for parsing a particular non-terminal. -
parse_nonterminal
@Opt public <R> R parse_nonterminal(Expression<D, TokenType, R> nonterminal, LookaheadTokenSource<D, TokenType, int[]> tokenSource, MessageReceiver<SimpleMessage<D>> msg) -
parse
@Opt public TPath.Expr parse(Reader reader, MessageReceiver<SimpleMessage<D>> msg, D sourceIndication) Service Access Point for converting a complete text (ended with EOF) into a tpath expression. -
encodeLocation
-
tokenSource
-
getLocation
-
unparsedLiteralText
-
extract
Remove the leading and trailing quotes from a »literal«. -
bracedExpr
public Expression<D,TokenType, bracedExprTPath.FunctionCall> (LookaheadTokenMultiplexer<Boolean, D, TokenType, int[]> mux) -
parse_embed
public Expression<D,TokenType, parse_embedTPath.Expr> (LookaheadTokenMultiplexer<Boolean, D, TokenType, int[]> mux) -
attributeValueTemplate
public Expression<D,TokenType, attributeValueTemplateTPath.Expr> (LookaheadTokenMultiplexer<Boolean, D, TokenType, int[]> mux) -
multiplexedTokenSource
-
parse_AVT
@Opt public TPath.Expr parse_AVT(Reader reader, MessageReceiver<SimpleMessage<D>> msg, D sourceIndication)
-