Skip to content

Commit

Permalink
cnescatlab#113 cnescatlab#52 cnescatlab#49 Added an overload of the F…
Browse files Browse the repository at this point in the history
…unction class to allow local and

global variable handling with regards to the function
  • Loading branch information
brigittehuynh committed Jun 24, 2018
1 parent 1c131fd commit ed875cd
Showing 1 changed file with 45 additions and 0 deletions.
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;
}

}

0 comments on commit ed875cd

Please sign in to comment.