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