home *** CD-ROM | disk | FTP | other *** search
- package allaire.util.template;
-
- import allaire.util.TypelessValue;
- import java.io.StreamTokenizer;
- import netscape.util.Hashtable;
-
- class Token {
- private int m_enType;
- private char m_cQuote;
- private TypelessValue m_value;
- // $FF: renamed from: LP int
- static final int field_0 = 40;
- // $FF: renamed from: RP int
- static final int field_1 = 41;
- static final int COMMA = 44;
- static final int PLUS = 43;
- static final int MINUS = 45;
- static final int MUL = 42;
- static final int DIV = 47;
- static final int CONCAT = 38;
- // $FF: renamed from: LT int
- static final int field_2 = 1;
- static final int LTE = 2;
- // $FF: renamed from: GT int
- static final int field_3 = 3;
- static final int GTE = 4;
- // $FF: renamed from: EQ int
- static final int field_4 = 5;
- static final int NEQ = 6;
- static final int AND = 7;
- // $FF: renamed from: OR int
- static final int field_5 = 8;
- static final int NOT = 9;
- static final int NAME = 10;
- static final int STRING = 11;
- static final int NUMBER = 12;
- static final int EOF = -1;
- static Hashtable m_logicalOperators = new Hashtable();
-
- public char getQuoteChar() {
- return this.m_cQuote;
- }
-
- public TypelessValue getValue() {
- if (this.m_value == null) {
- if (this.m_enType == -1) {
- this.m_value = new TypelessValue("-1");
- } else {
- this.m_value = new TypelessValue(String.valueOf((char)this.m_enType));
- }
- }
-
- return this.m_value;
- }
-
- public void appendToValue(String var1) {
- TypelessValue var2 = this.getValue();
- this.m_value = new TypelessValue(var2.asString() + var1);
- }
-
- static Integer lookupOperator(String var0) {
- return (Integer)m_logicalOperators.get(var0.toUpperCase());
- }
-
- static {
- m_logicalOperators.put("LT", new Integer(1));
- m_logicalOperators.put("LTE", new Integer(2));
- m_logicalOperators.put("GT", new Integer(3));
- m_logicalOperators.put("GTE", new Integer(4));
- m_logicalOperators.put("EQ", new Integer(5));
- m_logicalOperators.put("NEQ", new Integer(6));
- m_logicalOperators.put("AND", new Integer(7));
- m_logicalOperators.put("OR", new Integer(8));
- m_logicalOperators.put("NOT", new Integer(9));
- }
-
- public int getType() {
- return this.m_enType;
- }
-
- public Token(int var1, StreamTokenizer var2) throws ExpressionException {
- switch (var1) {
- case -3:
- Integer var3 = lookupOperator(var2.sval);
- if (var3 != null) {
- this.m_enType = var3;
- return;
- }
-
- this.m_enType = 10;
- this.m_value = new TypelessValue(var2.sval);
- return;
- case -2:
- this.m_enType = 12;
- this.m_value = new TypelessValue(var2.nval);
- return;
- case -1:
- this.m_enType = -1;
- return;
- case 34:
- case 39:
- this.m_enType = 11;
- this.m_cQuote = (char)var1;
- this.m_value = new TypelessValue(var2.sval);
- return;
- case 38:
- case 40:
- case 41:
- case 42:
- case 43:
- case 44:
- case 45:
- case 47:
- this.m_enType = var1;
- return;
- default:
- throw new ExpressionException(100, "Unexpected token '" + String.valueOf((char)var1) + "' found while parsing expression.");
- }
- }
- }
-