"use strict";
// -*- mode: js; indent-tabs-mode: nil; js-basic-offset: 4 -*-
//
// This file is part of Genie
//
// Copyright 2019-2020 The Board of Trustees of the Leland Stanford Junior University
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Author: Giovanni Campagna <gcampagn@cs.stanford.edu>
Object.defineProperty(exports, "__esModule", { value: true });
const thingtalk_1 = require("thingtalk");
async function default_1($runtime, $ttUtils, $options, $locale, $grammar, $loader) {
    const TIMER_SCHEMA = new thingtalk_1.Ast.FunctionDef(null, 'stream', null, // class
    'timer', [], // extends
    {
        is_list: false,
        is_monitorable: true
    }, [], // args,
    {
        nl: {
            canonical: 'every fixed interval',
            confirmation: 'every ${interval}',
        },
        impl: {}
    });
    const AT_TIMER_SCHEMA = new thingtalk_1.Ast.FunctionDef(null, 'stream', null, // class
    'attimer', [], // extends
    {
        is_list: false,
        is_monitorable: true
    }, [], // args,
    {
        nl: {
            canonical: 'every day',
            confirmation: 'every day at ${interval}',
        },
        impl: {}
    });
    const TIME_MORNING = new thingtalk_1.Ast.Value.Time(new thingtalk_1.Ast.Time.Relative("morning"));
    const TIME_NOON = new thingtalk_1.Ast.Value.Time(new thingtalk_1.Ast.Time.Absolute(12, 0, 0));
    const TIME_EVENING = new thingtalk_1.Ast.Value.Time(new thingtalk_1.Ast.Time.Relative("evening"));
    $grammar.declareSymbol("optional_comma");
    $grammar.addRule("optional_comma", [","], (($0) => ','), undefined, {});
    $grammar.addRule("optional_comma", [""], (($0) => ''), undefined, {});
    $grammar.declareSymbol("per_day");
    $grammar.addRule("per_day", ["each day"], (($0) => 'each day'), undefined, {});
    $grammar.addRule("per_day", ["every day"], (($0) => 'every day'), undefined, {});
    $grammar.addRule("per_day", ["daily"], (($0) => 'daily'), undefined, {});
    $grammar.addRule("per_day", ["a day"], (($0) => 'a day'), undefined, {});
    $grammar.addRule("per_day", ["per day"], (($0) => 'per day'), undefined, {});
    $grammar.declareSymbol("optional_per_day");
    $grammar.addRule("optional_per_day", ["each day"], (($0) => 'each day'), undefined, {});
    $grammar.addRule("optional_per_day", ["every day"], (($0) => 'every day'), undefined, {});
    $grammar.addRule("optional_per_day", ["daily"], (($0) => 'daily'), undefined, {});
    $grammar.addRule("optional_per_day", ["a day"], (($0) => 'a day'), undefined, {});
    $grammar.addRule("optional_per_day", ["per day"], (($0) => 'per day'), undefined, {});
    $grammar.addRule("optional_per_day", [""], (($0) => ''), undefined, {});
    $grammar.declareSymbol("once_per_day");
    $grammar.addRule("once_per_day", ["each day"], (($0) => 'each day'), undefined, {});
    $grammar.addRule("once_per_day", ["every day"], (($0) => 'every day'), undefined, {});
    $grammar.addRule("once_per_day", ["daily"], (($0) => 'daily'), undefined, {});
    $grammar.addRule("once_per_day", ["a day"], (($0) => 'a day'), undefined, {});
    $grammar.addRule("once_per_day", ["per day"], (($0) => 'per day'), undefined, {});
    $grammar.addRule("once_per_day", ["once a day"], (($0) => 'once a day'), undefined, {});
    $grammar.addRule("once_per_day", ["once per day"], (($0) => 'once per day'), undefined, {});
    $grammar.addRule("once_per_day", ["once daily"], (($0) => 'once daily'), undefined, {});
    $grammar.addRule("once_per_day", ["one time a day"], (($0) => 'one time a day'), undefined, {});
    $grammar.addRule("once_per_day", ["one time per day"], (($0) => 'one time per day'), undefined, {});
    $grammar.addRule("once_per_day", ["one time daily"], (($0) => 'one time daily'), undefined, {});
    $grammar.declareSymbol("twice_per_day");
    $grammar.addRule("twice_per_day", ["twice a day"], (($0) => 'twice a day'), undefined, {});
    $grammar.addRule("twice_per_day", ["twice per day"], (($0) => 'twice per day'), undefined, {});
    $grammar.addRule("twice_per_day", ["twice daily"], (($0) => 'twice daily'), undefined, {});
    $grammar.addRule("twice_per_day", ["two times a day"], (($0) => 'two times a day'), undefined, {});
    $grammar.addRule("twice_per_day", ["two times per day"], (($0) => 'two times per day'), undefined, {});
    $grammar.addRule("twice_per_day", ["two times daily"], (($0) => 'two times daily'), undefined, {});
    $grammar.declareSymbol("thrice_per_day");
    $grammar.addRule("thrice_per_day", ["thrice a day"], (($0) => 'thrice a day'), undefined, {});
    $grammar.addRule("thrice_per_day", ["thrice per day"], (($0) => 'thrice per day'), undefined, {});
    $grammar.addRule("thrice_per_day", ["thrice daily"], (($0) => 'thrice daily'), undefined, {});
    $grammar.addRule("thrice_per_day", ["three times a day"], (($0) => 'three times a day'), undefined, {});
    $grammar.addRule("thrice_per_day", ["three times per day"], (($0) => 'three times per day'), undefined, {});
    $grammar.addRule("thrice_per_day", ["three times daily"], (($0) => 'three times daily'), undefined, {});
    $grammar.declareSymbol("optional_once");
    $grammar.addRule("optional_once", ["once"], (($0) => 'once'), undefined, {});
    $grammar.addRule("optional_once", ["one time"], (($0) => 'one time'), undefined, {});
    $grammar.addRule("optional_once", [""], (($0) => ''), undefined, {});
    $grammar.declareSymbol("optional_twice");
    $grammar.addRule("optional_twice", ["twice"], (($0) => 'twice'), undefined, {});
    $grammar.addRule("optional_twice", ["two times"], (($0) => 'two times'), undefined, {});
    $grammar.addRule("optional_twice", [""], (($0) => ''), undefined, {});
    $grammar.declareSymbol("each");
    $grammar.addRule("each", ["each"], (($0) => 'each'), undefined, {});
    $grammar.addRule("each", ["every"], (($0) => 'every'), undefined, {});
    $grammar.addRule("each", ["per"], (($0) => 'per'), undefined, {});
    $grammar.addRule("each", ["a"], (($0) => 'a'), undefined, {});
    $grammar.declareSymbol("and");
    $grammar.addRule("and", ["and"], (($0) => 'and'), undefined, {});
    $grammar.addRule("and", ["and also"], (($0) => 'and also'), undefined, {});
    $grammar.addRule("and", ["plus"], (($0) => 'plus'), undefined, {});
    $grammar.addRule("and", ["in addition to"], (($0) => 'in addition to'), undefined, {});
    $grammar.addRule("and", [","], (($0) => ','), undefined, {});
    $grammar.declareSymbol("optional_first");
    $grammar.addRule("optional_first", ["one"], (($0) => 'one'), undefined, {});
    $grammar.addRule("optional_first", ["once"], (($0) => 'once'), undefined, {});
    $grammar.addRule("optional_first", ["one time"], (($0) => 'one time'), undefined, {});
    $grammar.addRule("optional_first", ["first"], (($0) => 'first'), undefined, {});
    $grammar.addRule("optional_first", ["the first"], (($0) => 'the first'), undefined, {});
    $grammar.addRule("optional_first", ["the first one"], (($0) => 'the first one'), undefined, {});
    $grammar.addRule("optional_first", [""], (($0) => ''), undefined, {});
    $grammar.declareSymbol("optional_second");
    $grammar.addRule("optional_second", ["one"], (($0) => 'one'), undefined, {});
    $grammar.addRule("optional_second", ["once"], (($0) => 'once'), undefined, {});
    $grammar.addRule("optional_second", ["one time"], (($0) => 'one time'), undefined, {});
    $grammar.addRule("optional_second", ["one more"], (($0) => 'one more'), undefined, {});
    $grammar.addRule("optional_second", ["once more"], (($0) => 'once more'), undefined, {});
    $grammar.addRule("optional_second", ["one more time"], (($0) => 'one more time'), undefined, {});
    $grammar.addRule("optional_second", ["again"], (($0) => 'again'), undefined, {});
    $grammar.addRule("optional_second", ["once again"], (($0) => 'once again'), undefined, {});
    $grammar.addRule("optional_second", ["another"], (($0) => 'another'), undefined, {});
    $grammar.addRule("optional_second", ["another time"], (($0) => 'another time'), undefined, {});
    $grammar.addRule("optional_second", ["another one"], (($0) => 'another one'), undefined, {});
    $grammar.addRule("optional_second", ["second"], (($0) => 'second'), undefined, {});
    $grammar.addRule("optional_second", ["a second"], (($0) => 'a second'), undefined, {});
    $grammar.addRule("optional_second", ["a second one"], (($0) => 'a second one'), undefined, {});
    $grammar.addRule("optional_second", ["the second"], (($0) => 'the second'), undefined, {});
    $grammar.addRule("optional_second", ["the second one"], (($0) => 'the second one'), undefined, {});
    $grammar.addRule("optional_second", [""], (($0) => ''), undefined, {});
    $grammar.declareSymbol("optional_emphasis");
    $grammar.addRule("optional_emphasis", ["just"], (($0) => 'just'), undefined, {});
    $grammar.addRule("optional_emphasis", ["right"], (($0) => 'right'), undefined, {});
    $grammar.addRule("optional_emphasis", [""], (($0) => ''), undefined, {});
    $grammar.declareSymbol("at_noon");
    $grammar.addRule("at_noon", ["at noon"], (($0) => 'at noon'), undefined, {});
    $grammar.addRule("at_noon", ["in the middle of the day"], (($0) => 'in the middle of the day'), undefined, {});
    $grammar.addRule("at_noon", ["at lunch"], (($0) => 'at lunch'), undefined, {});
    $grammar.declareSymbol("at_morning");
    $grammar.addRule("at_morning", ["when i get up"], (($0) => 'when i get up'), undefined, {});
    $grammar.addRule("at_morning", ["when i wake up"], (($0) => 'when i wake up'), undefined, {});
    $grammar.addRule("at_morning", ["after getting up"], (($0) => 'after getting up'), undefined, {});
    $grammar.addRule("at_morning", ["after i get up"], (($0) => 'after i get up'), undefined, {});
    $grammar.addRule("at_morning", ["after waking up"], (($0) => 'after waking up'), undefined, {});
    $grammar.addRule("at_morning", ["after i wake up"], (($0) => 'after i wake up'), undefined, {});
    $grammar.addRule("at_morning", ["during the morning"], (($0) => 'during the morning'), undefined, {});
    $grammar.addRule("at_morning", ["each morning"], (($0) => 'each morning'), undefined, {});
    $grammar.addRule("at_morning", ["every morning"], (($0) => 'every morning'), undefined, {});
    $grammar.addRule("at_morning", ["in the morning"], (($0) => 'in the morning'), undefined, {});
    $grammar.addRule("at_morning", ["at breakfast"], (($0) => 'at breakfast'), undefined, {});
    $grammar.addRule("at_morning", ["with breakfast"], (($0) => 'with breakfast'), undefined, {});
    $grammar.addRule("at_morning", ["during breakfast"], (($0) => 'during breakfast'), undefined, {});
    $grammar.addRule("at_morning", ["before breakfast"], (($0) => 'before breakfast'), undefined, {});
    $grammar.addRule("at_morning", ["before eating breakfast"], (($0) => 'before eating breakfast'), undefined, {});
    $grammar.addRule("at_morning", ["before i eat breakfast"], (($0) => 'before i eat breakfast'), undefined, {});
    $grammar.addRule("at_morning", ["after breakfast"], (($0) => 'after breakfast'), undefined, {});
    $grammar.addRule("at_morning", ["after eating breakfast"], (($0) => 'after eating breakfast'), undefined, {});
    $grammar.addRule("at_morning", ["after i eat breakfast"], (($0) => 'after i eat breakfast'), undefined, {});
    $grammar.addRule("at_morning", ["when i eat breakfast"], (($0) => 'when i eat breakfast'), undefined, {});
    $grammar.addRule("at_morning", ["while i eat breakfast"], (($0) => 'while i eat breakfast'), undefined, {});
    $grammar.addRule("at_morning", ["before school"], (($0) => 'before school'), undefined, {});
    $grammar.addRule("at_morning", ["before going to school"], (($0) => 'before going to school'), undefined, {});
    $grammar.addRule("at_morning", ["before i go to school"], (($0) => 'before i go to school'), undefined, {});
    $grammar.addRule("at_morning", ["before leaving for school"], (($0) => 'before leaving for school'), undefined, {});
    $grammar.addRule("at_morning", ["before i leave for school"], (($0) => 'before i leave for school'), undefined, {});
    $grammar.addRule("at_morning", ["before heading to school"], (($0) => 'before heading to school'), undefined, {});
    $grammar.addRule("at_morning", ["before i head to school"], (($0) => 'before i head to school'), undefined, {});
    $grammar.addRule("at_morning", ["when i go to school"], (($0) => 'when i go to school'), undefined, {});
    $grammar.addRule("at_morning", ["when i leave for school"], (($0) => 'when i leave for school'), undefined, {});
    $grammar.addRule("at_morning", ["when i head to school"], (($0) => 'when i head to school'), undefined, {});
    $grammar.addRule("at_morning", ["before work"], (($0) => 'before work'), undefined, {});
    $grammar.addRule("at_morning", ["before going to work"], (($0) => 'before going to work'), undefined, {});
    $grammar.addRule("at_morning", ["before i go to work"], (($0) => 'before i go to work'), undefined, {});
    $grammar.addRule("at_morning", ["before leaving for work"], (($0) => 'before leaving for work'), undefined, {});
    $grammar.addRule("at_morning", ["before i leave for work"], (($0) => 'before i leave for work'), undefined, {});
    $grammar.addRule("at_morning", ["before heading to work"], (($0) => 'before heading to work'), undefined, {});
    $grammar.addRule("at_morning", ["before i head to work"], (($0) => 'before i head to work'), undefined, {});
    $grammar.addRule("at_morning", ["when i go to work"], (($0) => 'when i go to work'), undefined, {});
    $grammar.addRule("at_morning", ["when i leave for work"], (($0) => 'when i leave for work'), undefined, {});
    $grammar.addRule("at_morning", ["when i head to work"], (($0) => 'when i head to work'), undefined, {});
    $grammar.declareSymbol("at_evening");
    $grammar.addRule("at_evening", ["during the evening"], (($0) => 'during the evening'), undefined, {});
    $grammar.addRule("at_evening", ["each evening"], (($0) => 'each evening'), undefined, {});
    $grammar.addRule("at_evening", ["every evening"], (($0) => 'every evening'), undefined, {});
    $grammar.addRule("at_evening", ["in the evening"], (($0) => 'in the evening'), undefined, {});
    $grammar.addRule("at_evening", ["during the night"], (($0) => 'during the night'), undefined, {});
    $grammar.addRule("at_evening", ["each night"], (($0) => 'each night'), undefined, {});
    $grammar.addRule("at_evening", ["every night"], (($0) => 'every night'), undefined, {});
    $grammar.addRule("at_evening", ["in the night"], (($0) => 'in the night'), undefined, {});
    $grammar.addRule("at_evening", ["at night"], (($0) => 'at night'), undefined, {});
    $grammar.addRule("at_evening", ["at dinner"], (($0) => 'at dinner'), undefined, {});
    $grammar.addRule("at_evening", ["with dinner"], (($0) => 'with dinner'), undefined, {});
    $grammar.addRule("at_evening", ["during dinner"], (($0) => 'during dinner'), undefined, {});
    $grammar.addRule("at_evening", ["before dinner"], (($0) => 'before dinner'), undefined, {});
    $grammar.addRule("at_evening", ["before eating dinner"], (($0) => 'before eating dinner'), undefined, {});
    $grammar.addRule("at_evening", ["before i eat dinner"], (($0) => 'before i eat dinner'), undefined, {});
    $grammar.addRule("at_evening", ["after dinner"], (($0) => 'after dinner'), undefined, {});
    $grammar.addRule("at_evening", ["after eating dinner"], (($0) => 'after eating dinner'), undefined, {});
    $grammar.addRule("at_evening", ["after i eat dinner"], (($0) => 'after i eat dinner'), undefined, {});
    $grammar.addRule("at_evening", ["when i eat dinner"], (($0) => 'when i eat dinner'), undefined, {});
    $grammar.addRule("at_evening", ["while i eat dinner"], (($0) => 'while i eat dinner'), undefined, {});
    $grammar.addRule("at_evening", ["after school"], (($0) => 'after school'), undefined, {});
    $grammar.addRule("at_evening", ["after getting back from school"], (($0) => 'after getting back from school'), undefined, {});
    $grammar.addRule("at_evening", ["after returning from school"], (($0) => 'after returning from school'), undefined, {});
    $grammar.addRule("at_evening", ["after coming home from school"], (($0) => 'after coming home from school'), undefined, {});
    $grammar.addRule("at_evening", ["after i get back from school"], (($0) => 'after i get back from school'), undefined, {});
    $grammar.addRule("at_evening", ["after i return from school"], (($0) => 'after i return from school'), undefined, {});
    $grammar.addRule("at_evening", ["after i come home from school"], (($0) => 'after i come home from school'), undefined, {});
    $grammar.addRule("at_evening", ["when i get back from school"], (($0) => 'when i get back from school'), undefined, {});
    $grammar.addRule("at_evening", ["when i return from school"], (($0) => 'when i return from school'), undefined, {});
    $grammar.addRule("at_evening", ["when i come home from school"], (($0) => 'when i come home from school'), undefined, {});
    $grammar.addRule("at_evening", ["after work"], (($0) => 'after work'), undefined, {});
    $grammar.addRule("at_evening", ["after getting back from work"], (($0) => 'after getting back from work'), undefined, {});
    $grammar.addRule("at_evening", ["after returning from work"], (($0) => 'after returning from work'), undefined, {});
    $grammar.addRule("at_evening", ["after coming home from work"], (($0) => 'after coming home from work'), undefined, {});
    $grammar.addRule("at_evening", ["after i get back from work"], (($0) => 'after i get back from work'), undefined, {});
    $grammar.addRule("at_evening", ["after i return from work"], (($0) => 'after i return from work'), undefined, {});
    $grammar.addRule("at_evening", ["after i come home from work"], (($0) => 'after i come home from work'), undefined, {});
    $grammar.addRule("at_evening", ["when i get back from work"], (($0) => 'when i get back from work'), undefined, {});
    $grammar.addRule("at_evening", ["when i return from work"], (($0) => 'when i return from work'), undefined, {});
    $grammar.addRule("at_evening", ["when i come home from work"], (($0) => 'when i come home from work'), undefined, {});
    $grammar.addRule("at_evening", ["before bed"], (($0) => 'before bed'), undefined, {});
    $grammar.addRule("at_evening", ["before going to bed"], (($0) => 'before going to bed'), undefined, {});
    $grammar.addRule("at_evening", ["before i go to bed"], (($0) => 'before i go to bed'), undefined, {});
    $grammar.addRule("at_evening", ["before leaving for bed"], (($0) => 'before leaving for bed'), undefined, {});
    $grammar.addRule("at_evening", ["before i leave for bed"], (($0) => 'before i leave for bed'), undefined, {});
    $grammar.addRule("at_evening", ["before heading to bed"], (($0) => 'before heading to bed'), undefined, {});
    $grammar.addRule("at_evening", ["before i head to bed"], (($0) => 'before i head to bed'), undefined, {});
    $grammar.addRule("at_evening", ["when i go to bed"], (($0) => 'when i go to bed'), undefined, {});
    $grammar.addRule("at_evening", ["when i leave for bed"], (($0) => 'when i leave for bed'), undefined, {});
    $grammar.addRule("at_evening", ["when i head to bed"], (($0) => 'when i head to bed'), undefined, {});
    $grammar.addRule("at_evening", ["at bedtime"], (($0) => 'at bedtime'), undefined, {});
    $grammar.addRule("at_evening", ["before bedtime"], (($0) => 'before bedtime'), undefined, {});
    $grammar.addRule("at_evening", ["before i go to sleep"], (($0) => 'before i go to sleep'), undefined, {});
    $grammar.addRule("at_evening", ["before going to sleep"], (($0) => 'before going to sleep'), undefined, {});
    $grammar.addRule("at_evening", ["before sleeping"], (($0) => 'before sleeping'), undefined, {});
    $grammar.addRule("at_evening", ["before i sleep"], (($0) => 'before i sleep'), undefined, {});
    $grammar.addRule("at_evening", ["before i fall asleep"], (($0) => 'before i fall asleep'), undefined, {});
    $grammar.addRule("at_evening", ["before falling asleep"], (($0) => 'before falling asleep'), undefined, {});
    $grammar.declareSymbol("at_evening_second");
    $grammar.addRule("at_evening_second", ["evening"], (($0) => 'evening'), undefined, {});
    $grammar.addRule("at_evening_second", ["work"], (($0) => 'work'), undefined, {});
    $grammar.addRule("at_evening_second", ["school"], (($0) => 'school'), undefined, {});
    $grammar.addRule("at_evening_second", ["dinner"], (($0) => 'dinner'), undefined, {});
    $grammar.addRule("at_evening_second", ["night"], (($0) => 'night'), undefined, {});
    $grammar.addRule("at_evening_second", ["bed"], (($0) => 'bed'), undefined, {});
    $grammar.addRule("at_evening_second", ["during the evening"], (($0) => 'during the evening'), undefined, {});
    $grammar.addRule("at_evening_second", ["each evening"], (($0) => 'each evening'), undefined, {});
    $grammar.addRule("at_evening_second", ["every evening"], (($0) => 'every evening'), undefined, {});
    $grammar.addRule("at_evening_second", ["in the evening"], (($0) => 'in the evening'), undefined, {});
    $grammar.addRule("at_evening_second", ["during the night"], (($0) => 'during the night'), undefined, {});
    $grammar.addRule("at_evening_second", ["each night"], (($0) => 'each night'), undefined, {});
    $grammar.addRule("at_evening_second", ["every night"], (($0) => 'every night'), undefined, {});
    $grammar.addRule("at_evening_second", ["in the night"], (($0) => 'in the night'), undefined, {});
    $grammar.addRule("at_evening_second", ["at night"], (($0) => 'at night'), undefined, {});
    $grammar.addRule("at_evening_second", ["at dinner"], (($0) => 'at dinner'), undefined, {});
    $grammar.addRule("at_evening_second", ["with dinner"], (($0) => 'with dinner'), undefined, {});
    $grammar.addRule("at_evening_second", ["during dinner"], (($0) => 'during dinner'), undefined, {});
    $grammar.addRule("at_evening_second", ["before dinner"], (($0) => 'before dinner'), undefined, {});
    $grammar.addRule("at_evening_second", ["before eating dinner"], (($0) => 'before eating dinner'), undefined, {});
    $grammar.addRule("at_evening_second", ["before i eat dinner"], (($0) => 'before i eat dinner'), undefined, {});
    $grammar.addRule("at_evening_second", ["after dinner"], (($0) => 'after dinner'), undefined, {});
    $grammar.addRule("at_evening_second", ["after eating dinner"], (($0) => 'after eating dinner'), undefined, {});
    $grammar.addRule("at_evening_second", ["after i eat dinner"], (($0) => 'after i eat dinner'), undefined, {});
    $grammar.addRule("at_evening_second", ["when i eat dinner"], (($0) => 'when i eat dinner'), undefined, {});
    $grammar.addRule("at_evening_second", ["while i eat dinner"], (($0) => 'while i eat dinner'), undefined, {});
    $grammar.addRule("at_evening_second", ["after school"], (($0) => 'after school'), undefined, {});
    $grammar.addRule("at_evening_second", ["after getting back from school"], (($0) => 'after getting back from school'), undefined, {});
    $grammar.addRule("at_evening_second", ["after returning from school"], (($0) => 'after returning from school'), undefined, {});
    $grammar.addRule("at_evening_second", ["after coming home from school"], (($0) => 'after coming home from school'), undefined, {});
    $grammar.addRule("at_evening_second", ["after i get back from school"], (($0) => 'after i get back from school'), undefined, {});
    $grammar.addRule("at_evening_second", ["after i return from school"], (($0) => 'after i return from school'), undefined, {});
    $grammar.addRule("at_evening_second", ["after i come home from school"], (($0) => 'after i come home from school'), undefined, {});
    $grammar.addRule("at_evening_second", ["when i get back from school"], (($0) => 'when i get back from school'), undefined, {});
    $grammar.addRule("at_evening_second", ["when i return from school"], (($0) => 'when i return from school'), undefined, {});
    $grammar.addRule("at_evening_second", ["when i come home from school"], (($0) => 'when i come home from school'), undefined, {});
    $grammar.addRule("at_evening_second", ["after work"], (($0) => 'after work'), undefined, {});
    $grammar.addRule("at_evening_second", ["after getting back from work"], (($0) => 'after getting back from work'), undefined, {});
    $grammar.addRule("at_evening_second", ["after returning from work"], (($0) => 'after returning from work'), undefined, {});
    $grammar.addRule("at_evening_second", ["after coming home from work"], (($0) => 'after coming home from work'), undefined, {});
    $grammar.addRule("at_evening_second", ["after i get back from work"], (($0) => 'after i get back from work'), undefined, {});
    $grammar.addRule("at_evening_second", ["after i return from work"], (($0) => 'after i return from work'), undefined, {});
    $grammar.addRule("at_evening_second", ["after i come home from work"], (($0) => 'after i come home from work'), undefined, {});
    $grammar.addRule("at_evening_second", ["when i get back from work"], (($0) => 'when i get back from work'), undefined, {});
    $grammar.addRule("at_evening_second", ["when i return from work"], (($0) => 'when i return from work'), undefined, {});
    $grammar.addRule("at_evening_second", ["when i come home from work"], (($0) => 'when i come home from work'), undefined, {});
    $grammar.addRule("at_evening_second", ["before bed"], (($0) => 'before bed'), undefined, {});
    $grammar.addRule("at_evening_second", ["before going to bed"], (($0) => 'before going to bed'), undefined, {});
    $grammar.addRule("at_evening_second", ["before i go to bed"], (($0) => 'before i go to bed'), undefined, {});
    $grammar.addRule("at_evening_second", ["before leaving for bed"], (($0) => 'before leaving for bed'), undefined, {});
    $grammar.addRule("at_evening_second", ["before i leave for bed"], (($0) => 'before i leave for bed'), undefined, {});
    $grammar.addRule("at_evening_second", ["before heading to bed"], (($0) => 'before heading to bed'), undefined, {});
    $grammar.addRule("at_evening_second", ["before i head to bed"], (($0) => 'before i head to bed'), undefined, {});
    $grammar.addRule("at_evening_second", ["when i go to bed"], (($0) => 'when i go to bed'), undefined, {});
    $grammar.addRule("at_evening_second", ["when i leave for bed"], (($0) => 'when i leave for bed'), undefined, {});
    $grammar.addRule("at_evening_second", ["when i head to bed"], (($0) => 'when i head to bed'), undefined, {});
    $grammar.addRule("at_evening_second", ["at bedtime"], (($0) => 'at bedtime'), undefined, {});
    $grammar.addRule("at_evening_second", ["before bedtime"], (($0) => 'before bedtime'), undefined, {});
    $grammar.addRule("at_evening_second", ["before i go to sleep"], (($0) => 'before i go to sleep'), undefined, {});
    $grammar.addRule("at_evening_second", ["before going to sleep"], (($0) => 'before going to sleep'), undefined, {});
    $grammar.addRule("at_evening_second", ["before sleeping"], (($0) => 'before sleeping'), undefined, {});
    $grammar.addRule("at_evening_second", ["before i sleep"], (($0) => 'before i sleep'), undefined, {});
    $grammar.addRule("at_evening_second", ["before i fall asleep"], (($0) => 'before i fall asleep'), undefined, {});
    $grammar.addRule("at_evening_second", ["before falling asleep"], (($0) => 'before falling asleep'), undefined, {});
    $grammar.declareSymbol("when_brushing_teeth");
    $grammar.addRule("when_brushing_teeth", ["when i brush my teeth"], (($0) => 'when i brush my teeth'), undefined, {});
    $grammar.addRule("when_brushing_teeth", ["when brushing my teeth"], (($0) => 'when brushing my teeth'), undefined, {});
    $grammar.addRule("when_brushing_teeth", ["before brushing my teeth"], (($0) => 'before brushing my teeth'), undefined, {});
    $grammar.addRule("when_brushing_teeth", ["before i brush my teeth"], (($0) => 'before i brush my teeth'), undefined, {});
    $grammar.addRule("when_brushing_teeth", ["after brushing my teeth"], (($0) => 'after brushing my teeth'), undefined, {});
    $grammar.addRule("when_brushing_teeth", ["after i brush my teeth"], (($0) => 'after i brush my teeth'), undefined, {});
    $grammar.declareSymbol("on");
    $grammar.addRule("on", ["on"], (($0) => 'on'), undefined, {});
    $grammar.addRule("on", ["when it 's"], (($0) => 'when it \'s'), undefined, {});
    $grammar.addRule("on", ["when it is"], (($0) => 'when it is'), undefined, {});
    $grammar.declareSymbol("timer");
    if ($options.flags.extended_timers) {
        $grammar.addRule("timer", [new $runtime.NonTerminal("optional_once", undefined), new $runtime.NonTerminal("optional_emphasis", undefined), new $runtime.NonTerminal("at_noon", undefined)], (($0, $1, $2) => new thingtalk_1.Ast.Stream.AtTimer(null, [TIME_NOON], null, AT_TIMER_SCHEMA).toExpression()), undefined, {});
        $grammar.addRule("timer", [new $runtime.NonTerminal("optional_once", undefined), new $runtime.NonTerminal("optional_emphasis", undefined), new $runtime.NonTerminal("at_morning", undefined)], (($0, $1, $2) => new thingtalk_1.Ast.Stream.AtTimer(null, [TIME_MORNING], null, AT_TIMER_SCHEMA).toExpression()), undefined, {});
        $grammar.addRule("timer", [new $runtime.NonTerminal("optional_once", undefined), new $runtime.NonTerminal("optional_emphasis", undefined), new $runtime.NonTerminal("at_evening", undefined)], (($0, $1, $2) => new thingtalk_1.Ast.Stream.AtTimer(null, [TIME_EVENING], null, AT_TIMER_SCHEMA).toExpression()), undefined, {});
        $grammar.addRule("timer", [new $runtime.NonTerminal("optional_twice", undefined), new $runtime.NonTerminal("optional_per_day", undefined), new $runtime.NonTerminal("optional_comma", undefined), new $runtime.NonTerminal("optional_first", undefined), new $runtime.NonTerminal("optional_emphasis", undefined), new $runtime.NonTerminal("at_morning", undefined), new $runtime.NonTerminal("and", undefined), new $runtime.NonTerminal("optional_second", undefined), new $runtime.NonTerminal("optional_emphasis", undefined), new $runtime.NonTerminal("at_evening_second", undefined)], (($0, $1, $2, $3, $4, $5, $6, $7, $8, $9) => new thingtalk_1.Ast.Stream.AtTimer(null, [TIME_MORNING, TIME_EVENING], null, AT_TIMER_SCHEMA).toExpression()), undefined, {});
        $grammar.addRule("timer", [new $runtime.NonTerminal("when_brushing_teeth", undefined)], (($0) => new thingtalk_1.Ast.Stream.AtTimer(null, [TIME_MORNING, TIME_EVENING], null, AT_TIMER_SCHEMA).toExpression()), undefined, {});
    }
    $grammar.addRule("timer", [new $runtime.NonTerminal("once_per_day", undefined), "at", new $runtime.NonTerminal("constant_Time", undefined)], (($0, $1, time) => new thingtalk_1.Ast.Stream.AtTimer(null, [time], null, AT_TIMER_SCHEMA).toExpression()), undefined, {});
    $grammar.addRule("timer", [new $runtime.NonTerminal("twice_per_day", undefined), "at", new $runtime.NonTerminal("constant_Time", undefined), new $runtime.NonTerminal("and", undefined), new $runtime.NonTerminal("constant_Time", undefined)], (($0, $1, time1, $2, time2) => new thingtalk_1.Ast.Stream.AtTimer(null, [time1, time2], null, AT_TIMER_SCHEMA).toExpression()), undefined, {});
    $grammar.addRule("timer", [new $runtime.NonTerminal("thrice_per_day", undefined), "at", new $runtime.NonTerminal("constant_Time", undefined), new $runtime.NonTerminal("and", undefined), new $runtime.NonTerminal("constant_Time", undefined), new $runtime.NonTerminal("and", undefined), new $runtime.NonTerminal("constant_Time", undefined)], (($0, $1, time1, $2, time2, $3, time3) => new thingtalk_1.Ast.Stream.AtTimer(null, [time1, time2, time3], null, AT_TIMER_SCHEMA).toExpression()), undefined, {});
    if (!$options.flags.turking) {
        $grammar.addRule("timer", [new $runtime.NonTerminal("optional_once", undefined), new $runtime.NonTerminal("each", undefined), new $runtime.NonTerminal("constant_Measure_ms", undefined)], (($0, $1, interval) => new thingtalk_1.Ast.Stream.Timer(null, new thingtalk_1.Ast.Value.Date(null), interval, null, TIMER_SCHEMA).toExpression()), undefined, {});
        $grammar.addRule("timer", [new $runtime.NonTerminal("once_per_day", undefined)], (($0) => new thingtalk_1.Ast.Stream.Timer(null, new thingtalk_1.Ast.Value.Date(null), new thingtalk_1.Ast.Value.Measure(1, 'day'), null, TIMER_SCHEMA).toExpression()), undefined, {});
        $grammar.addRule("timer", [new $runtime.NonTerminal("optional_once", undefined), new $runtime.NonTerminal("each", undefined), "year"], (($0, $1, $2) => new thingtalk_1.Ast.Stream.Timer(null, new thingtalk_1.Ast.Value.Date(null), new thingtalk_1.Ast.Value.Measure(1, 'year'), null, TIMER_SCHEMA).toExpression()), undefined, {});
        $grammar.addRule("timer", [new $runtime.NonTerminal("optional_once", undefined), new $runtime.NonTerminal("each", undefined), "month"], (($0, $1, $2) => new thingtalk_1.Ast.Stream.Timer(null, new thingtalk_1.Ast.Value.Date(null), new thingtalk_1.Ast.Value.Measure(1, 'mon'), null, TIMER_SCHEMA).toExpression()), undefined, {});
        $grammar.addRule("timer", [new $runtime.NonTerminal("optional_once", undefined), new $runtime.NonTerminal("each", undefined), "week"], (($0, $1, $2) => new thingtalk_1.Ast.Stream.Timer(null, new thingtalk_1.Ast.Value.Date(null), new thingtalk_1.Ast.Value.Measure(1, 'week'), null, TIMER_SCHEMA).toExpression()), undefined, {});
        $grammar.addRule("timer", [new $runtime.NonTerminal("optional_once", undefined), new $runtime.NonTerminal("each", undefined), "hour"], (($0, $1, $2) => new thingtalk_1.Ast.Stream.Timer(null, new thingtalk_1.Ast.Value.Date(null), new thingtalk_1.Ast.Value.Measure(1, 'h'), null, TIMER_SCHEMA).toExpression()), undefined, {});
        $grammar.addRule("timer", [new $runtime.NonTerminal("constant_Number", undefined), "times", new $runtime.NonTerminal("each", undefined), "minute"], ((freq, $0, $1, $2) => new thingtalk_1.Ast.Stream.Timer(null, new thingtalk_1.Ast.Value.Date(null), new thingtalk_1.Ast.Value.Measure(1, 'min'), freq, TIMER_SCHEMA).toExpression()), undefined, {});
        $grammar.addRule("timer", [new $runtime.NonTerminal("constant_Number", undefined), "times", new $runtime.NonTerminal("each", undefined), "hour"], ((freq, $0, $1, $2) => new thingtalk_1.Ast.Stream.Timer(null, new thingtalk_1.Ast.Value.Date(null), new thingtalk_1.Ast.Value.Measure(1, 'h'), freq, TIMER_SCHEMA).toExpression()), undefined, {});
        $grammar.addRule("timer", [new $runtime.NonTerminal("constant_Number", undefined), "times", new $runtime.NonTerminal("each", undefined), "day"], ((freq, $0, $1, $2) => new thingtalk_1.Ast.Stream.Timer(null, new thingtalk_1.Ast.Value.Date(null), new thingtalk_1.Ast.Value.Measure(1, 'day'), freq, TIMER_SCHEMA).toExpression()), undefined, {});
        $grammar.addRule("timer", [new $runtime.NonTerminal("constant_Number", undefined), "times", new $runtime.NonTerminal("each", undefined), "week"], ((freq, $0, $1, $2) => new thingtalk_1.Ast.Stream.Timer(null, new thingtalk_1.Ast.Value.Date(null), new thingtalk_1.Ast.Value.Measure(1, 'week'), freq, TIMER_SCHEMA).toExpression()), undefined, {});
        $grammar.addRule("timer", [new $runtime.NonTerminal("constant_Number", undefined), "times", new $runtime.NonTerminal("each", undefined), "month"], ((freq, $0, $1, $2) => new thingtalk_1.Ast.Stream.Timer(null, new thingtalk_1.Ast.Value.Date(null), new thingtalk_1.Ast.Value.Measure(1, 'mon'), freq, TIMER_SCHEMA).toExpression()), undefined, {});
        $grammar.addRule("timer", [new $runtime.NonTerminal("constant_Number", undefined), "times", new $runtime.NonTerminal("each", undefined), "year"], ((freq, $0, $1, $2) => new thingtalk_1.Ast.Stream.Timer(null, new thingtalk_1.Ast.Value.Date(null), new thingtalk_1.Ast.Value.Measure(1, 'year'), freq, TIMER_SCHEMA).toExpression()), undefined, {});
        $grammar.addRule("timer", [new $runtime.NonTerminal("constant_Number", undefined), "times", new $runtime.NonTerminal("each", undefined), new $runtime.NonTerminal("constant_Measure_ms", undefined)], ((freq, $0, $1, interval) => new thingtalk_1.Ast.Stream.Timer(null, new thingtalk_1.Ast.Value.Date(null), interval, freq, TIMER_SCHEMA).toExpression()), undefined, {});
    }
}
exports.default = default_1;
;
//# sourceMappingURL=timers.genie.js.map