hudson.scheduler
Class CrontabParser

java.lang.Object
  extended by antlr.Parser
      extended by antlr.LLkParser
          extended by hudson.scheduler.CrontabParser
All Implemented Interfaces:
CrontabParserTokenTypes

public class CrontabParser
extends antlr.LLkParser
implements CrontabParserTokenTypes


Field Summary
static String[] _tokenNames
           
protected  Hash hash
          Used to pick a value from within the range
static boolean HASH_TOKENS
          This property hashes tokens in the cron tab tokens like @daily so that they spread evenly.
static int NO_STEP
          Constant that indicates no step value.
 
Fields inherited from class antlr.Parser
astFactory, inputState, returnAST, tokenNames, tokenTypeToASTClassMap, traceDepth
 
Fields inherited from interface hudson.scheduler.CrontabParserTokenTypes
ANNUALLY, AT, DAILY, DIV, EOF, H, HOURLY, LITERAL_annually, LITERAL_daily, LITERAL_H, LITERAL_hourly, LITERAL_midnight, LITERAL_monthly, LITERAL_weekly, LITERAL_yearly, LPAREN, MIDNIGHT, MINUS, MONTHLY, NULL_TREE_LOOKAHEAD, OR, RPAREN, STAR, TOKEN, WEEKLY, WS, YEARLY
 
Constructor Summary
  CrontabParser(antlr.ParserSharedInputState state)
           
  CrontabParser(antlr.TokenBuffer tokenBuf)
           
protected CrontabParser(antlr.TokenBuffer tokenBuf, int k)
           
  CrontabParser(antlr.TokenStream lexer)
           
protected CrontabParser(antlr.TokenStream lexer, int k)
           
 
Method Summary
protected  long doHash(int step, int field)
          Uses Hash to choose a random (but stable) value from within this field.
protected  long doHash(int s, int e, int step)
           
protected  long doRange(int step, int field)
           
protected  long doRange(int start, int end, int step, int field)
           
 long expr(int field)
           
protected  Hash getHashForTokens()
           
protected  void rangeCheck(int value, int field)
           
 void setHash(Hash hash)
           
 void startRule(CronTab table)
           
 long term(int field)
           
 int token()
           
 
Methods inherited from class antlr.LLkParser
consume, LA, LT, traceIn, traceOut
 
Methods inherited from class antlr.Parser
addMessageListener, addParserListener, addParserMatchListener, addParserTokenListener, addSemanticPredicateListener, addSyntacticPredicateListener, addTraceListener, consumeUntil, consumeUntil, defaultDebuggingSetup, getAST, getASTFactory, getFilename, getInputState, getTokenName, getTokenNames, getTokenTypeToASTClassMap, isDebugMode, mark, match, match, matchNot, panic, recover, removeMessageListener, removeParserListener, removeParserMatchListener, removeParserTokenListener, removeSemanticPredicateListener, removeSyntacticPredicateListener, removeTraceListener, reportError, reportError, reportWarning, rewind, setASTFactory, setASTNodeClass, setASTNodeType, setDebugMode, setFilename, setIgnoreInvalidDebugCalls, setInputState, setTokenBuffer, traceIndent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_tokenNames

public static final String[] _tokenNames

hash

protected Hash hash
Used to pick a value from within the range


HASH_TOKENS

public static boolean HASH_TOKENS
This property hashes tokens in the cron tab tokens like @daily so that they spread evenly.


NO_STEP

public static final int NO_STEP
Constant that indicates no step value.

See Also:
Constant Field Values
Constructor Detail

CrontabParser

protected CrontabParser(antlr.TokenBuffer tokenBuf,
                        int k)

CrontabParser

public CrontabParser(antlr.TokenBuffer tokenBuf)

CrontabParser

protected CrontabParser(antlr.TokenStream lexer,
                        int k)

CrontabParser

public CrontabParser(antlr.TokenStream lexer)

CrontabParser

public CrontabParser(antlr.ParserSharedInputState state)
Method Detail

startRule

public final void startRule(CronTab table)
                     throws antlr.RecognitionException,
                            antlr.TokenStreamException,
                            antlr.ANTLRException
Throws:
antlr.RecognitionException
antlr.TokenStreamException
antlr.ANTLRException

expr

public final long expr(int field)
                throws antlr.RecognitionException,
                       antlr.TokenStreamException,
                       antlr.ANTLRException
Throws:
antlr.RecognitionException
antlr.TokenStreamException
antlr.ANTLRException

term

public final long term(int field)
                throws antlr.RecognitionException,
                       antlr.TokenStreamException,
                       antlr.ANTLRException
Throws:
antlr.RecognitionException
antlr.TokenStreamException
antlr.ANTLRException

token

public final int token()
                throws antlr.RecognitionException,
                       antlr.TokenStreamException
Throws:
antlr.RecognitionException
antlr.TokenStreamException

setHash

public void setHash(Hash hash)

doRange

protected long doRange(int start,
                       int end,
                       int step,
                       int field)
                throws antlr.ANTLRException
Throws:
antlr.ANTLRException

doRange

protected long doRange(int step,
                       int field)
                throws antlr.ANTLRException
Throws:
antlr.ANTLRException

doHash

protected long doHash(int step,
                      int field)
               throws antlr.ANTLRException
Uses Hash to choose a random (but stable) value from within this field.

Parameters:
step - Increments. For example, 15 if "H/15". Or NO_STEP to indicate the special constant for "H" without the step value.
Throws:
antlr.ANTLRException

doHash

protected long doHash(int s,
                      int e,
                      int step)
               throws antlr.ANTLRException
Throws:
antlr.ANTLRException

rangeCheck

protected void rangeCheck(int value,
                          int field)
                   throws antlr.ANTLRException
Throws:
antlr.ANTLRException

getHashForTokens

protected Hash getHashForTokens()


Copyright © 2004-2013. All Rights Reserved.