Class DefineTable


  • public class DefineTable
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      DefineTable()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean containsKey​(java.lang.String def)
      See if the define table contains a definition
      java.lang.String expand​(java.lang.String image, boolean join)
      do the final expansion of "##" concats in the define strings that protect normal macro substitution.
      ghidra.app.util.cparser.CPP.PreProcessor.PPToken get​(java.lang.String string)  
      java.util.Vector<ghidra.app.util.cparser.CPP.PreProcessor.PPToken> getArgs​(java.lang.String currKey)  
      java.lang.String getDefineAt​(java.lang.StringBuffer buf, int pos)  
      java.util.Iterator<java.lang.String> getDefineNames()  
      java.lang.String getDefinitionPath​(java.lang.String defName)  
      java.lang.String getParams​(java.lang.StringBuffer buf, int start, char endChar)  
      java.lang.String getValue​(java.lang.String defName)  
      boolean isArg​(java.lang.String string)
      Check if a define has args.
      boolean isNumeric​(java.lang.String defName)
      Check if the token that defined this define was numeric
      void populateDefineEquates​(DataTypeManager dtMgr)
      Given a data type manager, populate defines with constant values as Enums
      void put​(java.lang.String string, ghidra.app.util.cparser.CPP.PreProcessor.PPToken val)
      Associate a define "name" with a Preprocessor parser token match.
      void putArg​(java.lang.String string, java.util.Vector<ghidra.app.util.cparser.CPP.PreProcessor.PPToken> val)
      Add an args definition for a define with arguments #define bubba(a,b) (a or b)
      ghidra.app.util.cparser.CPP.PreProcessor.PPToken remove​(java.lang.String string)
      Remove a definition from the known defines.
      java.util.Vector<ghidra.app.util.cparser.CPP.PreProcessor.PPToken> removeArg​(java.lang.String string)
      Get rid of args for a define
      int size()
      Size of the define table.
      java.lang.String toString​(java.lang.String string)
      display a string for the named define.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefineTable

        public DefineTable()
    • Method Detail

      • get

        public ghidra.app.util.cparser.CPP.PreProcessor.PPToken get​(java.lang.String string)
        Parameters:
        string -
        Returns:
      • getArgs

        public java.util.Vector<ghidra.app.util.cparser.CPP.PreProcessor.PPToken> getArgs​(java.lang.String currKey)
        Parameters:
        currKey -
        Returns:
      • getDefineAt

        public java.lang.String getDefineAt​(java.lang.StringBuffer buf,
                                            int pos)
        Parameters:
        image -
        pos -
        Returns:
      • put

        public void put​(java.lang.String string,
                        ghidra.app.util.cparser.CPP.PreProcessor.PPToken val)
        Associate a define "name" with a Preprocessor parser token match.
        Parameters:
        string - - name of define
        val - - token value from parsing
      • putArg

        public void putArg​(java.lang.String string,
                           java.util.Vector<ghidra.app.util.cparser.CPP.PreProcessor.PPToken> val)
        Add an args definition for a define with arguments #define bubba(a,b) (a or b)
        Parameters:
        string - name of define
        val - set of arg token names
      • containsKey

        public boolean containsKey​(java.lang.String def)
        See if the define table contains a definition
        Parameters:
        def -
        Returns:
      • size

        public int size()
        Size of the define table.
        Returns:
      • remove

        public ghidra.app.util.cparser.CPP.PreProcessor.PPToken remove​(java.lang.String string)
        Remove a definition from the known defines.
        Parameters:
        string - name of define
        Returns:
        return the defined token for the named define.
      • isArg

        public boolean isArg​(java.lang.String string)
        Check if a define has args.
        Parameters:
        string - name of define
        Returns:
      • removeArg

        public java.util.Vector<ghidra.app.util.cparser.CPP.PreProcessor.PPToken> removeArg​(java.lang.String string)
        Get rid of args for a define
        Parameters:
        string - name of define
        Returns:
      • toString

        public java.lang.String toString​(java.lang.String string)
        display a string for the named define.
        Parameters:
        string - named define
        Returns:
      • getDefineNames

        public java.util.Iterator<java.lang.String> getDefineNames()
        Returns:
        an iterator over the defined string names
      • getValue

        public java.lang.String getValue​(java.lang.String defName)
      • isNumeric

        public boolean isNumeric​(java.lang.String defName)
        Check if the token that defined this define was numeric
        Parameters:
        defName -
        Returns:
      • getDefinitionPath

        public java.lang.String getDefinitionPath​(java.lang.String defName)
      • getParams

        public java.lang.String getParams​(java.lang.StringBuffer buf,
                                          int start,
                                          char endChar)
        Parameters:
        image -
        i -
        Returns:
      • expand

        public java.lang.String expand​(java.lang.String image,
                                       boolean join)
        do the final expansion of "##" concats in the define strings that protect normal macro substitution.
        Parameters:
        image -
        join -
        Returns:
      • populateDefineEquates

        public void populateDefineEquates​(DataTypeManager dtMgr)
        Given a data type manager, populate defines with constant values as Enums