sleep.parser

Class Parser


public class Parser
extends Object

Field Summary

char
EndOfTerm
protected HashMap
classes
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
protected Map
imports
protected HashMap
jars
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

Method Summary

void
addComment(String text)
void
addStatement(Statement state)
Class
findImportedClass(String name)
String
getName()
returns the identifier representing the source of the script we're parsing
Block
getRunnableBlock()
LinkedList
getStatements()
boolean
hasErrors()
boolean
hasWarnings()
File
importPackage(String packagez, String from)
Used by hoes to import package names...
static void
main(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)

Field Details

EndOfTerm

public char EndOfTerm

classes

protected HashMap classes

code

protected String code

comments

protected LinkedList comments
an identifier for the script file.

errors

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

executeMe

protected Block executeMe
a list of all of the statements

imports

protected Map imports

jars

protected HashMap jars

name

protected String name
the actual "code" for the script file.

statements

protected LinkedList statements

tokens

protected TokenList tokens
a list of all of the parser warnings

warnings

protected LinkedList warnings
a list of all of the parser errors

Constructor Details

Parser

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

Parser

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

Method Details

addComment

public void addComment(String text)

addStatement

public void addStatement(Statement state)

findImportedClass

public Class findImportedClass(String name)

getName

public String getName()
returns the identifier representing the source of the script we're parsing

getRunnableBlock

public Block getRunnableBlock()

getStatements

public LinkedList getStatements()

hasErrors

public boolean hasErrors()

hasWarnings

public boolean hasWarnings()

importPackage

public File importPackage(String packagez,
                          String from)
Used by hoes to import package names...

main

public static void main(args[] )

parse

public void parse()
            throws YourCodeSucksException

parse

public void parse(StringIterator siter)
            throws YourCodeSucksException

reportError

public void reportError(String description,
                        Token responsible)

reportError

public void reportError(SyntaxError error)

reportErrorWithMarker

public void reportErrorWithMarker(String description,
                                  Token responsible)

reportWarning

public void reportWarning(String description,
                          Token responsible)

setEndOfTerm

public void setEndOfTerm(char c)