Adding Parameterized Blocks to SBT Files

So I examined how the XML Parsers worked and came up with the following that shows which methods processes which XML Elements:

V1 Parser

  • processDerivedItemDefinition - this calls processValueDef
    • DiscreteInfo
      • Set of Discrete Elements
        • Structure Elements
          • Set of Item Names
          • Categories Element
            • Sets of Inclusion and Exclusion
    • DefaultValue
    • RangeInfo ← Should range info have block support?
  • processValueDef - this calls processItemDef
    • Labels
    • ExpressionType
    • ChildrenDefiniitons
  • processItemDef
    • Categories
    • Description Elements
  • getCategories
    • set of category elements - currently don’t care about the element name
  • process - method explicitly searched for specific elements - would need to be restructured if we wanted to have block support
    • Analyses - set of Analysis Elements
      • Analysis Element - set of category elements
    • AdvanceLevels - set of Advance Level Elements
    • ActiveCategories - set of Category Elements
    • ItemBlocks
    • AssociationRules
    • Definitions
    • Attributes
    • Views
  • processDefinition
    • Color Information elements
    • Description Elements
    • Association Information Element
    • ItemDefiniitons

V2 Parser

  • processDefinition - added RootName attribute
  • added extensible File and Directory items and defs
  • Added extensible MeshEnitity Items
  • Added Secure StringItemDefs
  • New View parsing done in View namespace

V3 Parser

  • process
    • Configurations
    • Associations
  • processDefiniitonInformation
    • Exclusions
    • Prerequisites
  • processDefinition
    • Categories
    • Tags
  • processAssociationDef - replaces V1 Implementation
  • processReferenceIDef - replaces V1 Implementation
    • Accepts
    • Rejects
    • ConditionalInfo

V4

  • process
    • Evaluators
  • processDefiniiton
    • AssociationRule
    • DissasociationRule
  • processItemDef
    • Tags

V5

  • nothing definition related

V6

  • New Category Format

The main issue is that the parsers work by searching for explicit elements in the XML representation and then processing those elements. In order to put in Block support, we need to invert the control logic so that we iterate over all of the XML child elements and pass them into methods that will determine how they should be processed. If the V(X) Parser implementation does not recognized the element type then it is passed to the V(X-1) implementation.

The iteration method would then explicitly look to see if a Block Instantiation Element is encountered, create the appropriate block of XML elements and then recursively call itself with those elements.

I plan on initially doing this for Definition (so that Blocks could be used for Association Information, and for Value Item Definitions so that Blocks can be used for Discrete Information) but this can be expanded later if there is need.