cron in google app engine have human readable syntax for cron job scheduling.
https://developers.google.com/appengine/docs/python/config/cron#The_Schedule_Format
How do I implement similar functionality in my application, where use enter schedule in human readable format and program parse and store the actual value ?
edit: I think they are using antlr3 library, But I could not able to figure out how they are using it.
Ok, in this instance there are two spots you need to look into.
First antlr is what gives you your parser to parse the english/human readable formats into your program as a stream of tokens. From this string you will then determine the meaning such as:
which would turn into a stream of tokens such as:
From here you will then determine the meaning of the sentence using some kind of state machine that could be written (simplified form) as:
Something like that would suffice to parse the string into your required values.
The second part would be to connect this into
cron
itself or write your own scheduler within your program itself which I think is more along the lines of your use case.Antlr Python: http://www.antlr.org/wiki/display/ANTLR3/Python+runtime