1 package net.sourceforge.phpdt.internal.compiler.parser;
3 import java.util.ArrayList;
5 public class UninitializedVariableHandler {
7 private class Function {
11 public Function(String name, int count) {
17 private String functionName=null;
18 private int argumentCount=0;
19 private ArrayList functions=new ArrayList();
21 public UninitializedVariableHandler() {
26 add("preg_match_all",3);
27 add("preg_replace",5);
28 add("preg_replace_callback",5);
31 private void add(String name, int countFrom) {
32 functions.add(new Function(name,countFrom));
35 protected boolean reportError() {
36 if (functionName!=null) {
37 for (int i=0; i<functions.size();i++) {
38 Function function=(Function) functions.get(i);
39 if (functionName.equalsIgnoreCase(function.name) && argumentCount>=function.count) {
47 public void setFunctionName(String functionName) {
48 this.functionName=functionName;
51 public void incrementArgumentCount() {