View Javadoc

1   /**
2    * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
3    */
4   package net.sourceforge.pmd.cpd;
5   
6   import java.util.ArrayList;
7   
8   /**
9    *
10   * @author Zev Blut zb@ubit.com
11   */
12  public class RubyTokenizer extends AbstractTokenizer
13  {
14      public RubyTokenizer()
15      {
16  	// setting markers for "string" in ruby
17  	this.stringToken = new ArrayList<String>();
18  	this.stringToken.add("\'");
19  	this.stringToken.add("\"");
20  	// setting markers for 'ignorable character' in Ruby
21  	this.ignorableCharacter = new ArrayList<String>();
22  	this.ignorableCharacter.add("{");
23  	this.ignorableCharacter.add("}");
24  	this.ignorableCharacter.add("(");
25  	this.ignorableCharacter.add(")");
26  	this.ignorableCharacter.add(";");
27  	this.ignorableCharacter.add(",");
28  
29  	// setting markers for 'ignorable string' in Ruby
30  	this.ignorableStmt = new ArrayList<String>();
31  	this.ignorableStmt.add("while");
32  	this.ignorableStmt.add("do");
33  	this.ignorableStmt.add("end");
34      }
35  }