"use strict";
// -*- mode: typescript; 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>
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const thingtalk_1 = require("thingtalk");
const C = __importStar(require("./ast_manip"));
async function default_1($runtime, $ttUtils, $options, $locale, $grammar, $loader) {
    await (await $runtime.import("./common-constants.genie", __dirname))($runtime, $ttUtils, $options, $locale, $grammar, $loader);
    $grammar.declareSymbol("thingpedia_complete_query");
    $grammar.declareSymbol("thingpedia_complete_get_command");
    $grammar.declareSymbol("thingpedia_complete_stream");
    $grammar.declareSymbol("thingpedia_complete_action");
    $grammar.declareSymbol("thingpedia_complete_action_past");
    $grammar.declareSymbol("thingpedia_complete_join_action_past");
    $grammar.declareSymbol("thingpedia_complete_program");
    $grammar.declareSymbol("thingpedia_who_question");
    $grammar.declareSymbol("thingpedia_search_question");
    $grammar.declareSymbol("thingpedia_slot_fill_question");
    $grammar.declareSymbol("thingpedia_user_question");
    $grammar.declareSymbol("thingpedia_result");
    $grammar.declareSymbol("thingpedia_error_message");
    $grammar.declareSymbol("same_sentence_coref");
    $grammar.declareSymbol("context_coref");
    $grammar.declareSymbol("list_context_coref");
    $grammar.declareSymbol("coref_constant");
    $grammar.declareSymbol("placeholder");
    $grammar.declareSymbol("constant_or_undefined");
    $grammar.addRule("constant_or_undefined", [new $runtime.NonTerminal("placeholder", undefined)], ((pl) => {
        const v = new thingtalk_1.Ast.Value.Undefined(true);
        // override getType() so we can do type-checks
        v.getType = () => pl.type;
        return v;
    }), C.valueKeyFn, {});
    $grammar.declareSymbol("table_join_replace_placeholder");
    $grammar.declareSymbol("action_replace_param_with_table");
    $grammar.declareSymbol("action_replace_param_with_stream");
    $grammar.declareSymbol("with_filtered_table");
    $grammar.declareSymbol("with_arg_min_max_table");
    $grammar.declareSymbol("projection_Any");
    $grammar.declareSymbol("stream_projection_Any");
    $grammar.declareSymbol("stream_coref_same_sentence");
    $grammar.declareSymbol("stream_coref_context");
    $grammar.declareSymbol("stream_coref_list_context");
    $grammar.declareSymbol("action_coref_same_sentence");
    $grammar.declareSymbol("action_coref_context");
    $grammar.declareSymbol("action_coref_list_context");
    $grammar.declareSymbol("query_coref_same_sentence");
    $grammar.declareSymbol("query_coref_context");
    $grammar.declareSymbol("query_coref_list_context");
    $grammar.declareSymbol("get_command_coref_same_sentence");
    $grammar.declareSymbol("get_command_coref_context");
    $grammar.declareSymbol("get_command_coref_list_context");
    $grammar.declareSymbol("out_param_Any");
    $grammar.declareSymbol("the_out_param_Any");
    $grammar.declareSymbol("out_param_Array__Any");
    $grammar.declareSymbol("out_param_Array__Compound");
    $grammar.declareSymbol("out_param_ArrayCount");
    $grammar.declareSymbol("out_param_npp");
    $grammar.declareSymbol("out_param_npi");
    $grammar.declareSymbol("out_param_avp");
    $grammar.declareSymbol("out_param_pvp");
    $grammar.declareSymbol("out_param_npv");
    $grammar.declareSymbol("out_param_apv");
    $grammar.declareSymbol("input_param");
    $grammar.declareSymbol("both_prefix");
    $grammar.addRule("both_prefix", [""], (($0) => ""), undefined, { identity: (true) });
    $grammar.declareSymbol("npp_filter");
    $grammar.declareSymbol("npp_input_param");
    $grammar.declareSymbol("npp_argminmax");
    $grammar.declareSymbol("coref_npp_filter");
    $grammar.declareSymbol("coref_npp_input_param");
    $grammar.declareSymbol("npp_boolean_projection");
    $grammar.declareSymbol("npi_filter");
    $grammar.declareSymbol("npi_input_param");
    $grammar.declareSymbol("npi_argminmax");
    $grammar.declareSymbol("coref_npi_filter");
    $grammar.declareSymbol("coref_npi_input_param");
    $grammar.declareSymbol("npi_boolean_projection");
    $grammar.declareSymbol("pvp_filter");
    $grammar.declareSymbol("pvp_input_param");
    $grammar.declareSymbol("pvp_argminmax");
    $grammar.declareSymbol("coref_pvp_filter");
    $grammar.declareSymbol("coref_pvp_input_param");
    $grammar.declareSymbol("pvp_boolean_projection");
    $grammar.declareSymbol("preposition_filter");
    $grammar.declareSymbol("preposition_input_param");
    $grammar.declareSymbol("preposition_argminmax");
    $grammar.declareSymbol("coref_preposition_filter");
    $grammar.declareSymbol("coref_preposition_input_param");
    $grammar.declareSymbol("preposition_boolean_projection");
    $grammar.declareSymbol("avp_filter");
    $grammar.declareSymbol("avp_input_param");
    $grammar.declareSymbol("avp_argminmax");
    $grammar.declareSymbol("coref_avp_filter");
    $grammar.declareSymbol("coref_avp_input_param");
    $grammar.declareSymbol("avp_boolean_projection");
    $grammar.declareSymbol("npv_filter");
    $grammar.declareSymbol("npv_input_pconstant_namearam");
    $grammar.declareSymbol("npv_argminmax");
    $grammar.declareSymbol("coref_npv_filter");
    $grammar.declareSymbol("coref_npv_input_param");
    $grammar.declareSymbol("npv_boolean_projection");
    $grammar.declareSymbol("apv_filter");
    $grammar.declareSymbol("apv_input_param");
    $grammar.declareSymbol("apv_argminmax");
    $grammar.declareSymbol("coref_apv_filter");
    $grammar.declareSymbol("coref_apv_input_param");
    $grammar.declareSymbol("apv_boolean_projection");
    $grammar.declareSymbol("reverse_verb_filter");
    $grammar.declareSymbol("reverse_verb_input_param");
    $grammar.declareSymbol("coref_reverse_verb_filter");
    $grammar.declareSymbol("coref_reverse_verb_input_param");
    $grammar.declareSymbol("question_projection_table");
    $grammar.declareSymbol("command_projection_table");
    $grammar.declareSymbol("constant_name");
    $grammar.addRule("constant_name", [new $runtime.NonTerminal("constant_Number", undefined)], (($0) => { return $0; }), C.entityOrNumberValueKeyFn, { identity: (true) });
    $grammar.declareSymbol("the_base_table");
    $grammar.declareSymbol("base_table");
    $grammar.declareSymbol("base_noun_phrase");
    $grammar.declareSymbol("generic_anything_noun_phrase");
    $grammar.declareSymbol("generic_base_noun_phrase");
}
exports.default = default_1;
;
//# sourceMappingURL=common.genie.js.map