|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsleep.parser.Parser
public class Parser
Field Summary | |
---|---|
protected String |
code
|
protected LinkedList |
comments
an identifier for the script file. |
char |
EndOfTerm
|
protected LinkedList |
errors
a list of all of the comments from the script file |
protected Block |
executeMe
a list of all of the statements |
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)
|
void |
reportError(SyntaxError error)
|
void |
reportErrorWithMarker(String description,
Token responsible)
|
void |
reportWarning(String description,
Token responsible)
|
void |
setEndOfTerm(char c)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected String code
protected String name
protected LinkedList comments
protected LinkedList errors
protected LinkedList warnings
protected TokenList tokens
protected LinkedList statements
protected Block executeMe
public char EndOfTerm
protected ImportManager imports
Constructor Detail |
---|
public Parser(String _code)
public Parser(String _name, String _code)
public Parser(String _name, String _code, ImportManager imps)
Method Detail |
---|
public ImportManager getImportManager()
public void importPackage(String packagez, String from)
public Class findImportedClass(String name)
public void setEndOfTerm(char c)
public void addStatement(Statement state)
public LinkedList getStatements()
public String getName()
public void parse() throws YourCodeSucksException
YourCodeSucksException
public void parse(StringIterator siter) throws YourCodeSucksException
YourCodeSucksException
public void reportError(String description, Token responsible)
public void reportErrorWithMarker(String description, Token responsible)
public void reportError(SyntaxError error)
public Block getRunnableBlock()
public void reportWarning(String description, Token responsible)
public boolean hasErrors()
public boolean hasWarnings()
public void addComment(String text)
public static void main(String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |