public virtual Parser build()
        {
            Parser   parser = new Parser();
            PopStack pop    = new PopStack(repo, file_);

            AAction.displaySemi  = false;
            AAction.displayStack = false;
            PushStack       push     = new PushStack(repo);
            DetectNamespace detectNS = new DetectNamespace();

            detectNS.add(push);
            parser.add(detectNS);
            DetectType detectTP = new DetectType();

            detectTP.add(push);
            parser.add(detectTP);
            DetectDelegate detectDE = new DetectDelegate();

            detectDE.add(push);
            detectDE.add(pop);
            parser.add(detectDE);
            DetectFunction detectFN = new DetectFunction();

            detectFN.add(push);
            parser.add(detectFN);
            DetectAnonymousScope anon = new DetectAnonymousScope();

            anon.add(push);
            parser.add(anon);
            DetectAlias    detectAL  = new DetectAlias();
            CollectAliases collectAL = new CollectAliases(repo);

            detectAL.add(collectAL);
            parser.add(detectAL);
            DetectLeavingScope leave = new DetectLeavingScope();

            leave.add(pop);
            parser.add(leave);
            DetectUsingNamespace detectUN  = new DetectUsingNamespace();
            CollectNamespace     collectNM = new CollectNamespace(repo, file_);

            detectUN.add(collectNM);
            parser.add(detectUN);
            return(parser);
        }
Ejemplo n.º 2
0
        public virtual Parser build()
        {
            Parser parser = new Parser();

            // decide what to show
            AAction.displaySemi  = false;
            AAction.displayStack = false;  // this is default so redundant
            // action used for namespaces, classes, and functions
            PushStack push = new PushStack(repo);
            // capture namespace info
            DetectNamespace detectNS = new DetectNamespace();

            detectNS.add(push);
            parser.add(detectNS);
            // capture class info
            DetectClass detectCl = new DetectClass();

            detectCl.add(push);
            parser.add(detectCl);
            // capture enum info
            DetectEnum detectEn = new DetectEnum();

            detectEn.add(push);
            parser.add(detectEn);
            // capture Delegate info
            DetectDelegate detectDe = new DetectDelegate();

            detectDe.add(push);
            parser.add(detectDe);
            // capture function info
            DetectFunction detectFN = new DetectFunction();

            detectFN.add(push);
            parser.add(detectFN);
            //Detect Complexity
            DetectComplexity detectComp = new DetectComplexity();

            detectComp.add(push);
            parser.add(detectComp);
            // handle entering anonymous scopes, e.g., if, while, etc.
            DetectAnonymousScope anon = new DetectAnonymousScope();

            anon.add(push);
            parser.add(anon);
            // handle leaving scopes
            DetectLeavingScope leave = new DetectLeavingScope();
            PopStack           pop   = new PopStack(repo);

            leave.add(pop);
            parser.add(leave);
            // parser configured
            return(parser);
        }
Ejemplo n.º 3
0
        public virtual Parser build()
        {
            Parser parser = new Parser();

            // decide what to show
            AAction.displaySemi  = false;
            AAction.displayStack = false;  // false is default
            // action used for namespaces, classes, and functions
            PushStack push = new PushStack(repo);
            // capture namespace info
            DetectNamespace detectNS = new DetectNamespace();

            detectNS.add(push);
            parser.add(detectNS);
            // capture class info
            DetectClass detectCl = new DetectClass();

            detectCl.add(push);
            parser.add(detectCl);
            // capture delegate info
            DetectDelegate detectDE = new DetectDelegate();
            SaveDeclar     print_1  = new SaveDeclar(repo);

            detectDE.add(print_1);
            parser.add(detectDE);
            // capture function info
            DetectFunction detectFN = new DetectFunction();

            detectFN.add(push);
            parser.add(detectFN);
            // capture DetectAlias info
            DetectAlias detectAL = new DetectAlias();
            SaveDeclar  print_2  = new SaveDeclar(repo);

            detectAL.add(print_2);
            parser.add(detectAL);
            // handle entering anonymous scopes, e.g., if, while, etc.
            DetectAnonymousScope anon = new DetectAnonymousScope();

            anon.add(push);
            parser.add(anon);
            // handle leaving scopes
            DetectLeavingScope leave = new DetectLeavingScope();
            PopStack           pop   = new PopStack(repo);

            leave.add(pop);
            parser.add(leave);
            // parser configured
            return(parser);
        }
Ejemplo n.º 4
0
        public virtual Parser build()
        {
            Parser parser = new Parser();

            AAction.displaySemi  = false;
            AAction.displayStack = false;
            PushStack       push     = new PushStack(repo);
            DetectNamespace detectNS = new DetectNamespace();

            detectNS.add(push);
            parser.add(detectNS);
            DetectUsing detectUS = new DetectUsing();

            detectUS.add(push);
            parser.add(detectUS);
            DetectDelegate detectDel = new DetectDelegate();

            detectDel.add(push);
            parser.add(detectDel);
            DetectClass detectCl = new DetectClass();

            detectCl.add(push);
            parser.add(detectCl);
            DetectFunction detectFN = new DetectFunction();

            detectFN.add(push);
            parser.add(detectFN);
            DetectAnonymousScope anon = new DetectAnonymousScope();

            anon.add(push);
            parser.add(anon);
            DetectPublicDeclar pubDec = new DetectPublicDeclar();
            SaveDeclar         print  = new SaveDeclar(repo);

            pubDec.add(print);
            parser.add(pubDec);
            DetectLeavingScope leave = new DetectLeavingScope();
            PopStack           pop   = new PopStack(repo);

            leave.add(pop);
            parser.add(leave);
            return(parser);
        }
Ejemplo n.º 5
0
        public virtual Parser build()
        {
            Parser parser = new Parser();

            AAction.displaySemi  = false;         // decide what to show
            AAction.displayStack = false;         // false is default
            PushStack push = new PushStack(repo); // action used for namespaces, classes, and functions

            // capture namespace info
            DetectNamespace detectNS = new DetectNamespace();

            detectNS.add(push);
            parser.add(detectNS);

            DetectDelegate detectDel = new DetectDelegate(); // capture delegates info

            detectDel.add(push);
            parser.add(detectDel);

            DetectClass detectCl = new DetectClass(); // capture class info

            detectCl.add(push);
            parser.add(detectCl);

            DetectUsing detectUsing = new DetectUsing();   // capture using info

            detectUsing.add(push);
            parser.add(detectUsing);

            DetectLeavingScope leave = new DetectLeavingScope();  // handle leaving scopes
            PopStack           pop   = new PopStack(repo);

            leave.add(pop);
            parser.add(leave);

            return(parser);  // parser configured
        }
        public virtual Parser build()
        {
            Parser parser = new Parser();

            // decide what to show
            AAction.displaySemi  = false;
            AAction.displayStack = false; // false is default
            // action used for namespaces, classes, and functions
            PushStack      push       = new PushStack(repo);
            writeTypeTable writetable = new writeTypeTable(repo);                            //add write TypeTable Action to the rules
            // capture namespace info
            DetectNamespace detectNS = new DetectNamespace();

            detectNS.add(push);
            //detectNS.add(writetable);                                                        //add write TypeTable Action to the rules
            parser.add(detectNS);
            // capture class info
            DetectClass detectCl = new DetectClass();

            detectCl.add(push);
            detectCl.add(writetable);
            parser.add(detectCl);
            // capture function info
            DetectFunction detectFN = new DetectFunction();

            detectFN.add(push);
            detectFN.add(writetable);                                                       //add write TypeTable Action to the rules
            parser.add(detectFN);
            DetectDelegate detectD = new DetectDelegate();                                  //capture delegate info

            detectD.add(push);
            detectD.add(writetable);
            parser.add(detectD);
            DetectAlias detectAl = new DetectAlias();                                       //capture Alias info

            detectAl.add(push);
            detectD.add(writetable);
            parser.add(detectAl);
            DetectEnum detectEn = new DetectEnum();                                          //capture Enum info

            detectEn.add(push);
            detectEn.add(writetable);
            parser.add(detectEn);
            // handle entering anonymous scopes, e.g., if, while, etc.
            DetectAnonymousScope anon = new DetectAnonymousScope();

            anon.add(push);
            parser.add(anon);
            // show public declarations
            DetectPublicDeclar pubDec = new DetectPublicDeclar();
            SaveDeclar         print  = new SaveDeclar(repo);

            pubDec.add(print);
            parser.add(pubDec);
            // handle leaving scopes
            DetectLeavingScope leave = new DetectLeavingScope();
            PopStack           pop   = new PopStack(repo);

            leave.add(pop);
            parser.add(leave);     // parser configured
            return(parser);
        }
        public virtual Parser build()
        {
            Parser   parser = new Parser();
            PopStack pop    = new PopStack(repo, file_);

            // decide what to show
            AAction.displaySemi  = false;
            AAction.displayStack = false;  // false is default

            // action used for namespaces, classes, and functions
            PushStack push = new PushStack(repo);

            // capture namespace info
            DetectNamespace detectNS = new DetectNamespace();

            detectNS.add(push);
            parser.add(detectNS);

            //// capture type info
            DetectType detectTP = new DetectType();

            detectTP.add(push);
            parser.add(detectTP);

            DetectDelegate detectDE = new DetectDelegate();

            detectDE.add(push);
            detectDE.add(pop);
            parser.add(detectDE);

            //// capture function info
            DetectFunction detectFN = new DetectFunction();

            detectFN.add(push);
            parser.add(detectFN);

            //// handle entering anonymous scopes, e.g., if, while, etc.
            DetectAnonymousScope anon = new DetectAnonymousScope();

            anon.add(push);
            parser.add(anon);

            DetectAlias    detectAL  = new DetectAlias();
            CollectAliases collectAL = new CollectAliases(repo);

            detectAL.add(collectAL);
            parser.add(detectAL);

            // handle leaving scopes
            DetectLeavingScope leave = new DetectLeavingScope();

            leave.add(pop);
            parser.add(leave);

            DetectUsingNamespace detectUN  = new DetectUsingNamespace();
            CollectNamespace     collectNM = new CollectNamespace(repo, file_);

            detectUN.add(collectNM);
            parser.add(detectUN);

            // parser configured
            return(parser);
        }
        public virtual Parser build()
        {
            Parser parser = new Parser();

              // decide what to show
              AAction.displaySemi = true;
              AAction.displayStack = false;  // this is default so redundant

              // action used for namespaces, classes, and functions
              PushStack push = new PushStack(repo);

              // capture namespace info
              DetectNamespace detectNS = new DetectNamespace();
              detectNS.add(push);
              parser.add(detectNS);

              // capture class info
              DetectClass detectCl = new DetectClass();
              detectCl.add(push);
              parser.add(detectCl);

              // capture enum info
             /* DetectEnum detectEN = new DetectEnum();
              detectEN.add(push);
              parser.add(detectEN);*/

              // capture delegate info
              DetectDelegate detectDl = new DetectDelegate();
              detectDl.add(push);
              parser.add(detectDl);

              // capture function info
              DetectFunction detectFN = new DetectFunction();
              detectFN.add(push);
              parser.add(detectFN);

              // handle entering anonymous scopes, e.g., if, while, etc.
              DetectAnonymousScope anon = new DetectAnonymousScope();
              anon.add(push);
              parser.add(anon);

              // handle leaving scopes
              DetectLeavingScope leave = new DetectLeavingScope();
              PopStack pop = new PopStack(repo);
              leave.add(pop);
              parser.add(leave);

              // parser configured
              return parser;
        }
 public virtual Parser build()    {
   Parser parser = new Parser();
   AAction.displaySemi = false;
   AAction.displayStack = false;  // this is default so redundant
   PushStack push = new PushStack(repo);
   // capture namespace info
   DetectNamespace detectNS = new DetectNamespace();
   detectNS.add(push);
   parser.add(detectNS);
   // capture struct info
   DetectStruct detectSt = new DetectStruct();
   detectSt.add(push);
   parser.add(detectSt);
   // capture enum info
   DetectEnum detectEn = new DetectEnum();
   detectEn.add(push);
   parser.add(detectEn);
   // capture delegate info
   DetectDelegate detectDl = new DetectDelegate();
   detectDl.add(push);
   parser.add(detectDl);
   // capture class info
   DetectClass detectCl = new DetectClass();
   detectCl.add(push);
   parser.add(detectCl);
   // capture function info
   DetectFunction detectFN = new DetectFunction();
   detectFN.add(push);
   parser.add(detectFN);
   // handle entering anonymous scopes, e.g., if, while, etc.
   DetectAnonymousScope anon = new DetectAnonymousScope();
   anon.add(push);
   parser.add(anon);
   // capture array info
   DetectArray detectArr = new DetectArray();
   detectArr.add(push);
   parser.add(detectArr);
   // handle leaving scopes
   DetectLeavingScope leave = new DetectLeavingScope();
   PopStack pop = new PopStack(repo);
   leave.add(pop);
   parser.add(leave);
   // capture bracelessscope info
   DetectBraceLess detectBL = new DetectBraceLess();
   detectBL.add(push);
   parser.add(detectBL);
   // parser configured
   return parser;
 }
Ejemplo n.º 10
0
        public virtual Parser build()//Virtual function returns reference to parser ss
        {
            Parser parser = new Parser();


            // decide what to show
            AAction.displaySemi  = false;  //Change here to see things running ss
            AAction.displayStack = false;  // false is default

            // action used for namespaces, classes, and functions
            PushStack push = new PushStack(repo);

            // capture namespace info
            DetectNamespace detectNS = new DetectNamespace();

            detectNS.add(push);
            parser.add(detectNS);//one rule one action

            // capture delegate info
            DetectDelegate detectDG = new DetectDelegate();

            detectDG.add(push);
            parser.add(detectDG);

            // capture Alias info
            DetectAlias detectAL = new DetectAlias();

            detectAL.add(push);
            parser.add(detectAL);

            // capture class info
            DetectClass detectCl = new DetectClass();

            detectCl.add(push);
            parser.add(detectCl);

            // capture function info
            DetectFunction detectFN = new DetectFunction();

            detectFN.add(push);
            parser.add(detectFN);

            // handle entering anonymous scopes, e.g., if, while, etc.
            DetectAnonymousScope anon = new DetectAnonymousScope();

            anon.add(push);
            parser.add(anon);

            // show public declarations
            DetectPublicDeclar pubDec = new DetectPublicDeclar();
            SaveDeclar         print  = new SaveDeclar(repo);

            pubDec.add(print);
            parser.add(pubDec);

            // handle leaving scopes
            DetectLeavingScope leave = new DetectLeavingScope();
            PopStack           pop   = new PopStack(repo);

            leave.add(pop);
            parser.add(leave);

            // parser configured
            return(parser);
        }