public static PacketFilterObject 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 PacketFilterParser(exp);

                parser.Scanner = scanner;

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

                return(parser.exp_obj_);
            } catch {
                return(null);
            }
        }
Exemplo n.º 2
0
 public static PacketFilterObject Compile(string exp_text)
 {
     /* 式オブジェクトに変換 */
     return(PacketFilterParser.Parse(exp_text));
 }