sleep.parser
Class ParserConfig

java.lang.Object
  extended bysleep.parser.ParserConfig

public class ParserConfig
extends Object

This class offers access to modify some settings within the sleep parser.

Install an Escape Constant

In sleep a character prefixed by a \ backslash within a "double quoted" string is said to be escaped. Typically an escaped character is just skipped over during processing. It is possible in sleep to add meaning to different characters by installing an escape. For example to add the escape \r to mean the new line character one would do the following:

ParserConfig.installEscapeConstant('m', "MONKEY");

Once the above code is executed the value "blah\m" inside of sleep would be equivalent in java to "blahMONKEY".

Register a Keyword

The sleep parser requires that all environment "keywords" be registered before any scripts are parsed. Bridges that should register their keywords are Environment, PredicateEnvironment, FilterEnvironment, Operator, and Predicate.

See Also:
Environment, PredicateEnvironment

Constructor Summary
ParserConfig()
           
 
Method Summary
static void addKeyword(String keyword)
          registers "keyword" as a keyword with the parser.
static void installEscapeConstant(char escape, String value)
          Installs an escape constant into the sleep parser.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParserConfig

public ParserConfig()
Method Detail

installEscapeConstant

public static void installEscapeConstant(char escape,
                                         String value)
Installs an escape constant into the sleep parser. Any time the escape constant escape is encountered inside of a parsed literal with a \ backslash before it, sleep will substitute that string with the value specified here.


addKeyword

public static void addKeyword(String keyword)
registers "keyword" as a keyword with the parser. This is a necessity if you have environment bridges in sleep