Class ScriptParser

java.lang.Object
edu.tufts.hrilab.action.ScriptParser

public class ScriptParser extends Object
This class is mostly to help with finding the relevant parts of a control block (e.g., while, if/else, for, etc). NOTE: now this class is only needed for CONTROL types and could probably be removed if the ActionScriptLanguageParser class and EventSpec classes handled grouping the bodies of controls into single EventSpec instances. This would require EventSpecs to optionally contain children EventSpecs, but the ASLParser should be able to easily handle this, since it's already parsing the actual ASL files.
  • Constructor Details

  • Method Details

    • isEmpty

      public boolean isEmpty()
    • getType

      public EventSpec.EventType getType()
      Get the EventType of the next EventSpec.
      Returns:
    • getEventSpec

      public EventSpec getEventSpec()
      Returns the next EventSpec.
      Returns:
    • getCommand

      public String getCommand()
      The command in String form. Mostly just useful for debugging.
      Returns:
    • getBody

      public ScriptParser getBody()
      In the case of a control EventSpec, this returns the body the of control. For example, for While control, the body consists of the condition, and all the contents in the "do" block.
      Returns:
    • getRest

      public ScriptParser getRest()