Cell Inspector Command

Cell Inspector Commands

  • The Cell Inspector is a set of Inspector commands that allow the user to inspect the current cell structure hierarchy, in order to see the effect of the application of HFL instructions.
  • These commands run while the compiler is in the debugger (or pause) mode. For more information on how to enter the debugger, see the section on "Entering Debug mode" .
  • The Cell Inspector uses two state variables, which are set by the cl and t commands below:
    • The current cell number is a cursor that keeps track of the current Inspector location within the hierarchy. This cursor can be used to do relative navigation (move to cell before, move to cell after, move to parent cell, move to child cells), without having to enter the cell numbers each time.
    • The Inspector display mode determines whether the Cell Inspector will display its results in record structure format where only one cell is displayed at a time with full details, or in tree hierarchy format where the cell and its descendents are displayed in a summary format that has minimal detail. The former is very useful for checking for cell properties and the like, and the latter is useful for seeing the overall structure of a section of the document.
  • cl [<cell-num>]
    cell [<cell-num>]
    • Displays the cell record structure for the specified cell number, or for the current cell number if none specified.
    • If a cell number is specfied, it sets the Inspector's current cell number to it. Other Inspector commands can then navigate through the cell hierarchy relative to the current cell.
    • It also sets the Cell Inspector display mode so that all subsequent commands will display in record structure format.
    • EXAMPLE 1:
      • Display cell 129, which is a simple <p> text cell that is right-aligned and contains the text "Last Updated: 5/4/10" between two carriage-returns.
      • It is a child cell of cell 24, and has cell 128 before it and cell 130 after it.
      • cl 129

        CELL 129
        ------------------------------------------------------------------
        tag*          = |p|   (126)
        text          = |
                Last Updated: 9/30/16
                |
        fmt           = |ARRAY(0x515a454)|
            ---------------------------------------------------
            STYLE = "
              text-align: right "

            ---------------------------------------------------
        iclParent     = 24
        iclPrev       = 128
        iclNext       = 130
        ------------------------------------------------------------------

    • EXAMPLE 2:
      • Display cell 24, which is a <div> container cell that has children cells 25 through 130. (NOTE: the cell numbers of the child cells do not have consecutive cell numbers.)
      • It has the class body_content, and its properties are listed as "STYLE" field values.
      • The cf values are internal HFL flags that control how the cell will be displayed.
      • cl 24

        CELL 24
        ------------------------------------------------------------------
        tag           = |div|   (18)
        class         = |body_content|
        fmt           = |ARRAY(0x51554f8)|
            ---------------------------------------------------
            STYLE = "
              position: relative
              margin: 0px 20px
              padding: 10px "

            ---------------------------------------------------
            cf            = |0x700000|
            ---------------------------------------------------
            APPLY LEADING <CR>
            APPLY LEADING <CR> TO CLOSE
            APPLY LEADING INDENT
            ---------------------------------------------------
        iclParent     = 170
        iclChild      = 25
        iclLastChild  = 130
        ------------------------------------------------------------------

  • t [<cell-num>] [d <depth>]
    tree [<cell-num>] [d <depth>]
    • Displays the cell tree hierarchy for the specified cell number, or for the current cell number if none specified.
    • If a cell number is specfied, it sets the Inspector's current cell number to it. Other Inspector commands can then navigate through the cell hierarchy relative to the current cell.
    • It also sets the Cell Inspector display mode so that all subsequent commands will display in tree hierarchy format.
    • EXAMPLE 1:
      • Display the tree structure for cell 129, which is a simple <p> text cell.
      • t 129

        CELL 129
        -----------
        129 p {

              text="\n"
                   "        Last Updated: 9/30/16\n"
                   "        "
              }
        -----------

    • EXAMPLE 2:
      • Display the tree structure for cell 24, which is the 'current' Inspector cell.
      • It is a container cell that has children cells 25 through 130.
      • t\

        CELL 24
        -----------
         24 div.body_content {

           25
                text="\n"
                     "        "
           26 h2 {

                text="HFL"
                }
           27
                text="\n"
                     "        "
           28 pp {

                }
          128
                text="\n"
                     "        "
          129 p {

                text="\n"
                     "        Last Updated: 9/30/16\n"
                     "        "
                }
          130
                text="\n"
                     "        "
              }
        -----------

  • u
    up
    • Moves the current cell number cursor to the parent cell of the cell of its current value, and then displays that cell or cell hierarchy in the current Inspector display mode format.
  • d
    down
    • Moves the current cell number cursor to the first child cell of the cell of its current value, and then displays that cell or cell hierarchy in the current Inspector display mode format.
  • n
    next
    f
    • Moves the current cell number cursor to the next cell after the cell of its current value, and then displays that cell or cell hierarchy in the current Inspector display mode format.
  • p
    prev
    b
    • Moves the current cell number cursor to the previous cell before the cell of its current value, and then displays that cell or cell hierarchy in the current Inspector display mode format.
  • w [f | b]
    walk [f | b]
    • 'Walks' through the cell hierarchy in the current walk direction to the next or previous cell, sets the current cell number cursor and then displays that cell or cell hierarchy in the current Inspector display mode format.
    • When 'walking' in a forward direction, it will try to move to the next cell within the same parent cell. If there is no next cell, it will then climb the cell hierarchy parent cell after parent cell until it finds a cell that has a cell after it, then move to that next cell.
    • When 'walking' in a backward direction, it will try to move to the previous cell within the same parent cell. If there is no previous cell, it will then climb the cell hierarchy parent cell after parent cell until it finds a cell that has a cell before it, then move to that previous cell.
    • The walk command has its own walk direction state variable that determines whether by default it will 'walk' in a forward or backward direction through the cell hierarchy. The default is to walk in the forward direction.
    • If the 'f' option is specified, it will set the walk direction default to walk in a forward direction.
    • If the 'b' option is specified, it will set the walk direction default to walk in a backward direction.
  • find <string> [<root_cell_num>]
    find text <string> [<root_cell_num>]
    find format <root_cell_num>
    find id <string> [<root_cell_num>]
    find class <string> [<root_cell_num>]
     
    where:
    <root_cell_num>
    :=
    cell parent of search
    • List all of the cells that match the search criteria.
    • If <root_cell_num> is specified, it only matches against cells that are descendents of that cell. Otherwise it matches against descendents of the toplevel cell (cell 1).
    • If the text filter argument is specified, only matches cells that contain text that matches the <string>.
    • If the format filter argument is specified, only matches formatc cells that are descendents of the <root_cell_num> cell. NOTE: when this filter is used, the <root_cell_num> argument is required.
    • If the id filter argument is specified, only matches cells whose id value contains the <string>.
    • If the class filter argument is specified, only matches cells whose class value contains the <string>.
    • EXAMPLE 1:
      • List all cells whose tags, id, class or text content contain the string 'li'.
      • In the example below, it matches a portion of the class name of cell 27, and the tag name of cell 48.
      • find li
        FOUND 2 CELLS MATCHING |li|
        -----------
        27
        48
        -----------

        FOUND CELL 27
        ------------------------------------------------------------------
        tag*          = |img|   (109)
        class         = |nav_link|
        fmt           = |ARRAY(0x4659e44)|
            ---------------------------------------------------
            STYLE = "
              src: images/Commerical Bldg2.gif
              width: 256
              height: 330
              alt:  "

            ---------------------------------------------------
        iclParent     = 25
        iclPrev       = 26
        iclNext       = 28
        ------------------------------------------------------------------

        FOUND CELL 48
        ------------------------------------------------------------------
        tag*          = |li|   (116)
        text          = ||
        fmt           = |ARRAY(0x46a460c)|
            ---------------------------------------------------

            ---------------------------------------------------
            cf            = |0xf10000|
            ---------------------------------------------------
            APPLY LEADING <CR>
            APPLY LEADING <CR> TO CLOSE
            APPLY LEADING INDENT TO CLOSE
            APPLY LEADING INDENT
            APPLY TRAILING <CR>
            ---------------------------------------------------
        iclParent     = 47
        iclNext       = 49
        ------------------------------------------------------------------

    • EXAMPLE 2:
      • List all format cells that are descendents of cell 2.
      • In the example below, it finds one format cell under cell 2.
      • NOTE that it displays FORMAT CELL (REST) (RUNNING) in the cf section of the listing. This means that the cell is a format cell, and that it is currently executing.
      • find format 2
        FOUND 1 CELLS MATCHING FORMAT
        -----------
        13
        -----------

        FOUND CELL 13
        ------------------------------------------------------------------
        fmt           = |ARRAY(0x45a6de8)|
            ---------------------------------------------------
            STYLE = "
              nav_bar {
                menu: 1 THRU -1 {
                  ++(REF($MenuNum))
                  tag: menubar
                  enclose()
                  id: expand_all(MenuBar$MenuNum)          ....
                  }
                cut {
                  menu: 1 THRU -1 {}
                  }
                }
              cut {
                title {

                  }
                header? {

                  }
                nav_bar {

                  }
                body_content {

                  }        ....
                }
              cut#loc_style {
                loc_style: 1 THRU -1? {
                  tag_final:
                  }
                }
              cut#post_script {
                post_script: 1 THRU -1? {
                  tag_final:
                  }
                }
              create {
                doctype("XHTML 1.0 T")
                html {
                  xmlns: http://www.w3.org/1999/xhtml
                  head {
                    meta {}
                    paste {}
                    }
                  body {
                    div#backdrop {}
                    #body_container {}
                    }
                  }
                }
              html {
                head {
                  paste {
                    #loc_style {}
                    js_link: 1 THRU -1 {}
                    css_link: 1 THRU -1 {}
                    }
                  }
                body {
                  paste {
                    #post_script {}
                    }
                  }
                }"

            ---------------------------------------------------
            cf            = |0x30000000|
            ---------------------------------------------------
            FORMAT CELL (REST) (RUNNING)
            ---------------------------------------------------
        iclParent     = 2
        iclPrev       = 11
        iclNext       = 14
        ------------------------------------------------------------------

Previous: Debugger Inspector Commands Next: Other Inspector Commands