All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sourceforge.pmd.cpd.RubyTokenizer Maven / Gradle / Ivy

/**
 * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
 */

package net.sourceforge.pmd.cpd;

import java.util.ArrayList;

/**
 * Tokenizer for Ruby.
 *
 * @author Zev Blut [email protected]
 */
public class RubyTokenizer extends AbstractTokenizer {

    /**
     * Creates a new Ruby tokenizer.
     */
    public RubyTokenizer() {
        // setting markers for "string" in ruby
        this.stringToken = new ArrayList<>();
        this.stringToken.add("\'");
        this.stringToken.add("\"");
        // setting markers for 'ignorable character' in Ruby
        this.ignorableCharacter = new ArrayList<>();
        this.ignorableCharacter.add("{");
        this.ignorableCharacter.add("}");
        this.ignorableCharacter.add("(");
        this.ignorableCharacter.add(")");
        this.ignorableCharacter.add(";");
        this.ignorableCharacter.add(",");

        // setting markers for 'ignorable string' in Ruby
        this.ignorableStmt = new ArrayList<>();
        this.ignorableStmt.add("while");
        this.ignorableStmt.add("do");
        this.ignorableStmt.add("end");
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy