Beispiel #1
0
        public static byte[] Parse(string exp)
        {
            try {
                if (exp == null)
                {
                    return(null);
                }
                if (exp.Length == 0)
                {
                    return(null);
                }

                var scanner = new Scanner();

                scanner.SetSource(exp, 0);

                var parser = new BinaryTextParser();

                parser.Scanner = scanner;

                if (!parser.Parse())
                {
                    return(null);
                }

                var result = parser.CurrentSemanticValue.value_bin;

                if (result == null)
                {
                    return(null);
                }

                return(result.GetBytes());
            } catch {
                return(null);
            }
        }
Beispiel #2
0
 public static byte[] Build(string exp_text)
 {
     /* 式オブジェクトに変換 */
     return(BinaryTextParser.Parse(exp_text));
 }