1 package net.sourceforge.phpdt.internal.compiler.parser;
3 import java.util.ArrayList;
5 public class UninitializedVariableHandler {
7 private class Function {
12 public Function(String name, int count) {
18 private String functionName = null;
20 private int argumentCount = 0;
22 private ArrayList functions = new ArrayList();
24 public UninitializedVariableHandler() {
29 add("preg_match_all", 3);
30 add("preg_replace", 5);
31 add("preg_replace_callback", 5);
34 private void add(String name, int countFrom) {
35 functions.add(new Function(name, countFrom));
38 protected boolean reportError() {
39 if (functionName != null) {
40 for (int i = 0; i < functions.size(); i++) {
41 Function function = (Function) functions.get(i);
42 if (functionName.equalsIgnoreCase(function.name)
43 && argumentCount >= function.count) {
51 public void setFunctionName(String functionName) {
52 this.functionName = functionName;
55 public void incrementArgumentCount() {