"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const winCondition_1 = require("../models/winCondition");
exports.WINCONDITIONS_GRAMMAR = `
    WinConditionItem
        = WinConditionItemSimple
        | WinConditionItemOn

    WinConditionItemSimple = winConditionItemPrefix lookupRuleVariableName lineTerminator+
    WinConditionItemOn = winConditionItemPrefix lookupRuleVariableName t_ON lookupRuleVariableName lineTerminator+

    winConditionItemPrefix
        = t_NO
        | t_ALL
        | t_ANY
        | t_SOME
`;
function getWinConditionSemantics() {
    return {
        WinConditionItemSimple(qualifier, spriteName, _whitespace) {
            return new winCondition_1.WinConditionSimple(this.source, qualifier.parse(), spriteName.parse());
        },
        WinConditionItemOn(qualifier, sprite, _on, onSprite, _whitespace) {
            return new winCondition_1.WinConditionOn(this.source, qualifier.parse(), sprite.parse(), onSprite.parse());
        },
        winConditionItemPrefix(qualifier) {
            switch (qualifier.parse()) {
                case winCondition_1.WIN_QUALIFIER.ALL:
                    return winCondition_1.WIN_QUALIFIER.ALL;
                case winCondition_1.WIN_QUALIFIER.ANY:
                    return winCondition_1.WIN_QUALIFIER.ANY;
                case winCondition_1.WIN_QUALIFIER.NO:
                    return winCondition_1.WIN_QUALIFIER.NO;
                case winCondition_1.WIN_QUALIFIER.SOME:
                    return winCondition_1.WIN_QUALIFIER.SOME;
            }
        }
    };
}
exports.getWinConditionSemantics = getWinConditionSemantics;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2luQ29uZGl0aW9uR3JhbW1hci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wYXJzZXIvd2luQ29uZGl0aW9uR3JhbW1hci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUVBLHlEQUEwRjtBQUc3RSxRQUFBLHFCQUFxQixHQUFHOzs7Ozs7Ozs7Ozs7O0NBYXBDLENBQUE7QUFFRCxTQUFnQix3QkFBd0I7SUFDcEMsT0FBTztRQUN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