Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[pde-dev] WhiteSpaceRules ?


i got a small problem. I am trying to write a small parser for schema. It
seems that  nextToken is always returning the a non space token and
afterwards a token which contains all white spaces till the next one.

How can i get rid of this white space token, or is this normal

Below you find the rules i have defines. May be there is somthing

   private IRule[] schemaKeywords() {
       IRule[] result = null;
       List rules = new ArrayList();

       WordRule keywords = new WordRule(new SchemaWordDetector(), unknown);
       keywords.addWord("define", define);
       keywords.addWord("use-module!", useModule);
       keywords.addWord("in-module", inModule);
       keywords.addWord("module-export!", export);

       rules.add(new SingleLineRule("\"", "\"", unknown, '\\'));
       rules.add(new SingleLineRule("'", "'", unknown, '\\'));
       rules.add(new EndOfLineRule(";", unknown));

       rules.add(new WhitespaceRule(new XMLWhitespaceDetector()));

       result = new IRule[rules.size()];
       return result;


Back to the top