File: type-grammar.lark

package info (click to toggle)
python-awkward 2.6.5-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 23,088 kB
  • sloc: python: 148,689; cpp: 33,562; sh: 432; makefile: 21; javascript: 8
file content (82 lines) | stat: -rw-r--r-- 2,265 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
start: input

input: record
     | unknown
     | primitive
     | optiontype
     | regular
     | listtype
     | uniontype
     | predefined_typestr
     | categories

record: record_tuple
      | record_tuple_param
      | record_dict
      | record_struct
      | record_highlevel
primitive: TYPE [options]
unknown: "unknown" [options]
optiontype: option_single
          | option_parm
          | option_highlevel
regular: regular_inparm
       | regular_outparm
listtype: list_single
        | list_parm
uniontype: union_single
         | union_parm
categories: "categorical" "[" "type" "=" input "]"
predefined_typestr: HARDCODED

HARDCODED: "string"
         | "char"
         | "bytes"
         | "byte"
option_single: "?" input [options]
option_parm: "option" "[" input "," def_option "]"
option_highlevel: "option" "[" input "]"
union_single: "union" "[" input [ "," input]* "]"
union_parm: "union" "[" input [ "," input]* "," def_option "]"
list_parm: "[" "var" "*" input "," def_option "]"
list_single: "var" "*" input
record_tuple: "(" input ["," input]* ")"
record_tuple_param: "tuple" "[" "[" input ["," input]* "]" "," def_option "]"
record_dict: "{" string ":" input ["," string ":" input]* "}"
record_struct: "struct" "[" "[" string ["," string]* "]" "," "[" input ["," input]* "]" "," def_option "]"
record_highlevel: UNQUOTED_STRING "[" string ":" input ["," string ":" input]* "]"
regular_inparm: number "*" input
regular_outparm: "[" number "*" input "," def_option "]"
options: "[" def_option "]"
def_option: "parameters" "=" dict_obj
TYPE: "int8"
    | "int16"
    | "int32"
    | "int64"
    | "int128"
    | "uint8"
    | "uint16"
    | "uint32"
    | "uint64"
    | "uint128"
    | "float32"
    | "float64"
    | "bool"
?json: dict_obj
     | list_obj
     | string
     | number
     | "true"             -> true
     | "false"            -> false
     | "null"             -> null
list_obj: "[" [json ("," json)*] "]"
dict_obj: "{" [pair ("," pair)*] "}"
pair: string ":" json
string: /((?:"(?:[^"\n\r\\]|(?:\\u[0-9a-fA-F]{4})|(?:\\["bfnrt]))*")|(?:\\\'(?:[^\\\'\n\r\\]|(?:\\u[0-9a-fA-F]{4})|(?:\\[\'bfnrt]))*")*\\\')/
UNQUOTED_STRING.-1: /[a-zA-Z]+/
number: SIGNED_NUMBER

%import common.SIGNED_NUMBER
%import common.WS

%ignore WS