gnu.xml.xpath

Class XPathParser


public class XPathParser
extends Object

An XPath 1.0 parser.

Nested Class Summary

static class
XPathParser.yyException
thrown for irrecoverable syntax errors and stack overflow.
static interface
XPathParser.yyInput
must be implemented by a scanner object to supply input to the parser.
protected static class
XPathParser.YyCheckClass
protected static class
XPathParser.YyDefRedClass
protected static class
XPathParser.YyDgotoClass
protected static class
XPathParser.YyGindexClass
protected static class
XPathParser.YyLenClass
protected static class
XPathParser.YyLhsClass
protected static class
XPathParser.YyNameClass
protected static class
XPathParser.YyRindexClass
protected static class
XPathParser.YySindexClass
protected static class
XPathParser.YyTableClass

Field Summary

static int
ANCESTOR
static int
ANCESTOR_OR_SELF
static int
AND
static int
AT
static int
ATTRIBUTE
static int
CHILD
static int
COLON
static int
COMMA
static int
COMMENT
static int
DESCENDANT
static int
DESCENDANT_OR_SELF
static int
DIGITS
static int
DIV
static int
DOLLAR
static int
DOT
static int
DOUBLE_COLON
static int
DOUBLE_DOT
static int
DOUBLE_SLASH
static int
EQ
static int
FOLLOWING
static int
FOLLOWING_SIBLING
static int
GT
static int
GTE
static int
LB
static int
LITERAL
static int
LP
static int
LT
static int
LTE
static int
MINUS
static int
MOD
static int
NAME
static int
NAMESPACE
static int
NE
static int
NODE
static int
OR
static int
PARENT
static int
PIPE
static int
PLUS
static int
PRECEDING
static int
PRECEDING_SIBLING
static int
PROCESSING_INSTRUCTION
static int
RB
static int
RP
static int
SELF
static int
SLASH
static int
STAR
static int
TEXT
static int
UNARY
static int
yyErrorCode
protected static int
yyFinal
debugging support, requires the package jay.yydebug.
protected int
yyMax
initial size and increment of the state/value stack [default 256].

Method Summary

protected Object
yyDefault(Object first)
executed at the beginning of a reduce action.
protected String[]
yyExpecting(int state)
computes list of expected tokens on error by tracing the tables.
void
yyerror(String message)
simplified error message.
void
yyerror(String message, String[] expected)
(syntax) error message.
Object
yyparse(XPathParser.yyInput yyLex)
the generated parser.
Object
yyparse(XPathParser.yyInput yyLex, Object yydebug)
the generated parser, with debugging messages.

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Details

ANCESTOR

public static final int ANCESTOR
Field Value:
283

ANCESTOR_OR_SELF

public static final int ANCESTOR_OR_SELF
Field Value:
284

AND

public static final int AND
Field Value:
299

AT

public static final int AT
Field Value:
276

ATTRIBUTE

public static final int ATTRIBUTE
Field Value:
285

CHILD

public static final int CHILD
Field Value:
286

COLON

public static final int COLON
Field Value:
279

COMMA

public static final int COMMA
Field Value:
264

COMMENT

public static final int COMMENT
Field Value:
300

DESCENDANT

public static final int DESCENDANT
Field Value:
287

DESCENDANT_OR_SELF

public static final int DESCENDANT_OR_SELF
Field Value:
288

DIGITS

public static final int DIGITS
Field Value:
258

DIV

public static final int DIV
Field Value:
296

DOLLAR

public static final int DOLLAR
Field Value:
278

DOT

public static final int DOT
Field Value:
281

DOUBLE_COLON

public static final int DOUBLE_COLON
Field Value:
280

DOUBLE_DOT

public static final int DOUBLE_DOT
Field Value:
282

DOUBLE_SLASH

public static final int DOUBLE_SLASH
Field Value:
267

EQ

public static final int EQ
Field Value:
268

FOLLOWING

public static final int FOLLOWING
Field Value:
289

FOLLOWING_SIBLING

public static final int FOLLOWING_SIBLING
Field Value:
290

GT

public static final int GT
Field Value:
270

GTE

public static final int GTE
Field Value:
272

LB

public static final int LB
Field Value:
262

LITERAL

public static final int LITERAL
Field Value:
257

LP

public static final int LP
Field Value:
260

LT

public static final int LT
Field Value:
271

LTE

public static final int LTE
Field Value:
273

MINUS

public static final int MINUS
Field Value:
275

MOD

public static final int MOD
Field Value:
297

NAME

public static final int NAME
Field Value:
259

NAMESPACE

public static final int NAMESPACE
Field Value:
291

NE

public static final int NE
Field Value:
269

NODE

public static final int NODE
Field Value:
303

OR

public static final int OR
Field Value:
298

PARENT

public static final int PARENT
Field Value:
292

PIPE

public static final int PIPE
Field Value:
265

PLUS

public static final int PLUS
Field Value:
274

PRECEDING

public static final int PRECEDING
Field Value:
293

PRECEDING_SIBLING

public static final int PRECEDING_SIBLING
Field Value:
294

PROCESSING_INSTRUCTION

public static final int PROCESSING_INSTRUCTION
Field Value:
301

RB

public static final int RB
Field Value:
263

RP

public static final int RP
Field Value:
261

SELF

public static final int SELF
Field Value:
295

SLASH

public static final int SLASH
Field Value:
266

STAR

public static final int STAR
Field Value:
277

TEXT

public static final int TEXT
Field Value:
302

UNARY

public static final int UNARY
Field Value:
304

yyErrorCode

public static final int yyErrorCode
Field Value:
256

yyFinal

protected static final int yyFinal
debugging support, requires the package jay.yydebug. Set to null to suppress debugging messages.
Field Value:
30

yyMax

protected int yyMax
initial size and increment of the state/value stack [default 256]. This is not final so that it can be overwritten outside of invocations of yyparse().

Method Details

yyDefault

protected Object yyDefault(Object first)
executed at the beginning of a reduce action. Used as $$ = yyDefault($1), prior to the user-specified action, if any. Can be overwritten to provide deep copy, etc.
Parameters:
first - value for $1, or null.
Returns:
first.

yyExpecting

protected String[] yyExpecting(int state)
computes list of expected tokens on error by tracing the tables.
Parameters:
state - for which to compute the list.
Returns:
list of token names.

yyerror

public void yyerror(String message)
simplified error message.
See Also:
yyerror

yyerror

public void yyerror(String message,
                    String[] expected)
(syntax) error message. Can be overwritten to control message format.
Parameters:
message - text to be displayed.
expected - vector of acceptable tokens, if available.

yyparse

public Object yyparse(XPathParser.yyInput yyLex)
            throws IOException,
                   XPathParser.yyException
the generated parser. Maintains a state and a value stack, currently with fixed maximum size.
Parameters:
yyLex - scanner.
Returns:
result of the last reduction, if any.
Throws:
XPathParser.yyException - on irrecoverable parse error.

yyparse

public Object yyparse(XPathParser.yyInput yyLex,
                      Object yydebug)
            throws IOException,
                   XPathParser.yyException
the generated parser, with debugging messages. Maintains a state and a value stack, currently with fixed maximum size.
Parameters:
yyLex - scanner.
yydebug - debug message writer implementing yyDebug, or null.
Returns:
result of the last reduction, if any.
Throws:
XPathParser.yyException - on irrecoverable parse error.

XPathParser.y - An XPath 1.0 parser. Copyright (C) 2004 The Free Software Foundation This file is part of GNU Classpath. GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.