forked from cnescatlab/i-CodeCNES
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…unction class to allow local and global variable handling with regards to the function
- Loading branch information
1 parent
1c131fd
commit ed875cd
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
...lysis.tools.shell.rules/src/fr/cnes/analysis/tools/shell/rules/FunctionWithVariables.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
|
||
/************************************************************************************************/ | ||
/* i-Code CNES is a static code analyzer. */ | ||
/* This software is a free software, under the terms of the Eclipse Public License version 1.0. */ | ||
/* http://www.eclipse.org/legal/epl-v10.html */ | ||
/************************************************************************************************/ | ||
package fr.cnes.analysis.tools.shell.rules; | ||
|
||
import java.util.ArrayList; | ||
|
||
import fr.cnes.analysis.tools.shell.metrics.Function; | ||
|
||
/** | ||
* This class can be used to handle functions and their local and global variables. | ||
*/ | ||
public class FunctionWithVariables extends Function { | ||
|
||
/* localVariables: the list of local variables in the function */ | ||
private ArrayList<String> localVariables = null; | ||
/* globalVariables: the list of global variables in the function */ | ||
private ArrayList<String> globalVariables = null; | ||
|
||
/** | ||
* @param pName | ||
* Function's name | ||
* @param pBeginLine | ||
* Function's line | ||
* @param pStarter | ||
* Function's starter. | ||
*/ | ||
public FunctionWithVariables(String pName, int pBeginLine, String pStarter) { | ||
super(pName, pBeginLine, pStarter); | ||
this.localVariables = new ArrayList<String>(); | ||
this.globalVariables = new ArrayList<String>(); | ||
} | ||
|
||
public ArrayList<String> getLocalVariables() { | ||
return this.localVariables; | ||
} | ||
|
||
public ArrayList<String> getGlobalVariables() { | ||
return this.globalVariables; | ||
} | ||
|
||
} |