/*
* JMEP - Java Mathematical Expression Parser.
* Copyright (C) 1999 Jo Desmet
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* You can contact the Original submitter of this library by
* email at: Jo_Desmet@yahoo.com.
*
*/
package com.iabcinc.jmep.tokens;
public class Token {
public static final int MRK = 0; // Start/End of expression
public static final int OPA = 1; // Open parentheses (
public static final int FNC = 2; // Function call f(
public static final int CMA = 3; // Comma ,
public static final int UNA = 4; // Unary operator -x
public static final int BIN = 5; // Binary operator x+y
public static final int VAL = 6; // Value 1.2
public static final int VAR = 7; // Variable a
public static final int CPA = 8; // Close parentheses )
public static final int ERR = 9; // Syntax Error
public static final int UNI = 10; // Unit operator mm
public final int m_kToken;
public final int m_iPosition;
public Token(int kToken) {
m_kToken = kToken;
m_iPosition = -1;
}
public Token(int kToken,int iPosition) {
m_kToken = kToken;
m_iPosition = iPosition;
}
public final int getKindOfToken() {
return m_kToken;
}
public final int getPosition() {
return m_iPosition;
}
}