catala/compiler/surface/lexer_pl.cppo.ml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

148 lines
4.9 KiB
OCaml
Raw Normal View History

2021-08-19 19:26:06 +03:00
(* -*- coding: iso-latin-1 -*- *)
(* This file is part of the Catala compiler, a specification language for tax and social benefits
computation rules. Copyright (C) 2020 Inria, contributors: Denis Merigoux
<denis.merigoux@inria.fr>, Emile Rolley <emile.rolley@tuta.io>
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. *)
(* Defining the lexer macros for Polish *)
(* Tokens and their corresponding sedlex regexps *)
#define MS_SCOPE "zakres"
#define MS_CONSEQUENCE "konsekwencja"
2023-08-17 13:15:25 +03:00
#define MS_DATA "dane"
#define MS_DEPENDS "zależy od"
#define MR_DEPENDS "zale", 0x017C, "y", space_plus, "od"
2021-08-19 19:26:06 +03:00
#define MS_DECLARATION "deklaracja"
#define MS_CONTEXT "kontekst"
2023-08-17 13:15:25 +03:00
#define MS_DECREASING "malejący"
#define MR_DECREASING "malej", 0x0105, ",cy"
2023-08-17 13:15:25 +03:00
#define MS_INCREASING "rosnący"
#define MR_INCREASING "rosn", 0x0105, "cy"
2021-08-19 19:26:06 +03:00
#define MS_OF "z"
#define MS_COLLECTION "kolekcja"
#define MS_CONTAINS "zawiera"
2021-08-19 19:26:06 +03:00
#define MS_ENUM "enumeracja"
2023-08-17 13:15:25 +03:00
#define MS_INTEGER "całkowita"
#define MR_INTEGER "ca", 0x0142, "kowita"
#define MS_MONEY "pieniądze"
2021-08-19 19:26:06 +03:00
#define MR_MONEY "pieni", 0x0105, "dze"
#define MS_TEXT "tekst"
#define MS_DECIMAL "dziesiętny"
2021-08-19 19:26:06 +03:00
#define MR_DECIMAL "dziesi", 0x0119, "tny"
#define MS_DATE "czas"
#define MS_DURATION "czas trwania"
#define MR_DURATION "czas", space_plus, "trwania"
#define MS_BOOLEAN "zerojedynkowy"
#define MS_SUM "suma"
2023-08-17 13:15:25 +03:00
#define MS_FILLED "spełnione"
#define MR_FILLED "spe", 0x0142, "nione"
2021-08-19 19:26:06 +03:00
#define MS_DEFINITION "definicja"
2022-02-28 16:33:07 +03:00
#define MS_STATE "stan"
2021-08-19 19:26:06 +03:00
#define MS_LABEL "etykieta"
#define MS_EXCEPTION "wyjątek"
2021-08-19 19:26:06 +03:00
#define MR_EXCEPTION "wyj", 0x0105, "tek"
#define MS_DEFINED_AS "wynosi"
#define MS_MATCH "pasuje"
#define MS_WILDCARD "cokolwiek"
#define MS_WITH "ze wzorem"
#define MR_WITH "ze", space_plus, "wzorem"
#define MS_UNDER_CONDITION "pod warunkiem"
#define MR_UNDER_CONDITION "pod", space_plus, "warunkiem"
2023-08-17 13:15:25 +03:00
#define MS_IF "jeżeli"
#define MR_IF "je", 0x017C, "eli"
2021-08-19 19:26:06 +03:00
#define MS_THEN "wtedy"
#define MS_ELSE "inaczej"
#define MS_CONDITION "warunek"
#define MS_CONTENT "typu"
#define MS_STRUCT "struktura"
#define MS_ASSERTION "asercja"
2023-08-17 13:15:25 +03:00
#define MS_VARIES "różna"
#define MR_VARIES "r", 0xf3, 0x017C, "na"
2021-08-19 19:26:06 +03:00
#define MS_WITH_V "wraz z"
#define MR_WITH_V "wraz", space_plus, "z"
#define MS_FOR "dla"
#define MS_ALL "wszystkie"
#define MS_WE_HAVE "mamy"
2023-08-17 13:15:25 +03:00
#define MS_FIXED "stałoprzecinkowa"
#define MR_FIXED "sta", 0x0142, "oprzecinkowa"
2021-08-19 19:26:06 +03:00
#define MS_BY "przez"
#define MS_RULE "zasada"
2022-07-26 14:40:43 +03:00
#define MS_LET "niech"
2021-08-19 19:26:06 +03:00
#define MS_EXISTS "istnieje"
2023-08-17 13:15:25 +03:00
#define MS_IN "w"
#define MS_AMONG "wśród"
2023-08-17 13:15:25 +03:00
#define MR_AMONG "w", 0x15B, "r", 0xf3, "d"
#define MS_SUCH "takie że"
#define MR_SUCH "takie", space_plus, 0x017C, "e"
2021-08-19 19:26:06 +03:00
#define MS_THAT "to"
#define MS_AND "i"
#define MS_OR "lub"
2023-08-17 13:15:25 +03:00
#define MS_XOR "albo"
2021-08-19 19:26:06 +03:00
#define MS_NOT "nie"
2023-08-17 13:15:25 +03:00
#define MS_MAXIMUM "maksimum"
2021-08-19 19:26:06 +03:00
#define MS_MINIMUM "minimum"
2022-12-12 18:02:07 +03:00
#define MS_IS "jest"
#define MS_EMPTY "pusty"
2021-08-19 19:26:06 +03:00
#define MS_CARDINAL "liczba"
#define MS_YEAR "rok"
2023-08-17 13:15:25 +03:00
#define MS_MONTH "miesiąc"
#define MR_MONTH "miesi", 0x0105, "c"
2023-08-17 13:15:25 +03:00
#define MS_DAY "dzień"
#define MR_DAY "dzie", 0x0144
2021-08-19 19:26:06 +03:00
#define MS_TRUE "prawda"
2023-08-17 13:15:25 +03:00
#define MS_FALSE "fałsz"
#define MR_FALSE "fa", 0x0142, "sz"
#define MS_INPUT "wejście"
#define MR_INPUT "wej", 0x15B, "cie"
#define MS_OUTPUT "wyjście"
#define MR_OUTPUT "wyj", 0x15B, "cie"
#define MS_INTERNAL "wewnętrzny"
#define MR_INTERNAL "wewn", 0x0119, "trzny"
2021-08-19 19:26:06 +03:00
2021-08-19 21:32:23 +03:00
(* Specific delimiters *)
2023-08-17 13:15:25 +03:00
#define MS_MONEY_OP_SUFFIX "PLN"
#define MC_DECIMAL_SEPARATOR '.'
#define MR_MONEY_PREFIX ""
#define MR_MONEY_DELIM ','
#define MR_MONEY_SUFFIX Star hspace, "PLN"
2021-08-19 19:26:06 +03:00
(* Builtins *)
#define MS_Round "zaokrąglony"
2023-08-17 13:15:25 +03:00
#define MR_Round "zaokr", 0x0105, "glony"
#define MS_GetDay "dostęp_dzień"
#define MR_GetDay "dost", 0x0119, "p_dzie", 0x144
#define MS_GetMonth "dostęp_miesiąc"
#define MR_GetMonth "dost", 0x0119, "p_miesi", 0x0105, "c"
#define MS_GetYear "dostęp_rok"
#define MR_GetYear "dost", 0x0119, "p_rok"
#define MS_FirstDayOfMonth "pierwszy_dzień_miesiąca"
#define MR_FirstDayOfMonth "pierwszy_dzie", 0x144, "_miesi", 0x0105, "ca"
#define MS_LastDayOfMonth "ostatni_dzień_miesiąca"
#define MR_LastDayOfMonth "ostatni_dzie", 0x144, "_miesi", 0x0105, "ca"
2021-08-19 19:26:06 +03:00
(* Directives *)
#define MR_LAW_INCLUDE "Include"
2023-09-05 16:00:55 +03:00
#define MR_MODULE_DEF "Module"
#define MR_MODULE_USE "Using"
#define MR_MODULE_ALIAS "as"
#define MR_EXTERNAL "external"
2021-08-19 19:26:06 +03:00
#define MX_AT_PAGE \
'@', Star hspace, "p.", Star hspace, Plus digit -> \
let s = Utf8.lexeme lexbuf in \
let i = String.index s '.' in \
AT_PAGE (int_of_string (String.trim (String.sub s i (String.length s - i))))