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    * Tokenizer implementation for Fortran
10   * 
11   * @author Romain PELISSE - romain.pelisse@atosorigin.com
12   */
13  public class FortranTokenizer extends AbstractTokenizer implements Tokenizer {
14  
15      /**
16       * Creates a new instance of {@link FortranTokenizer}.
17       */
18      public FortranTokenizer() {
19          this.spanMultipleLinesString = false; // No such thing in Fortran !
20          // setting markers for "string" in Fortran
21          this.stringToken = new ArrayList<String>();
22          this.stringToken.add("\'");
23          // setting markers for 'ignorable character' in Fortran
24          this.ignorableCharacter = new ArrayList<String>();
25          this.ignorableCharacter.add("(");
26          this.ignorableCharacter.add(")");
27          this.ignorableCharacter.add(",");
28  
29          // setting markers for 'ignorable string' in Fortran
30          this.ignorableStmt = new ArrayList<String>();
31          this.ignorableStmt.add("do");
32          this.ignorableStmt.add("while");
33          this.ignorableStmt.add("end");
34          this.ignorableStmt.add("if");
35          // Fortran comment start with an !
36          this.oneLineCommentChar = '!';
37      }
38  }