Class RuleBasedParserThread

java.lang.Object
java.lang.Thread
cruise.umple.parser.analysis.RuleBasedParserThread
All Implemented Interfaces:
java.lang.Runnable

public class RuleBasedParserThread
extends java.lang.Thread
This class is for parsing multiple files at the same time. What happens is that when a useStatement is found, a RuleBasedParserThread is created. This thread then parses that file in parallel. Ordering is preserved by having the result of the parse being put within the useStatement. So, in effect, a useStatement is the root to a file's tokens.
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Thread

    java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
  • Field Summary

    Fields inherited from class java.lang.Thread

    MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
  • Constructor Summary

    Constructors 
    Constructor Description
    RuleBasedParserThread​(ChoiceRule aRoot, Token aToken, java.lang.String aFilename, ParserDataPackage aData)  
  • Method Summary

    Modifier and Type Method Description
    void delete()  
    ParserDataPackage getData()
    The data package of the previous parse, so that things like keys and the filenames already parsed can be passed along
    java.lang.String getFilename()
    The filename of the file that this Thread will parse
    ChoiceRule getRoot()
    The root of the rule graph that will be used for parsing
    Token getToken()
    The root token which will be added to, after the parsing is complete
    void run()
    Each Thread will parse a separate file.
    boolean setData​(ParserDataPackage aData)  
    boolean setFilename​(java.lang.String aFilename)  
    boolean setRoot​(ChoiceRule aRoot)  
    boolean setToken​(Token aToken)  
    java.lang.String toString()  

    Methods inherited from class java.lang.Thread

    activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, yield

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

  • Method Details

    • setRoot

      public boolean setRoot​(ChoiceRule aRoot)
    • setToken

      public boolean setToken​(Token aToken)
    • setFilename

      public boolean setFilename​(java.lang.String aFilename)
    • setData

      public boolean setData​(ParserDataPackage aData)
    • getRoot

      public ChoiceRule getRoot()
      The root of the rule graph that will be used for parsing
    • getToken

      public Token getToken()
      The root token which will be added to, after the parsing is complete
    • getFilename

      public java.lang.String getFilename()
      The filename of the file that this Thread will parse
    • getData

      public ParserDataPackage getData()
      The data package of the previous parse, so that things like keys and the filenames already parsed can be passed along
    • delete

      public void delete()
    • run

      public void run()
      Each Thread will parse a separate file. When parsing is complete it will fill the useStatement token with the tokens computed from the file which was parsed. This run method performs this function as well as initializes the data package which will be used during the parsing
      Specified by:
      run in interface java.lang.Runnable
      Overrides:
      run in class java.lang.Thread
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Thread