Ejemplo n.º 1
0
        // input: text after "Plural-Forms:" (e.g. "nplurals=2; plural=(n != 1);"),
        // if s == 0, creates default handler
        // returns 0 if error
        public static PluralFormsCalculator Make(string str)
        {
            PluralFormsCalculator calculator = new PluralFormsCalculator();

            if (str != null)
            {
                PluralFormsScanner scanner = new PluralFormsScanner(str);
                PluralFormsParser  p       = new PluralFormsParser(scanner);
                if (!p.Parse(calculator))
                {
                    return(null);
                }
            }
            return(calculator);
        }
Ejemplo n.º 2
0
		// input: text after "Plural-Forms:" (e.g. "nplurals=2; plural=(n != 1);"),
		// if s == 0, creates default handler
		// returns 0 if error
		public static PluralFormsCalculator Make (string str)
		{
			PluralFormsCalculator calculator = new PluralFormsCalculator ();
			if (str != null)
			{
				PluralFormsScanner scanner = new PluralFormsScanner (str);
				PluralFormsParser p = new PluralFormsParser (scanner);
				if (!p.Parse (calculator))
				{
					return null;
				}
			}
			return calculator;
		}