Beispiel #1
0
            public static NumberParseTreeElement createFloat(float value)
            {
                NumberParseTreeElement resultTreeElement = new NumberParseTreeElement(EnumNumberType.FLOAT);

                resultTreeElement.valueFloat = value;

                return(resultTreeElement);
            }
Beispiel #2
0
            public static NumberParseTreeElement createInteger(int integer)
            {
                NumberParseTreeElement resultTreeElement = new NumberParseTreeElement(EnumNumberType.INTEGER);

                resultTreeElement.valueInt = integer;

                return(resultTreeElement);
            }
Beispiel #3
0
        static private ParseTreeElement parseFloat(string text)
        {
            Regex regexFloat = new Regex("^(?<value>-?\\d+\\.\\d+)");
            Match match;
            float value;

            match = regexFloat.Match(text);
            System.Diagnostics.Debug.Assert(match.Success);
            float.TryParse(match.Groups["value"].Value, NumberStyles.Any, CultureInfo.InvariantCulture, out value);

            return(NumberParseTreeElement.createFloat(value));
        }
Beispiel #4
0
 static private ParseTreeElement parseInteger(string text)
 {
     return(NumberParseTreeElement.createInteger(Convert.ToInt32(text)));
 }
Beispiel #5
0
            public static NumberParseTreeElement createInteger(int integer)
            {
                NumberParseTreeElement resultTreeElement = new NumberParseTreeElement(EnumNumberType.INTEGER);
                resultTreeElement.valueInt = integer;

                return resultTreeElement;
            }
Beispiel #6
0
            public static NumberParseTreeElement createFloat(float value)
            {
                NumberParseTreeElement resultTreeElement = new NumberParseTreeElement(EnumNumberType.FLOAT);
                resultTreeElement.valueFloat = value;

                return resultTreeElement;
            }