/*
 * Created on 2004-12-21
 *
 * Part of the Symbian development plug-in for Eclipse
 * Copyright (C) Mikołaj Zalewski, 2004
 */
package pl.zalewski.mikolaj.symbdev.core.internal.mmpparser;

import java.util.Iterator;

import org.eclipse.core.resources.IMarker;

/**
 * @author mikolaj
 */
public class FiniteChoiceTokenParser extends AbstractTokenParser {

    /**
     * @param content
     */
    public FiniteChoiceTokenParser(Iterator it, String[] choices) {
        super(it);
        fChoices=choices;
    }

    protected void parse(String token) {
        for (int i=0; i<fChoices.length; i++)
        {
            if (token.equalsIgnoreCase(fChoices[i]))
                return;
        }
        
        setError(IMarker.SEVERITY_WARNING, "Unknown token");
    }
    
    String[] fChoices;
}
