I'm using the ReaderTokenizer.nextToken method to read in a CLP file and parse the contents. I have a line (test(member$ ?costctr (create$ 403L 111L 702L 189L 489L))). The nextToken method returns a "" for the list values. I tried upper and lower case L's, with no difference. I need the L's because the costctr variable is defined as a long in a Java Class, and the member$ won't find a match otherwise. I'm using Jess 7.0p1. Sample java code and clp file attached.
(test(member$ ?costctr (create$ 403L 111L 702L 189L 489L)))
package com.accuserverx.accucharge.rule;

import java.io.FileReader;

import jess.JessToken;
import jess.ReaderTokenizer;

public class TokenTest {
    public TokenTest() {
            FileReader file;
         ReaderTokenizer rt;
        JessToken jt;
         try {
                file = new FileReader("/usr/jboss/rules/tokentest.clp");
               rt = new ReaderTokenizer(file, true);
            jt = rt.nextToken();
            while (!jt.isEOF()) {
                jt = rt.nextToken();
                System.out.println("Tok="+jt.toString());
            }
         }
            catch (Exception e) {
                e.printStackTrace();
            }

    }

    public static void main(String[] args) {
        TokenTest tokenTest = new TokenTest();
    }
}
begin:vcard
fn:Jim Yates
n:Yates;Jim
email;internet:[EMAIL PROTECTED]
tel;work:214-244-4285
tel;cell:214-244-4285
x-mozilla-html:TRUE
version:2.1
end:vcard

Reply via email to