sleep.parser

Class CodeGenerator

public class CodeGenerator extends Object implements ParserConstants

Generates code for the parser. The main thing here developers might concern themselves with is the installEscapeConstant function
Field Summary
protected StackBACKUP_BLOCKS
protected BlockCURRENT_BLOCK
protected static HashMapescape_constants
protected Parserparser
Constructor Summary
CodeGenerator(Parser _parser)
Method Summary
voidadd(Step n, Token token)
voidbackup()
BlockgetRunnableBlock()
static voidinstallEscapeConstant(char c, String value)
install a constant for escapes within strings i.e.
voidparse(Statement datum)
voidparseBlock(Token data)
voidparseBlock(LinkedList data)
send the data string through the parser pipeline - errors earlier in the pipeline are assumed to not exist as they would have been found the first time we processed it as a block
voidparseIdea(Token data)
voidparseObject(Token data)
voidparseObject(Statement datum)
voidparseParameters(Token token)
purposeful fall thru...
CheckparsePredicate(Token data)
CheckparsePredicate(Statement parsePred)
send the data string through the parser pipeline - errors earlier in the pipeline are assumed to not exist as they would have been found the first time we processed it as a block
Blockrestore()

Field Detail

BACKUP_BLOCKS

protected Stack BACKUP_BLOCKS

CURRENT_BLOCK

protected Block CURRENT_BLOCK

escape_constants

protected static HashMap escape_constants

parser

protected Parser parser

Constructor Detail

CodeGenerator

public CodeGenerator(Parser _parser)

Method Detail

add

public void add(Step n, Token token)

backup

public void backup()

getRunnableBlock

public Block getRunnableBlock()

installEscapeConstant

public static void installEscapeConstant(char c, String value)
install a constant for escapes within strings i.e. \n could be "\n"

parse

public void parse(Statement datum)

parseBlock

public void parseBlock(Token data)

parseBlock

public void parseBlock(LinkedList data)
send the data string through the parser pipeline - errors earlier in the pipeline are assumed to not exist as they would have been found the first time we processed it as a block

parseIdea

public void parseIdea(Token data)

parseObject

public void parseObject(Token data)

parseObject

public void parseObject(Statement datum)

parseParameters

public void parseParameters(Token token)
purposeful fall thru... ***

parsePredicate

public Check parsePredicate(Token data)

parsePredicate

public Check parsePredicate(Statement parsePred)
send the data string through the parser pipeline - errors earlier in the pipeline are assumed to not exist as they would have been found the first time we processed it as a block

restore

public Block restore()