Package cruise.umple.parser.analysis
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
-
Field Summary
-
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 alongjava.lang.String
getFilename()
The filename of the file that this Thread will parseChoiceRule
getRoot()
The root of the rule graph that will be used for parsingToken
getToken()
The root token which will be added to, after the parsing is completevoid
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
-
Constructor Details
-
RuleBasedParserThread
public RuleBasedParserThread(ChoiceRule aRoot, Token aToken, java.lang.String aFilename, ParserDataPackage aData)
-
-
Method Details
-
setRoot
-
setToken
-
setFilename
public boolean setFilename(java.lang.String aFilename) -
setData
-
getRoot
The root of the rule graph that will be used for parsing -
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
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 interfacejava.lang.Runnable
- Overrides:
run
in classjava.lang.Thread
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Thread
-