sleep.parser
Class Parser

java.lang.Object
  extended bysleep.parser.Parser

public class Parser
extends Object


Field Summary
protected  HashMap classes
           
protected  String code
           
protected  LinkedList comments
          the actual "code" 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  LinkedList imports
           
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
 
Method Summary
 void addComment(String text)
           
 void addStatement(Statement state)
           
 Class findImportedClass(String name)
           
 Block getRunnableBlock()
           
 LinkedList getStatements()
           
 boolean hasErrors()
           
 boolean hasWarnings()
           
 void importPackage(String packagez)
          Used by hoes to import package names...
static void main(String[] args)
           
 void parse()
           
 void parse(StringIterator siter)
           
 void reportError(String description, Token responsible)
           
 void reportError(SyntaxError error)
           
 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

code

protected String code

comments

protected LinkedList comments
the actual "code" for the script file.


errors

protected LinkedList errors
a list of all of the comments from the script file


warnings

protected LinkedList warnings
a list of all of the parser errors


tokens

protected TokenList tokens
a list of all of the parser warnings


statements

protected LinkedList statements

executeMe

protected Block executeMe
a list of all of the statements


EndOfTerm

public char EndOfTerm

imports

protected LinkedList imports

classes

protected HashMap classes
Constructor Detail

Parser

public Parser(String _code)
initialize the parser with the code you want me to work with

Method Detail

importPackage

public void importPackage(String packagez)
Used by hoes to import package names...


findImportedClass

public Class findImportedClass(String name)

setEndOfTerm

public void setEndOfTerm(char c)

addStatement

public void addStatement(Statement state)

getStatements

public LinkedList getStatements()

parse

public void parse()
           throws YourCodeSucksException
Throws:
YourCodeSucksException

parse

public void parse(StringIterator siter)
           throws YourCodeSucksException
Throws:
YourCodeSucksException

reportError

public void reportError(String description,
                        Token responsible)

reportError

public void reportError(SyntaxError error)

getRunnableBlock

public Block getRunnableBlock()

reportWarning

public void reportWarning(String description,
                          Token responsible)

hasErrors

public boolean hasErrors()

hasWarnings

public boolean hasWarnings()

addComment

public void addComment(String text)

main

public static void main(String[] args)