325N/A/*
325N/A * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
325N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
325N/A *
325N/A * This code is free software; you can redistribute it and/or modify it
325N/A * under the terms of the GNU General Public License version 2 only, as
325N/A * published by the Free Software Foundation. Oracle designates this
325N/A * particular file as subject to the "Classpath" exception as provided
325N/A * by Oracle in the LICENSE file that accompanied this code.
325N/A *
325N/A * This code is distributed in the hope that it will be useful, but WITHOUT
325N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
325N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
325N/A * version 2 for more details (a copy is included in the LICENSE file that
325N/A * accompanied this code).
325N/A *
325N/A * You should have received a copy of the GNU General Public License version
325N/A * 2 along with this work; if not, write to the Free Software Foundation,
325N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
325N/A *
325N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
325N/A * or visit www.oracle.com if you need additional information or have any
325N/A * questions.
325N/A */
325N/A/*
325N/A * Copyright (C) 2004-2011
325N/A *
325N/A * Permission is hereby granted, free of charge, to any person obtaining a copy
325N/A * of this software and associated documentation files (the "Software"), to deal
325N/A * in the Software without restriction, including without limitation the rights
325N/A * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
325N/A * copies of the Software, and to permit persons to whom the Software is
325N/A * furnished to do so, subject to the following conditions:
325N/A *
325N/A * The above copyright notice and this permission notice shall be included in
325N/A * all copies or substantial portions of the Software.
325N/A *
325N/A * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
325N/A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
325N/A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
325N/A * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
325N/A * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
325N/A * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
325N/A * THE SOFTWARE.
325N/A */
325N/A/* Generated By:JavaCC: Do not edit this line. Token.java Version 5.0 */
325N/A/* JavaCCOptions:TOKEN_EXTENDS=,KEEP_LINE_COL=null,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
325N/Apackage com.sun.xml.internal.rngom.parse.compact;
325N/A
325N/A/**
325N/A * Describes the input token stream.
325N/A */
325N/A
325N/Apublic class Token implements java.io.Serializable {
325N/A
325N/A /**
325N/A * The version identifier for this Serializable class.
325N/A * Increment only if the <i>serialized</i> form of the
325N/A * class changes.
325N/A */
325N/A private static final long serialVersionUID = 1L;
325N/A
325N/A /**
325N/A * An integer that describes the kind of this token. This numbering
325N/A * system is determined by JavaCCParser, and a table of these numbers is
325N/A * stored in the file ...Constants.java.
325N/A */
325N/A public int kind;
325N/A
325N/A /** The line number of the first character of this Token. */
325N/A public int beginLine;
325N/A /** The column number of the first character of this Token. */
325N/A public int beginColumn;
325N/A /** The line number of the last character of this Token. */
325N/A public int endLine;
325N/A /** The column number of the last character of this Token. */
325N/A public int endColumn;
325N/A
325N/A /**
325N/A * The string image of the token.
325N/A */
325N/A public String image;
325N/A
325N/A /**
325N/A * A reference to the next regular (non-special) token from the input
325N/A * stream. If this is the last token from the input stream, or if the
325N/A * token manager has not read tokens beyond this one, this field is
325N/A * set to null. This is true only if this token is also a regular
325N/A * token. Otherwise, see below for a description of the contents of
325N/A * this field.
325N/A */
325N/A public Token next;
325N/A
325N/A /**
325N/A * This field is used to access special tokens that occur prior to this
325N/A * token, but after the immediately preceding regular (non-special) token.
325N/A * If there are no such special tokens, this field is set to null.
325N/A * When there are more than one such special token, this field refers
325N/A * to the last of these special tokens, which in turn refers to the next
325N/A * previous special token through its specialToken field, and so on
325N/A * until the first special token (whose specialToken field is null).
325N/A * The next fields of special tokens refer to other special tokens that
325N/A * immediately follow it (without an intervening regular token). If there
325N/A * is no such token, this field is null.
325N/A */
325N/A public Token specialToken;
325N/A
325N/A /**
325N/A * An optional attribute value of the Token.
325N/A * Tokens which are not used as syntactic sugar will often contain
325N/A * meaningful values that will be used later on by the compiler or
325N/A * interpreter. This attribute value is often different from the image.
325N/A * Any subclass of Token that actually wants to return a non-null value can
325N/A * override this method as appropriate.
325N/A */
325N/A public Object getValue() {
325N/A return null;
325N/A }
325N/A
325N/A /**
325N/A * No-argument constructor
325N/A */
325N/A public Token() {}
325N/A
325N/A /**
325N/A * Constructs a new token for the specified Image.
325N/A */
325N/A public Token(int kind)
325N/A {
325N/A this(kind, null);
325N/A }
325N/A
325N/A /**
325N/A * Constructs a new token for the specified Image and Kind.
325N/A */
325N/A public Token(int kind, String image)
325N/A {
325N/A this.kind = kind;
325N/A this.image = image;
325N/A }
325N/A
325N/A /**
325N/A * Returns the image.
325N/A */
325N/A public String toString()
325N/A {
325N/A return image;
325N/A }
325N/A
325N/A /**
325N/A * Returns a new Token object, by default. However, if you want, you
325N/A * can create and return subclass objects based on the value of ofKind.
325N/A * Simply add the cases to the switch for all those special cases.
325N/A * For example, if you have a subclass of Token called IDToken that
325N/A * you want to create if ofKind is ID, simply add something like :
325N/A *
325N/A * case MyParserConstants.ID : return new IDToken(ofKind, image);
325N/A *
325N/A * to the following switch statement. Then you can cast matchedToken
325N/A * variable to the appropriate type and use sit in your lexical actions.
325N/A */
325N/A public static Token newToken(int ofKind, String image)
325N/A {
325N/A switch(ofKind)
325N/A {
325N/A default : return new Token(ofKind, image);
325N/A }
325N/A }
325N/A
325N/A public static Token newToken(int ofKind)
325N/A {
325N/A return newToken(ofKind, null);
325N/A }
325N/A
325N/A}
325N/A/* JavaCC - OriginalChecksum=07395369f4a62ea6ce44cc3487e30e69 (do not edit this line) */