sleep.parser
public class Parser extends Object
| Field Summary | |
|---|---|
| protected String | code |
| protected LinkedList | comments an identifier for the script file. |
| protected LinkedList | errors a list of all of the comments from the script file |
| protected Block | executeMe a list of all of the statements |
| char | EndOfTerm |
| protected ImportManager | imports |
| protected String | name the actual "code" for the script file. |
| protected LinkedList | statements |
| protected TokenList | tokens a list of all of the parser warnings |
| protected LinkedList | warnings a list of all of the parser errors |
| Constructor Summary | |
|---|---|
| Parser(String _code) initialize the parser with the code you want me to work with | |
| Parser(String _name, String _code) initialize the parser with the code you want me to work with | |
| Parser(String _name, String _code, ImportManager imps) initialize the parser with the code you want me to work with plus a shared import manager | |
| Method Summary | |
|---|---|
| void | addComment(String text) |
| void | addStatement(Statement state) |
| Class | findImportedClass(String name) Attempts to find a class, starts out with the passed in string itself, if that doesn't resolve then the string is
appended to each imported package to see where the class might exist |
| ImportManager | getImportManager() obtain the import manager, used for managing imported packages. |
| String | getName() returns the identifier representing the source of the script we're parsing |
| Block | getRunnableBlock() |
| LinkedList | getStatements() |
| boolean | hasErrors() |
| boolean | hasWarnings() |
| void | importPackage(String packagez, String from) Used by Sleep to import statement to save an imported package name. |
| static void | main(String[] args) |
| void | parse() |
| void | parse(StringIterator siter) |
| void | reportError(String description, Token responsible) debug the tokenizer |
| void | reportError(SyntaxError error) |
| void | reportErrorWithMarker(String description, Token responsible) |
| void | reportWarning(String description, Token responsible) |
| void | setEndOfTerm(char c) |