01: package net.sourceforge.pmd.cpd;
02:
03: import java.util.ArrayList;
04:
05: /**
06: * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
07: * @author Zev Blut zb@ubit.com
08: */
09:
10: public class RubyTokenizer extends AbstractTokenizer {
11: public RubyTokenizer() {
12: // setting markers for "string" in ruby
13: this .stringToken = new ArrayList<String>();
14: this .stringToken.add("\'");
15: this .stringToken.add("\"");
16: // setting markers for 'ignorable character' in Ruby
17: this .ignorableCharacter = new ArrayList<String>();
18: this .ignorableCharacter.add("{");
19: this .ignorableCharacter.add("}");
20: this .ignorableCharacter.add("(");
21: this .ignorableCharacter.add(")");
22: this .ignorableCharacter.add(";");
23: this .ignorableCharacter.add(",");
24:
25: // setting markers for 'ignorable string' in Ruby
26: this .ignorableStmt = new ArrayList<String>();
27: this .ignorableStmt.add("while");
28: this .ignorableStmt.add("do");
29: this .ignorableStmt.add("end");
30: }
31: }
|